/* Home page specific styles */

/* Container */
.home-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
  padding: 1rem 0;
  transition: all 0.3s ease;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Left section - Brand */
.navbar-brand {
  display: flex;
  align-items: center;
}

.brand-title {
  display: flex;
  align-items: center;
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--primary));
  margin: 0;
}

.brand-icon {
  margin-right: 0.5rem;
  font-size: 1.25rem;
}

/* Center section - Main navigation */
.navbar-center {
  display: flex;
  justify-content: center;
  flex: 1;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Right section - Auth links and theme toggle */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
}

.auth-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
}

.theme-selector {
  display: flex;
  align-items: center;
  height: 100%;
  position: relative;
}



.theme-option.active {
  background-color: hsla(var(--primary), 0.1);
  color: hsl(var(--primary));
}

/* User Avatar Menu */
.user-avatar-menu {
  position: relative;
  z-index: 10000 !important; /* Ultra high z-index for bilingual mode compatibility */
  cursor: pointer !important; /* Show pointer cursor to indicate it's clickable */
  pointer-events: auto !important; /* Ensure clicks are captured */
}

.avatar-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer !important;
  padding: 0.25rem;
  border-radius: var(--radius);
  transition: background-color 0.2s ease;
  z-index: 10000 !important; /* Ultra high z-index for bilingual mode compatibility */
  pointer-events: auto !important; /* Ensure clicks are captured */
  position: relative; /* Ensure proper stacking context */
}

.avatar-button:hover {
  background-color: hsla(var(--muted), 0.1);
}

.avatar-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.dropdown-arrow {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  transition: transform 0.2s ease;
}

.avatar-button[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 200px;
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  margin-top: 0.5rem;
  z-index: 10001 !important; /* Ultra high z-index for bilingual mode compatibility */
  display: none;
  pointer-events: auto !important; /* Ensure clicks are captured */
  opacity: 1 !important; /* Ensure it's fully visible */
  visibility: visible !important; /* Ensure it's not hidden */
}

.user-dropdown.show {
  display: block !important; /* Use !important to override any other display settings */
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Mobile-specific fixes for user avatar dropdown in bilingual mode */
@media (max-width: 768px) {
  /* Ensure user avatar menu is always visible and functional */
  .user-avatar-menu {
    position: relative !important;
    z-index: 10000 !important;
    pointer-events: auto !important;
  }

  .avatar-button {
    z-index: 10000 !important;
    pointer-events: auto !important;
    position: relative !important;
  }

  /* MOBILE FIX: Position dropdown to open downward from avatar button */
  .user-dropdown {
    position: absolute !important; /* Use absolute positioning relative to avatar button */
    top: calc(100% + 8px) !important; /* Position below avatar button */
    bottom: auto !important;
    right: 0 !important; /* Align with right edge of avatar button */
    left: auto !important;
    z-index: 10001 !important;
    min-width: 200px !important;
    max-width: 250px !important;
    background-color: hsl(var(--popover)) !important;
    border: 1px solid hsl(var(--border)) !important;
    border-radius: var(--radius) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    padding: 0.5rem !important;
    margin: 0 !important;
    pointer-events: auto !important;
    display: none !important;
    opacity: 0 !important;
    transform: translateY(-10px) scale(0.95) !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
  }

  .user-dropdown.show {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Ensure dropdown items are properly styled on mobile */
  .user-dropdown .dropdown-item {
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem 1rem !important;
    color: hsl(var(--foreground)) !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    transition: background-color 0.2s ease !important;
  }

  .user-dropdown .dropdown-item:hover {
    background-color: hsl(var(--accent)) !important;
  }

  .user-dropdown .dropdown-item i {
    margin-right: 0.75rem !important;
    width: 16px !important;
    text-align: center !important;
    font-size: 0.9rem !important;
  }

  .user-dropdown .dropdown-divider {
    height: 1px !important;
    background-color: hsl(var(--border)) !important;
    margin: 0.5rem 0 !important;
    border: none !important;
  }

  /* Ensure dropdown is above bilingual mode content */
  #bilingual-mode-content {
    position: relative !important;
    z-index: 1 !important;
  }

  /* Force dropdown to be above everything when bilingual mode is active */
  body:has(#bilingual-mode-content[style*="block"]) .user-avatar-menu {
    z-index: 10002 !important;
  }

  body:has(#bilingual-mode-content[style*="block"]) .user-dropdown {
    z-index: 10003 !important;
  }
}

/* Alternative positioning for larger mobile screens */
@media (min-width: 481px) and (max-width: 768px) {
  .user-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    right: 0 !important;
    left: auto !important;
    transform: translateY(-10px) !important;
  }

  .user-dropdown.show {
    transform: translateY(0) !important;
  }
}

/* Small mobile screens - ensure downward positioning with viewport awareness */
@media (max-width: 480px) {
  .user-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    right: 0 !important;
    left: auto !important;
    min-width: 180px !important;
    max-width: 220px !important;
    /* Ensure dropdown stays within viewport */
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3) !important; /* More prominent shadow */
    border: 2px solid hsl(var(--primary)) !important; /* Purple border for visibility */
  }

  /* Advanced positioning to prevent overlaps */
  .user-avatar-menu.dropdown-above .user-dropdown {
    top: auto !important;
    bottom: calc(100% + 8px) !important;
    transform: translateY(10px) scale(0.95) !important;
  }

  .user-avatar-menu.dropdown-above .user-dropdown.show {
    transform: translateY(0) scale(1) !important;
  }

  /* Left-aligned dropdown for edge cases */
  .user-avatar-menu.dropdown-left .user-dropdown {
    right: auto !important;
    left: 0 !important;
  }

  /* Center-aligned dropdown for very small screens */
  .user-avatar-menu.dropdown-center .user-dropdown {
    right: auto !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-10px) scale(0.95) !important;
  }

  .user-avatar-menu.dropdown-center .user-dropdown.show {
    transform: translateX(-50%) translateY(0) scale(1) !important;
  }

  /* Ensure dropdown doesn't overlap with bottom navigation */
  @media (max-width: 768px) {
    .bottom-nav ~ * .user-dropdown {
      max-height: calc(100vh - 140px) !important; /* Account for bottom nav */
    }
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color 0.2s ease;
}

.dropdown-item:hover {
  background-color: hsla(var(--muted), 0.1);
}

.dropdown-divider {
  height: 1px;
  background-color: hsl(var(--border));
  margin: 0.5rem 0;
}

/* History dropdown styles removed - History is now consolidated under Profile dropdown */

/* Ensure the theme toggle button is properly aligned */
#theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2rem;
  width: 2rem;
  padding: 0;
  margin: 0;
}

/* Remove auth-button styles since we're not using them anymore */

.nav-link {
  font-weight: 500;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: hsl(var(--primary));
}

.nav-link.active {
  color: hsl(var(--primary));
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: hsl(var(--primary));
  border-radius: 1px;
}

/* Hero Section */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 2rem auto 4rem;
  padding: 2rem 1.5rem;
  gap: 2rem;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2rem;
  line-height: 1.5;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image img {
  max-width: 100%;
  height: auto;
}

/* Section Styles */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: hsl(var(--muted-foreground));
}

/* About Section */
.about-section {
  background-color: hsl(var(--secondary));
  padding: 5rem 1.5rem;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-text p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: hsl(var(--foreground));
  margin-bottom: 1.5rem;
}

/* Features Section */
.features-section {
  padding: 5rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  color: hsl(var(--primary));
  margin-bottom: 1.5rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.feature-description {
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

/* CTA Section */
.cta-section {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 5rem 1.5rem;
  text-align: center;
}

.cta-content {
  max-width: 800px;
  margin: 0 auto;
}

.cta-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-description {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.cta-section .button-outline {
  border-color: hsl(var(--primary-foreground));
  color: hsl(var(--primary-foreground));
}

.cta-section .button-outline:hover {
  background-color: hsla(var(--primary-foreground), 0.1);
}

/* Pricing Section - 4-card layout with enhanced spacing v2.0 */
.pricing-section {
  padding: 5rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem !important;
  margin-bottom: 3rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.pricing-card-highlighted {
  border: 2px solid hsl(var(--primary));
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
  position: relative;
  transform: scale(1.02);
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--accent)) 100%);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.pricing-header {
  margin-bottom: 1.5rem;
}

.pricing-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pricing-price {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--primary));
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

.pricing-unit {
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
  font-weight: normal;
}

.pricing-features {
  margin-bottom: 2rem;
}

.pricing-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pricing-features li {
  padding: 0.5rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

.pricing-features li:last-child {
  border-bottom: none;
}

.feature-disabled {
  color: hsl(var(--muted-foreground));
  text-decoration: line-through;
  opacity: 0.7;
}

.pricing-button {
  width: 100%;
}

.pricing-button-compact {
  width: auto;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  margin: 0 auto;
  display: block;
  min-width: 120px;
  border-radius: 6px;
}

.pay-as-you-go {
  background-color: hsl(var(--secondary));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.pay-as-you-go-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.pay-as-you-go-content p {
  margin-bottom: 1.5rem;
  color: hsl(var(--muted-foreground));
}

/* Dark mode adjustments */
[data-theme="dark"] .pricing-card-highlighted {
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--muted)) 100%);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .popular-badge {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Responsive adjustments for pricing section */
/* Large screens: 4 cards in a row */
@media (min-width: 1400px) {
  .pricing-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    max-width: 1400px !important;
    gap: 2rem !important;
  }
}

/* Medium-large screens: 2 cards per row */
@media (max-width: 1399px) and (min-width: 1025px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 800px !important;
    gap: 2rem !important;
  }
}

/* Medium screens: 2 cards per row */
@media (max-width: 1024px) and (min-width: 769px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 700px !important;
    gap: 1.5rem !important;
  }
}

/* Small screens: 1 card per row */
@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr !important;
    max-width: 400px !important;
    gap: 1.5rem !important;
  }

  .pricing-card {
    margin: 0 auto !important;
    max-width: 400px !important;
  }

  .pricing-card-highlighted {
    order: -1;
    transform: scale(1.0);
  }
}

/* Additional specificity for production deployment */
.pricing-section .pricing-grid {
  gap: 2rem !important;
}

.pricing-section .pricing-grid .pricing-card {
  margin: 0 !important;
}

/* Ensure consistent spacing across all environments */
@media (min-width: 1400px) {
  .pricing-section .pricing-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 2rem !important;
  }
}

@media (max-width: 1399px) and (min-width: 1025px) {
  .pricing-section .pricing-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .pricing-section .pricing-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }
}

@media (max-width: 768px) {
  .pricing-section .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .pricing-button-compact {
    width: 100%;
    min-width: auto;
  }
}

/* Footer */
.footer {
  background-color: hsl(var(--secondary));
  padding: 4rem 1.5rem 2rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 2rem;
  border-bottom: 1px solid hsl(var(--border));
}

.footer-brand {
  max-width: 300px;
}

.footer-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.footer-tagline {
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 4rem;
}

.footer-links-title {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
}

.footer-links-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: hsl(var(--primary));
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  text-align: center;
}

.copyright {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Navigation responsive styles */
  .navbar-container {
    flex-wrap: wrap;
  }

  .navbar-brand {
    flex: 1;
  }

  .navbar-center {
    order: 3;
    width: 100%;
    margin-top: 1rem;
    justify-content: flex-start;
  }

  .navbar-right {
    justify-content: flex-end;
    align-items: center;
    height: auto;
  }

  .auth-links {
    gap: 1rem;
    height: auto;
  }

  .theme-selector {
    height: auto;
  }

  /* Other responsive styles */
  .hero-section {
    flex-direction: column;
    text-align: center;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-buttons {
    justify-content: center;
  }

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }
}

/* Small screens */
@media (max-width: 480px) {
  .navbar-right {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.75rem;
  }

  .auth-links {
    gap: 0.75rem;
  }

  .nav-link {
    font-size: 0.9rem;
  }
}
