/* Premium Mobile Header Styles - Apple Inspired */

/* Hide mobile toggle by default on desktop */
.mobile-menu-toggle {
  display: none;
}

/* Critical overrides for mobile */
@media (max-width: 768px) {
  /* Force override existing mobile nav styles */
  body .header .container .nav-menu {
    position: static !important;
    transform: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    border-bottom: none !important;
    flex-direction: row !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: auto !important;
  }
  
  /* Ensure body doesn't have scroll issues */
  body.mobile-menu-open {
    overflow: auto !important;
  }
  
  body.mobile-menu-open::after {
    display: none !important;
  }
}

/* User-Centric Mobile Header - Apple UX Standards */
@media (max-width: 768px) {
  /* Override any existing mobile navigation styles */
  .nav-menu {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    transition: none !important;
    border-bottom: none !important;
    padding: 0 !important;
    z-index: auto !important;
    flex-direction: row !important;
    gap: 0 !important;
    order: 1 !important;
    width: 100% !important;
    margin-top: 0 !important;
  }
  
  .nav-menu.active {
    transform: none !important;
  }

  /* Optimized Header Layout - Search Priority */
  .header {
    padding: 8px 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: saturate(180%) blur(25px);
    -webkit-backdrop-filter: saturate(180%) blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
  }
  
  /* Ensure content doesn't hide behind fixed header */
  body {
    padding-top: 120px; /* Adjust based on header height */
  }
  
  .header .container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    max-width: 100%;
    padding: 0 12px;
  }
  
  /* Row 1: Compact Logo + Premium Search Bar */
  .header-top-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
  }
  
  /* Minimal logo for maximum search space */
  .logo {
    flex-shrink: 0;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .logo img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }
  
  .logo span {
    font-size: 0.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  /* PRIORITY: Large, prominent search section */
  .header-search {
    flex: 1;
    margin: 0;
    display: block;
    position: relative;
  }
  
  .search-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 25px;
    padding: 12px 18px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
  
  .search-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(0, 122, 255, 0.8);
    box-shadow: 0 8px 30px rgba(0, 122, 255, 0.25);
    transform: translateY(-1px);
  }
  
  .search-wrapper i {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-right: 12px;
    transition: color 0.3s ease;
  }
  
  .search-wrapper:focus-within i {
    color: rgba(0, 122, 255, 0.9);
  }
  
  .search-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.01em;
  }
  
  .search-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1rem;
    font-weight: 400;
  }
  
  .search-submit {
    background: linear-gradient(135deg, #007AFF, #0056b3);
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px 12px;
    margin-left: 10px;
    font-size: 0.9rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 44px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .search-submit:hover, .search-submit:focus {
    background: linear-gradient(135deg, #0066CC, #004499);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4);
  }
  
  /* Minimal user menu - don't compete with search */
  .header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }
  
  .user-menu {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  .login-btn, .signup-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 16px;
    white-space: nowrap;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid transparent;
    min-height: 32px;
  }
  
  .login-btn {
    color: rgba(255, 255, 255, 0.85);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
  }
  
  .login-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
  }
  
  .signup-btn {
    background: linear-gradient(135deg, #34C759, #30A14E);
    color: white;
    font-weight: 600;
  }
  
  .signup-btn:hover {
    background: linear-gradient(135deg, #30B94E, #2E8B44);
    transform: translateY(-1px);
  }

  /* Row 2: Compact Navigation - Horizontal Scroll */
  nav {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0;
    margin: 0;
  }
  
  nav::-webkit-scrollbar {
    display: none;
  }
  
  .nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    margin: 0;
    white-space: nowrap;
    min-width: max-content;
    width: auto;
  }
  
  .nav-menu li {
    margin: 0;
    flex-shrink: 0;
  }
  
  .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 80px;
    text-align: center;
    min-height: 36px;
  }
  
  .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
  
  .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #007AFF, #0056b3);
    border-color: rgba(0, 122, 255, 0.8);
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.35);
    font-weight: 600;
    transform: translateY(-1px);
  }
  
  .nav-link.active::after {
    display: none;
  }
  
  /* Hide mobile menu toggle */
  .mobile-menu-toggle {
    display: none !important;
  }
  
  /* Remove mobile nav panel */
  .mobile-nav {
    display: none !important;
  }
  
  /* Reorganize header structure */
  .header .container > * {
    order: 0;
  }
  
  .logo {
    order: 1;
  }
  
  .header-search {
    order: 2;
  }
  
  .header-right {
    order: 3;
  }
  
  nav {
    order: 4;
  }
}

/* Tablet adjustments */
@media (max-width: 992px) and (min-width: 769px) {
  .header .container {
    padding: 0 20px;
  }
  
  .nav-link {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}

/* Small mobile screens - Focus on search usability */
@media (max-width: 576px) {
  body {
    padding-top: 110px; /* Adjust for smaller header */
  }
  
  .header {
    padding: 6px 0;
  }
  
  .header .container {
    padding: 0 10px;
    gap: 6px;
  }
  
  .logo span {
    display: none; /* Logo text hidden, more space for search */
  }
  
  .logo img {
    width: 24px;
    height: 24px;
  }
  
  /* Search remains prominent on small screens */
  .search-wrapper {
    padding: 10px 14px;
    border-radius: 22px;
  }
  
  .search-wrapper input {
    font-size: 0.95rem;
  }
  
  .search-wrapper input::placeholder {
    font-size: 0.9rem;
  }
  
  .search-submit {
    min-width: 40px;
    height: 32px;
    padding: 6px 10px;
  }
  
  .nav-link {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-width: 70px;
    min-height: 32px;
  }
  
  .login-btn, .signup-btn {
    padding: 5px 8px;
    font-size: 0.7rem;
    min-height: 28px;
  }
}

/* Extra small screens - iPhone SE, etc. */
@media (max-width: 375px) {
  body {
    padding-top: 100px;
  }
  
  .header .container {
    padding: 0 8px;
    gap: 4px;
  }
  
  .header-top-row {
    gap: 8px;
  }
  
  /* Keep search large and usable */
  .search-wrapper {
    padding: 8px 12px;
  }
  
  .search-wrapper input {
    font-size: 0.9rem;
  }
  
  .search-wrapper input::placeholder {
    font-size: 0.85rem;
  }
  
  .nav-link {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: 65px;
  }
  
  .user-menu {
    gap: 3px;
  }
  
  .login-btn, .signup-btn {
    padding: 4px 6px;
    font-size: 0.65rem;
  }
  
  /* Show only essential nav items or make them smaller */
  .nav-menu {
    gap: 4px;
  }
}

/* Premium animations and effects */
@media (max-width: 768px) {
  .header {
    animation: slideDown 0.4s ease-out;
  }
  
  .nav-link {
    animation: fadeInUp 0.6s ease-out backwards;
  }
  
  .nav-link:nth-child(1) { animation-delay: 0.1s; }
  .nav-link:nth-child(2) { animation-delay: 0.15s; }
  .nav-link:nth-child(3) { animation-delay: 0.2s; }
  .nav-link:nth-child(4) { animation-delay: 0.25s; }
  .nav-link:nth-child(5) { animation-delay: 0.3s; }
  .nav-link:nth-child(6) { animation-delay: 0.35s; }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
} 