/* === HEADER NAVIGATION SYSTEM === */

.app-header {
  /* Mobile-first: Start with minimal padding */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--spacing-3xl);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px) saturate(180%);
  -webkit-backdrop-filter: blur(4px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--box-shadow);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 var(--spacing-sm);
  z-index: var(--z-overlay);
}

.header-logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacing-sm);
}

/* Apply frosted glass styling to all buttons in header */
.header-actions .btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--gray-200);
  transition: all 0.3s ease;
}

.header-actions .btn:hover {
  border-color: var(--accent-color);
  box-shadow: 0px 0px 12px 1px var(--accent-glow-shadow);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  transform: translateY(-1px);
}

/* Color-specific frosted glass variants for header buttons */
.header-actions .btn--primary {
  border-color: color-mix(in srgb, var(--accent-color) 40%, transparent);
  color: var(--accent-color);
}

.header-actions .btn--primary:hover {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 15%, transparent);
  color: var(--accent-color);
}

.header-actions .btn--success {
  border-color: color-mix(in srgb, var(--success-color) 40%, transparent);
  color: var(--success-color);
}

.header-actions .btn--success:hover {
  border-color: var(--success-color);
  background: color-mix(in srgb, var(--success-color) 15%, transparent);
  color: var(--success-color);
  box-shadow: 0px 0px 12px 1px color-mix(in srgb, var(--success-color) 40%, transparent);
}

.header-actions .btn--icon {
  color: var(--gray-200);
}

.header-actions .btn--icon:hover {
  color: white;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
}

.header-right {
  gap: var(--spacing-sm);
  justify-self: end;
}

/* Right-aligned Navigation (above 730px) */
.header-nav {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
  justify-self: end;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-color);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.nav-btn:hover {
  background: var(--gray-500);
  color: var(--accent-color);
}

.nav-btn--active {
  background: var(--accent-color);
  color: white;
}

.nav-btn--active:hover {
  background: color-mix(in srgb, var(--accent-color) 80%, black);
}
.app-title { color: var(--accent-color); font-weight: 600; font-size: 1.1rem; }
.header-logo-link {
  text-decoration: none;
  transition: opacity 0.2s ease;
  cursor: pointer;
}
.header-logo-link:hover {
  opacity: 0.8;
  text-decoration: none;
}
.header-logo {
  height: 48px;
  width: auto;
  display: block;
  /* Prevent squishing on narrow screens */
  min-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

/* User Dropdown Styles */
.user-dropdown { position: relative; margin-left: var(--spacing-md); }
.user-dropdown-btn {
  width: calc(var(--header-content-height) - var(--spacing-xs));
  height: calc(var(--header-content-height) - var(--spacing-xs));
  border-radius: 50%;
  background: var(--gray-500);
  border: 1px solid var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}
.user-dropdown-btn:hover { background: var(--gray-400); }
.user-avatar { font-size: 1.2rem; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--gray-300); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + var(--spacing-sm));
  right: 0;
  background: var(--gray-800);
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: var(--z-overlay);
}
.dropdown-menu-item {
  display: block;
  width: 100%;
  padding: var(--spacing-md-sm) var(--spacing-md);
  background: transparent;
  border: none;
  color: var(--text-color);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s;
}
.dropdown-menu-item:hover { background: var(--gray-500); }
.dropdown-menu-item:not(:last-child) { border-bottom: 1px solid var(--gray-500); }

/* === BOTTOM NAVIGATION BAR === */
/* Mobile-friendly bottom navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--spacing-3xl);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px) saturate(180%);
  -webkit-backdrop-filter: blur(4px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 -2px 8px var(--shadow-color);
  display: flex; /* Always visible */
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--spacing-md);
  z-index: var(--z-overlay);
}

.bottom-nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--gray-200);
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-xl);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  position: relative;
}

.bottom-nav-btn:hover {
  border-color: var(--accent-color);
  box-shadow: 0px 0px 12px 1px var(--accent-glow-shadow);
  background: rgba(255, 255, 255, 0.15);
  color: white;
  transform: translateY(-1px);
}

.bottom-nav-btn--active {
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 15%, transparent);
  color: var(--accent-color);
  box-shadow: 0px 0px 8px 1px var(--accent-glow-shadow);
}

.bottom-nav-btn--active:hover {
  background: color-mix(in srgb, var(--accent-color) 20%, transparent);
  color: var(--accent-color);
  transform: translateY(-1px);
}

/* Header user button - visible on desktop, hidden on mobile */
.header-user-btn {
  display: inline-flex;
}

/* Mobile Navigation Responsive Styles */

/* Icon-only navigation buttons at 730px and below */
@media screen and (max-width: 730px) {
  /* Hide text in navigation buttons, keeping only icons */
  .nav-btn {
    font-size: 0; /* Hide text content */
    padding: var(--spacing-xs);
    min-width: 40px;
    justify-content: center;
  }

  /* Ensure icons remain visible with proper size */
  .nav-btn i[data-lucide] {
    font-size: initial; /* Reset font-size for icons */
  }

  /* Ensure SVG icons display properly */
  .nav-btn svg {
    display: inline-block !important;
  }

  /* Hide regular header navigation on mobile */
  .header-nav {
    display: none !important;
  }

  /* Hide header user button on mobile - user is in bottom nav */
  .header-user-btn {
    display: none !important;
  }

  /* Simplify header to logo only - full width centered */
  .app-header {
    padding: 0 var(--spacing-sm);
    height: var(--spacing-3xl);
    /* Simple flexbox layout for centered logo */
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-logo-container {
    justify-content: center;
    width: 100%;
  }

  /* Ensure logo link fits the image exactly for perfect centering */
  .header-logo-link {
    display: inline-block;
    line-height: 0; /* Remove any text spacing */
    width: fit-content; /* Make link exactly match image width */
    padding: 0; /* Remove any default padding */
    margin: 0; /* Remove any default margin */
  }

  /* Hide user dropdown and actions on mobile - user is in bottom nav */
  .header-actions {
    display: none;
  }

  .header-logo {
    height: 48px;
    min-width: 100px; /* Maintain good proportions */
    width: auto; /* Let image size naturally while respecting height */
    max-width: 320px; /* Prevent it from getting too large */
  }

  .header-title {
    font-size: 1.2rem;
  }

  .header-actions {
    gap: var(--spacing-2xs);
  }
}

/* Mobile phones */
@media screen and (max-width: 480px) {
  /* Header refinements for mobile - inherits stacked layout from 730px */
  .app-header {
    padding: var(--spacing-xs) var(--spacing-2xs);
    min-height: calc(var(--spacing-3xl) - var(--spacing-xs));
    gap: var(--spacing-2xs);
  }

  .header-nav {
    gap: var(--spacing-xs);
  }

  .header-logo {
    height: 48px;
    min-width: 80px; /* Smaller minimum on mobile but still proportional */
    width: auto; /* Natural image width for proper centering */
    max-width: 300px; /* Prevent it from getting too large */
  }

  .header-title {
    font-size: 1.1rem;
  }
}

/* Extra small phones (iPhone SE, etc.) */
@media screen and (max-width: 375px) {
  /* Header ultra-compact - inherits stacked layout from 730px */
  .app-header {
    min-height: calc(var(--spacing-3xl) - var(--spacing-sm));
    gap: var(--spacing-2xs);
    padding: var(--spacing-2xs);
  }

  .header-logo {
    height: 48px;
    min-width: 60px; /* Even smaller but still proportional */
    width: 90%; /* Fill most of the screen width on smallest screens */
    max-width: 280px; /* Prevent it from getting too large */
  }

  .header-nav {
    gap: var(--spacing-2xs);
  }

  .nav-btn {
    padding: var(--spacing-2xs) var(--spacing-xs);
    font-size: var(--font-2xs);
  }

  .header-title {
    font-size: var(--font-md);
  }
}

/* === HEADER MOBILE-FIRST ENHANCEMENTS === */

/* Small tablets - enhance header padding */
@media screen and (min-width: 481px) {
  .app-header {
    padding: 0 var(--spacing-md);
  }
}

/* Large tablets - enhance header height and content */
@media screen and (min-width: 769px) {
  .app-header {
    height: var(--header-height);
    padding: 0 var(--spacing-md);
  }

  .header-content {
    padding: 0 var(--spacing-sm);
  }

  .header-title {
    font-size: 1.4rem;
  }
}

/* Desktop - full header enhancement */
@media screen and (min-width: 1025px) {
  .app-header {
    padding: 0 var(--spacing-lg);
  }

  .header-content {
    padding: 0 var(--spacing-md);
  }
}

/* Desktop: Remove bottom padding when bottom nav is hidden */
@media screen and (min-width: 731px) {
  body {
    padding-bottom: 0 !important;
  }
}

/* Print styles moved to print.css */