/* ========================================
   MOBILE NAVIGATION - APPLE STYLE
   FINAL VERSION - Strong Overrides for iPad
   ======================================== */

/* Hide mobile toggle by default (desktop) */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.mobile-nav-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 3px;
}

/* Mobile CTA Button (hidden by default) */
.mobile-cta-button {
  display: none;
}

/* ========================================
   DESKTOP (> 1024px) - Keep Everything
   ======================================== */
@media (min-width: 1025px) {
  /* Desktop: Show logo text, full navigation */
  .logo h1 {
    display: block !important;
    font-size: 1.8rem !important;
  }
  
  .mobile-cta-button {
    display: none !important;
  }
  
  .mobile-nav-toggle {
    display: none !important;
  }
  
  nav ul {
    flex-wrap: nowrap !important;
  }
}

/* ========================================
   IPAD LANDSCAPE (768px - 1024px, horizontal)
   Show full navigation with proper spacing
   ======================================== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  /* Show smaller logo text */
  .logo h1 {
    display: block !important;
    font-size: 1.2rem !important;
  }
  
  /* Hide mobile elements */
  .mobile-cta-button {
    display: none !important;
  }
  
  .mobile-nav-toggle {
    display: none !important;
  }
  
  /* FORCE header layout */
  .header-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 15px !important; /* Reduced side padding */
  }
  
  .logo {
    flex-shrink: 0 !important;
  }
  
  /* Show full desktop navigation */
  nav {
    position: static !important;
    width: auto !important;
    height: auto !important;
    background-color: transparent !important;
    box-shadow: none !important;
    flex-grow: 1 !important;
    display: flex !important;
    justify-content: flex-end !important;
  }
  
  nav ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    margin-top: 0 !important;
    padding: 0 !important;
    gap: 6px !important; /* Reduced gap */
    justify-content: flex-end !important;
    align-items: center !important;
  }
  
  nav ul li {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
    margin-left: 0 !important; /* Override original styles.css */
  }
  
  nav ul li a {
    padding: 8px 8px !important; /* Reduced padding */
    font-size: 13px !important; /* Smaller font */
  }
  
  nav ul li a.cta-button {
    display: inline-block !important;
    margin-right: 20px !important; /* Add right margin for spacing from edge */
    margin-left: 6px !important;
    padding: 8px 14px !important; /* Smaller button */
  }
}

/* ========================================
   IPAD PORTRAIT (768px - 1024px, vertical)
   FORCE everything in ONE LINE with !important
   ======================================== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  /* Show very small logo text */
  .logo h1 {
    display: block !important;
    font-size: 0.9rem !important;
  }
  
  .logo img {
    height: 30px !important;
  }
  
  /* Hide mobile elements */
  .mobile-cta-button {
    display: none !important;
  }
  
  .mobile-nav-toggle {
    display: none !important;
  }
  
  /* FORCE header to be ONE LINE */
  .header-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 10px !important;
  }
  
  .logo {
    flex-shrink: 0 !important;
    margin-right: 8px !important;
  }
  
  /* Show full navigation inline */
  nav {
    position: static !important;
    width: auto !important;
    height: auto !important;
    background-color: transparent !important;
    box-shadow: none !important;
    flex-shrink: 1 !important;
    flex-grow: 1 !important;
    display: flex !important;
    justify-content: flex-end !important;
  }
  
  nav ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; /* CRITICAL: prevent wrapping */
    margin-top: 0 !important;
    padding: 0 !important;
    gap: 3px !important;
    justify-content: flex-end !important;
    align-items: center !important;
  }
  
  nav ul li {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
    margin-left: 0 !important; /* Override original styles.css line 79 */
    flex-shrink: 0 !important;
  }
  
  nav ul li a {
    padding: 6px 5px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }
  
  nav ul li a.cta-button {
    display: inline-block !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
  }
}

/* ========================================
   PHONE LANDSCAPE (< 768px, horizontal)
   Show full navigation with smaller VisionDrive text
   ======================================== */
@media (max-width: 767px) and (orientation: landscape) {
  /* Show smaller logo text to fit everything */
  .logo h1 {
    display: block !important;
    font-size: 0.9rem !important;
  }
  
  /* Hide mobile elements */
  .mobile-cta-button {
    display: none !important;
  }
  
  .mobile-nav-toggle {
    display: none !important;
  }
  
  /* Show full desktop navigation */
  .header-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 15px !important;
    flex-wrap: nowrap !important;
  }
  
  .logo {
    flex-shrink: 0 !important;
  }
  
  .logo img {
    height: 30px !important;
  }
  
  nav {
    position: static !important;
    width: auto !important;
    height: auto !important;
    background-color: transparent !important;
    box-shadow: none !important;
    overflow-y: visible !important;
  }
  
  nav ul {
    display: flex !important;
    flex-direction: row !important;
    margin-top: 0 !important;
    padding: 0 !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  
  nav ul li {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: none !important;
    margin-left: 0 !important; /* Override original */
  }
  
  nav ul li a {
    padding: 6px 8px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
  }
  
  nav ul li a.cta-button {
    display: inline-block !important;
    padding: 6px 10px !important;
  }
}

/* ========================================
   PHONE PORTRAIT (< 768px, vertical)
   Hamburger menu with Enroll Now button
   ======================================== */
@media (max-width: 767px) and (orientation: portrait) {
  /* Keep logo text on portrait mobile */
  .logo h1 {
    display: block !important;
  }
  
  /* Header layout: Logo | Enroll Now | Hamburger */
  .header-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 20px !important;
    gap: 10px !important;
  }
  
  /* Logo on the left */
  .logo {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }
  
  .logo img {
    height: 35px !important;
    width: auto !important;
  }
  
  .logo h1 {
    font-size: 1.2rem !important;
  }
  
  /* Show mobile Enroll Now button in center */
  .mobile-cta-button {
    display: block !important;
    background-color: var(--secondary-color) !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    transition: background-color 0.3s ease !important;
  }
  
  .mobile-cta-button:hover {
    background-color: #e65100 !important;
  }
  
  /* Show hamburger menu button on the right */
  .mobile-nav-toggle {
    display: flex !important;
    flex-shrink: 0 !important;
  }
  
  /* Hide desktop navigation */
  nav {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1) !important;
    transition: right 0.3s ease !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
  }
  
  /* Show navigation when active */
  nav.active {
    right: 0 !important;
  }
  
  /* Vertical menu layout */
  nav ul {
    display: flex !important;
    flex-direction: column !important;
    margin-top: 80px !important;
    padding: 0 20px !important;
    flex-wrap: nowrap !important; /* Override original */
  }
  
  nav ul li {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    margin-left: 0 !important; /* Override original */
  }
  
  nav ul li a {
    display: block !important;
    padding: 18px 15px !important;
    font-size: 17px !important;
    color: var(--text-color) !important;
    font-weight: 400 !important;
  }
  
  nav ul li a:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
  }
  
  /* Hide the Enroll Now link in the dropdown menu (since it's in the header) */
  nav ul li a.cta-button {
    display: none !important;
  }
  
  /* Hamburger animation when menu is open */
  .mobile-nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px) !important;
  }
  
  .mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0 !important;
  }
  
  .mobile-nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px) !important;
  }
  
  /* Overlay when menu is open */
  .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .nav-overlay.active {
    display: block !important;
    opacity: 1 !important;
  }
}

/* Small mobile devices (portrait) */
@media (max-width: 480px) and (orientation: portrait) {
  .header-container {
    padding: 8px 12px !important;
    gap: 8px !important;
  }
  
  .logo h1 {
    font-size: 1rem !important;
  }
  
  .logo img {
    height: 30px !important;
  }
  
  .mobile-cta-button {
    padding: 8px 16px !important;
    font-size: 13px !important;
  }
  
  nav {
    width: 100% !important;
    right: -100% !important;
  }
}

/* Extra small devices (portrait) */
@media (max-width: 360px) and (orientation: portrait) {
  .logo h1 {
    font-size: 0.9rem !important;
  }
  
  .logo img {
    height: 28px !important;
  }
  
  .mobile-cta-button {
    padding: 7px 14px !important;
    font-size: 12px !important;
  }
  
  .mobile-nav-toggle {
    padding: 8px !important;
  }
  
  .mobile-nav-toggle span {
    width: 22px !important;
  }
}
