/* ==========================================================================
   Flightcast Responsive & Interaction Enhancements
   ========================================================================== */

/* Prevent accidental horizontal scrolling while ensuring vertical scrollbar is always visible */
html {
  overflow-x: hidden;
  overflow-y: scroll;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  width: 100%;
  overflow-x: hidden;
}

/* Accordion Smooth Expand/Collapse */
[role="region"][data-state="closed"] {
  display: none;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.25s ease-out;
}

[role="region"][data-state="open"] {
  display: block;
  max-height: 1000px;
  opacity: 1;
  transition: max-height 0.35s ease-in, opacity 0.3s ease-in;
}

/* Chevron rotation on open */
button[data-state="open"] svg.lucide-chevron-down {
  transform: rotate(180deg);
}

/* Mobile Navigation Drawer & Hamburger */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background) / 0.8);
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.mobile-nav-toggle:hover {
  background-color: hsl(var(--accent));
}

.mobile-menu-drawer {
  position: fixed;
  inset-x: 0;
  top: 4.25rem;
  background-color: hsl(var(--background) / 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid hsl(var(--border));
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 1.25rem 1.5rem 1.75rem;
  z-index: 49;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  opacity: 0;
  transform: translateY(-0.75rem);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-menu-drawer.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-menu-link:hover {
  background-color: hsl(var(--accent));
}

.mobile-menu-cta-group {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border) / 0.6);
}

/* Media Queries for Mobile Responsiveness */
@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }

  /* Make sure header doesn't overcrowd on mobile */
  header nav {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Adjust hero title size slightly on very small devices */
  h1 {
    font-size: clamp(2rem, 7vw, 3.25rem) !important;
    line-height: 1.15 !important;
  }

  /* Bento grid adjustment on mobile */
  .grid {
    grid-template-columns: 1fr !important;
  }

  /* Comparison and pricing adjustments */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* Touch tap targets */
  button, a {
    min-height: 2.25rem;
  }
}

@media (max-width: 480px) {
  /* Hide text inside secondary buttons if needed or compact them */
  header .hidden-on-xs {
    display: none;
  }
  
  /* Ensure padding inside cards is comfortable on small screens */
  .p-6, .p-8 {
    padding: 1.25rem !important;
  }
}

/* Active theme toggle button style */
.theme-active {
  background-color: hsl(var(--accent)) !important;
  color: hsl(var(--foreground)) !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}
