/* Complete redesign with sidebar layout and brand colors */
/* Reset and base configuration */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #009be7;
  --primary-dark: #0088cc;
  --primary-light: #33aaeb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --sidebar-width: 320px;
  --header-height: 64px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  overflow-x: hidden;
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 1500; /* Increased z-index to ensure header stays above sidebar */
}

.mobile-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 1000; /* Lower than mobile header */
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.logo-text {
  flex: 1;
}

.sidebar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.sidebar-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Improved sidebar close button with modern design and SVG icon */
.sidebar-close {
  display: none;
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 400;
  box-shadow: var(--shadow-sm);
}

.sidebar-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
  transform: scale(1.05);
}

.sidebar-close:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-sm);
}

.sidebar-close::before {
  content: "✕";
  font-size: 14px;
  line-height: 1;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-md);
}

.nav-icon {
  flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--border-light);
}

.copyright {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.content-container {
  flex: 1;
  max-width: 1024px;
  margin: 0 auto;
  padding: 32px;
  width: 100%;
}

/* Desktop Header */
.desktop-header {
  margin-bottom: 32px;
}

.content-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.content-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.content-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.content-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
}

.content-divider {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border-radius: 2px;
  width: 96px;
}

/* Content Wrapper */
.content-wrapper {
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  padding: 32px;
  margin-bottom: 32px;
}

.content-section {
  line-height: 1.7;
}

.content-section h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.content-section h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 16px 0;
}

.content-section h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 12px 0;
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 16px;
}

.content-section ul {
  margin: 16px 0 16px 24px;
}

.content-section li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 16px;
}

.content-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Content Footer */
.content-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.last-updated {
  font-size: 14px;
  color: var(--text-muted);
}

/* Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(3.5px, -3.5px);
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900; /* Lower than sidebar */
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Utility Classes */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
  }

  .content-container {
    padding: 24px;
  }

  .sidebar {
    transform: translateX(-100%);
    top: var(--header-height); /* Position sidebar below mobile header */
    height: calc(100vh - var(--header-height));
    z-index: 1200; /* Higher z-index for mobile sidebar */
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .mobile-header {
    display: block;
  }

  .main-content {
    padding-top: var(--header-height);
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .menu-toggle {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
    top: var(--header-height); /* Position overlay below mobile header */
    z-index: 1100; /* Between sidebar and header */
  }

  .sidebar-close {
    display: flex;
  }
}

@media (max-width: 768px) {
  .content-container {
    padding: 16px;
  }

  .content-wrapper {
    padding: 20px;
  }

  .content-title {
    font-size: 24px;
  }

  .content-section h2 {
    font-size: 24px;
  }

  .content-section h3 {
    font-size: 18px;
  }

  .content-footer {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .mobile-header-content {
    padding: 0 12px;
  }

  .content-container {
    padding: 12px;
  }

  .content-wrapper {
    padding: 16px;
  }

  .sidebar-header {
    padding: 20px;
  }

  .sidebar-nav {
    padding: 12px;
  }

  .sidebar-footer {
    padding: 20px;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.nav-item:focus,
.sidebar-close:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Animation for content changes */
.content-section {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}