/* ============================================
   HEADER STYLES - Pro Compressor
   ============================================ */

:root {
  --header-height: 70px;
  --header-bg: rgba(255, 255, 255, 0.95);
  --header-bg-dark: rgba(30, 30, 35, 0.95);
  --header-border: rgba(0, 0, 0, 0.08);
  --header-border-dark: rgba(255, 255, 255, 0.08);
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-primary-dark: #f9fafb;
  --text-secondary-dark: #9ca3af;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode variables */
[data-theme="dark"] {
  --header-bg: var(--header-bg-dark);
  --header-border: var(--header-border-dark);
  --text-primary: var(--text-primary-dark);
  --text-secondary: var(--text-secondary-dark);
}

/* Header Container */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--header-border);
  z-index: 1000;
  transition: var(--transition-smooth);
}

.header--hidden {
  transform: translateY(-100%);
}

.header--visible {
  transform: translateY(0);
}

.header__container {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.header__logo:hover {
  opacity: 0.8;
}

.header__logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.header__logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

/* Right Section */
.header__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Theme Toggle - iPhone Style */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  outline: none;
  padding: 0;
  flex-shrink: 0;
}

[data-theme="dark"] .theme-toggle {
  background: #3b82f6;
}

.theme-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
}

[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(20px);
}

/* Hamburger Menu */
.hamburger {
  width: 24px;
  height: 20px;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  background: none;
  border: none;
  outline: none;
  z-index: 1002;
  flex-shrink: 0;
}

.hamburger__line {
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-smooth);
  transform-origin: center;
}

.hamburger--active .hamburger__line:nth-child(1) {
  transform: translateY(8.75px) rotate(45deg);
}

.hamburger--active .hamburger__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger--active .hamburger__line:nth-child(3) {
  transform: translateY(-8.75px) rotate(-45deg);
}

/* Navigation Menu */
.nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--header-border);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  z-index: 999;
}

.nav--open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.nav__list {
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 1280px;
  margin: 0 auto;
}

.nav__item {
  width: 100%;
}

.nav__link {
  display: block;
  padding: 12px 14px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  transition: var(--transition-smooth);
}

.nav__link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.nav__link--active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-color);
}

/* Tablet and above */
@media (min-width: 640px) {
  .header__container {
    padding: 0 20px;
  }
  
  .header__logo-img {
    width: 34px;
    height: 34px;
  }
  
  .header__logo-text {
    font-size: 1.25rem;
  }
  
  .header__right {
    gap: 14px;
  }
  
  .theme-toggle {
    width: 48px;
    height: 26px;
  }
  
  .theme-toggle__thumb {
    width: 22px;
    height: 22px;
  }
  
  [data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(22px);
  }
  
  .nav__list {
    padding: 14px 20px;
  }
  
  .nav__link {
    padding: 14px 16px;
    font-size: 0.95rem;
  }
}

/* Desktop Navigation */
@media (min-width: 768px) {
  .header__container {
    padding: 0 24px;
  }
  
  .hamburger {
    display: none;
  }

  .nav {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    background: transparent;
    backdrop-filter: none;
    border: none;
    width: auto;
  }

  .nav__list {
    flex-direction: row;
    padding: 0;
    gap: 4px;
  }

  .nav__item {
    width: auto;
  }

  .nav__link {
    padding: 8px 12px;
    font-size: 0.875rem;
    white-space: nowrap;
  }
  
  .header__right {
    gap: 16px;
  }
}

/* Large Desktop */
@media (min-width: 1024px) {
  .header__logo-text {
    font-size: 1.4rem;
  }
  
  .nav__link {
    padding: 10px 14px;
    font-size: 0.9375rem;
  }
  
  .header__right {
    gap: 20px;
  }
  
  .theme-toggle {
    width: 52px;
    height: 28px;
  }
  
  .theme-toggle__thumb {
    width: 24px;
    height: 24px;
  }
  
  [data-theme="dark"] .theme-toggle__thumb {
    transform: translateX(24px);
  }
}

/* Overlay for mobile menu */
.nav-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  z-index: 998;
}

.nav-overlay--visible {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 768px) {
  .nav-overlay {
    display: none;
  }
}

/* Smooth scroll offset for fixed header */
html {
  scroll-padding-top: calc(var(--header-height) + 20px);
}
