/* =======================================================================
   ORGANIZER CHATBOT - RESPONSIVE CSS
   Mobile-first responsive styles
   ======================================================================= */

/* =======================================================================
   BASE MOBILE STYLES (320px - 480px)
   Default styles are already mobile-first in main.css
   ======================================================================= */

/* Mobile Navigation Adjustments */
.nav-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  flex-direction: column;
  padding: var(--space-8) var(--space-4);
  box-shadow: var(--shadow-lg);
  border-top: 1px solid var(--gray-200);
  z-index: 999;
}

.nav-menu.active {
  display: flex;
}

.nav-toggle {
  display: flex;
}



/* Hero Section Mobile */
.hero-container {
  grid-template-columns: 1fr;
  gap: var(--space-8);
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.hero-content {
  order: 2;
}

.hero-visual {
  order: 1;
}

.hero-cta {
  flex-direction: column;
  align-items: center;
}

.hero-cta .btn {
  width: 100%;
  max-width: 300px;
}

/* Trust Badges Mobile */
.badges-grid {
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.badge {
  justify-content: center;
  text-align: center;
}

/* Problema/Solución Mobile */
.problema-solucion-grid {
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

/* Features Mobile */
.features-grid {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* Demo Section Mobile */
.browser-frame {
  margin: 0 var(--space-4);
}

.chatbot-widget {
  position: static;
  width: 100%;
  max-width: none;
  margin-top: var(--space-8);
}

/* Cases Tabs Mobile */
.tabs-nav {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
}

.tab-btn {
  flex-direction: row;
  justify-content: flex-start;
  padding: var(--space-3) var(--space-4);
  text-align: left;
}

/* Pricing Mobile */
.pricing-grid {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.pricing-card.featured {
  transform: none;
  order: -1;
}

.pricing-card.featured:hover {
  transform: translateY(-4px);
}

.form-group {
  flex-direction: column;
}

.form-group input {
  min-width: auto;
}

/* Clients Mobile */
.clients-carousel {
  gap: var(--space-8);
}

.client-logo {
  padding: var(--space-6);
  min-width: 280px;
  min-height: 160px;
}

.client-image {
  height: 100px;
  max-width: 240px;
}

/* Footer Mobile */
.footer-grid {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.footer-bottom {
  flex-direction: column;
  text-align: center;
  gap: var(--space-2);
}

.footer-social {
  justify-content: center;
}

/* CTA Stats Mobile */
.cta-stats {
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* =======================================================================
   LARGE PHONES / SMALL TABLETS (481px and up)
   ======================================================================= */

@media (min-width: 481px) {
  /* Hero adjustments */
  .hero-cta {
    flex-direction: row;
    justify-content: center;
  }
  
  .hero-cta .btn {
    width: auto;
  }
  
  /* Trust badges */
  .badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Features grid */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Pricing */
  .pricing-toggle {
    flex-direction: row;
  }
  
  /* Form group */
  .form-group {
    flex-direction: row;
  }
  
  .form-group input {
    min-width: 200px;
  }
  
  /* CTA Stats */
  .cta-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Footer */
  .footer-bottom {
    flex-direction: row;
    text-align: left;
  }
}

/* =======================================================================
   TABLETS / SMALL DESKTOPS (769px and up)
   ======================================================================= */

@media (min-width: 769px) {
  /* Show desktop navigation */
  .nav-toggle {
    display: none;
  }
  
  .nav-menu {
    display: flex;
    position: static;
    flex-direction: row;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-top: none;
    backdrop-filter: none;
  }
  
  /* Hero section */
  .hero-container {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    text-align: left;
  }
  
  .hero-content {
    order: 1;
  }
  
  .hero-visual {
    order: 2;
  }
  
  .hero-cta {
    justify-content: flex-start;
  }
  
  /* Trust badges */
  .badges-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .badge {
    justify-content: flex-start;
    text-align: left;
  }
  
  /* Problema/Solución */
  .problema-solucion-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
  }
  
  /* Features */
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Demo section */
  .browser-frame {
    margin: 0;
  }
  
  .chatbot-widget {
    position: absolute;
    bottom: var(--space-4);
    right: var(--space-4);
    width: 350px;
    max-width: 350px;
  }
  
  /* Cases tabs */
  .tabs-nav {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }
  
  .tab-btn {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
  
  /* Pricing */
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .pricing-card.featured {
    transform: scale(1.05);
    order: 0;
  }
  
  /* Clients */
  .clients-carousel {
    gap: var(--space-10);
  }
  
  .client-logo {
    min-width: 340px;
    min-height: 190px;
    padding: var(--space-8);
  }
  
  .client-image {
    height: 120px;
    max-width: 280px;
  }
  
  /* Footer */
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* =======================================================================
   DESKTOPS (1025px and up)
   ======================================================================= */

@media (min-width: 1025px) {
  /* Larger container */
  .container {
    padding: 0 var(--space-6);
  }
  
  /* Enhanced hero */
  .hero-container {
    gap: var(--space-20);
    padding: var(--space-16) var(--space-6);
  }
  
  /* Features enhanced spacing */
  .features-grid {
    gap: var(--space-10);
  }
  
  /* Demo section enhanced */
  .demo-container {
    padding: 0 var(--space-8);
  }
  
  /* Pricing enhanced */
  .pricing-card {
    padding: var(--space-10);
  }
  
  /* Enhanced sections padding */
  .section {
    padding: var(--space-24) 0;
  }
  
  /* Clients enhanced */
  .client-logo {
    min-width: 450px;
    min-height: 250px;
    padding: var(--space-12);
  }
  
  .client-image {
    height: 180px;
    max-width: 400px;
  }
}

/* =======================================================================
   LARGE DESKTOPS (1281px and up)
   ======================================================================= */

@media (min-width: 1281px) {
  /* Maximum container width */
  .container {
    max-width: var(--container-2xl);
  }
  
  /* Hero maximum enhancements */
  .hero-container {
    gap: var(--space-24);
  }
  
  /* Features maximum grid */
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-12);
  }
  
  /* Maximum section padding */
  .section {
    padding: var(--space-32) 0;
  }
}

/* =======================================================================
   LANDSCAPE PHONE ORIENTATION
   ======================================================================= */

@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: var(--space-8) 0;
  }
  
  .hero-container {
    gap: var(--space-8);
  }
  
  .section {
    padding: var(--space-12) 0;
  }
}

/* =======================================================================
   HIGH DPI DISPLAYS
   ======================================================================= */

@media (min-resolution: 2dppx) {
  /* Ensure crisp images on high DPI displays */
  .logo,
  .hero-image,
  .feature-icon .icon {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* =======================================================================
   HOVER DEVICE SPECIFIC STYLES
   ======================================================================= */

@media (hover: hover) and (pointer: fine) {
  /* Enhanced hover effects for devices that support hover */
  .feature-card:hover {
    transform: translateY(-12px);
  }
  
  .pricing-card:hover {
    transform: translateY(-8px);
  }
  
  .pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
  }
  
  .btn:hover {
    transform: translateY(-3px);
  }
  
  .client-logo:hover {
    box-shadow: var(--shadow-xl);
  }
}

/* =======================================================================
   TOUCH DEVICE OPTIMIZATIONS
   ======================================================================= */

@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets for mobile */
  .btn {
    min-height: 48px;
    padding: var(--space-4) var(--space-6);
  }
  
  .nav-link {
    padding: var(--space-4);
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  
  .faq-question {
    min-height: 60px;
    padding: var(--space-4) var(--space-6);
  }
  
  .quick-btn {
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
  }
  
  .tab-btn {
    min-height: 60px;
    padding: var(--space-4) var(--space-6);
  }
  
  .dot {
    width: 16px;
    height: 16px;
    margin: var(--space-2);
  }
  
  /* Remove hover effects on touch devices */
  .feature-card:hover,
  .pricing-card:hover,
  .btn:hover {
    transform: none;
  }
  
  .pricing-card.featured:hover {
    transform: scale(1.05);
  }
}

/* =======================================================================
   LOADING STATES & SKELETON SCREENS
   ======================================================================= */

@keyframes skeleton {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 1rem;
  margin-bottom: var(--space-2);
}

.skeleton-title {
  height: 2rem;
  width: 60%;
  margin-bottom: var(--space-4);
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-lg);
}

/* =======================================================================
   PERFORMANCE OPTIMIZATIONS
   ======================================================================= */

/* Reduce animations for slow devices */
@media (prefers-reduced-motion: no-preference) {
  .will-change-transform {
    will-change: transform;
  }
  
  .will-change-opacity {
    will-change: opacity;
  }
}

/* GPU acceleration for smooth animations */
.gpu-accelerated {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Optimize scrolling performance */
.smooth-scroll {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* =======================================================================
   PRINT OPTIMIZATIONS
   ======================================================================= */

@media print {
  /* Hide interactive elements */
  .nav-toggle,
  .hero-particles,
  .carousel-dots,
  .tabs-nav,
  .cta-form,
  .message-toast {
    display: none !important;
  }
  
  /* Optimize spacing for print */
  .hero,
  .section {
    padding: var(--space-6) 0 !important;
  }
  
  /* Ensure readability */
  .hero-title,
  .section-title {
    color: var(--gray-900) !important;
  }
  
  /* Show URLs for links */
  .footer-links a::after {
    content: " (" attr(href) ")";
    font-size: var(--text-xs);
    color: var(--gray-600);
  }
  
  /* Page break optimizations */
  .feature-card,
  .pricing-card,
  .client-logo {
    page-break-inside: avoid;
  }
  
  .section {
    page-break-after: auto;
  }
}

/* =======================================================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================================================= */

/* Focus management for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
  .focus-visible {
    transition: box-shadow var(--transition-base);
  }
}

.focus-visible:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
  .btn-outline {
    border-width: 3px;
  }
  
  .feature-card,
  .pricing-card,
  .client-logo {
    border-width: 2px;
    border-color: var(--gray-900);
  }
  
  .nav-link.active::after {
    height: 4px;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .hero-particles::before,
  .hero-particles::after {
    animation: none;
  }
  
  .skeleton {
    animation: none;
    opacity: 0.6;
  }
  
  .carousel-dots .dot {
    transition: none;
  }
  
  .smooth-scroll {
    scroll-behavior: auto;
  }
}

/* =======================================================================
   CONTAINER QUERIES (Progressive Enhancement)
   ======================================================================= */

/* Future-proofing with container queries when supported */
@supports (container-type: inline-size) {
  .responsive-container {
    container-type: inline-size;
  }
  
  @container (min-width: 400px) {
    .container-responsive .features-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @container (min-width: 600px) {
    .container-responsive .features-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
}

/* =======================================================================
   DARK MODE RESPONSIVE ADJUSTMENTS
   ======================================================================= */

@media (prefers-color-scheme: dark) {
  .browser-frame {
    background: var(--gray-800);
  }
  
  .browser-header {
    background: var(--gray-700);
    border-bottom-color: var(--gray-600);
  }
  
  .browser-url {
    background: var(--gray-800);
    border-color: var(--gray-600);
    color: var(--gray-300);
  }
  
  .chatbot-widget {
    background: var(--gray-800);
    border-color: var(--gray-600);
  }
  
  .message-content {
    background: var(--gray-700);
    color: var(--gray-200);
  }
  
  .quick-btn {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--gray-200);
  }
  
  .quick-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
  }
}