/* ========================================
   Responsive Design - Media Queries
   ======================================== 
   
   Breakpoints:
   - Desktop Large: 1400px+
   - Desktop: 1025px - 1399px (default)
   - Tablet: 769px - 1024px
   - Medium Tablet: 769px - 1024px (specific optimizations)
   - Mobile: 481px - 768px
   - Small Mobile: up to 480px
   - Landscape Mobile: max-height 500px
   
   Graficos.html Adaptations:
   - Hero section responsive heights
   - Feature grids: 3 cols (desktop) → 2 cols (tablet) → 1 col (mobile)
   - Chart heights adjusted per breakpoint
   - Metric groups stack on mobile
   - Grid overrides for inline styles
   - Typography scaling for readability
   ======================================== */

/* Tablet & Mobile */
@media screen and (max-width: 1024px) {
  :root {
    --spacing-xl: 3rem;
    --spacing-lg: 2rem;
  }

  .nav-container {
    padding: 1rem var(--spacing-sm);
  }

  /* Analytics Charts Responsive */
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid-custom {
    grid-template-columns: 1fr;
  }

  #progressChart,
  #projectsChart,
  #heroChart {
    max-width: 100%;
    height: auto !important;
  }

  /* Graficos.html Specific */
  .features-grid-lg {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-section-graficos {
    min-height: auto;
    padding: 3rem 0;
  }

  .hero-title-graficos {
    font-size: 2.5rem;
  }

  .chart-wrapper-350 {
    height: 280px;
  }

  .genres-grid {
    gap: 1.5rem;
  }

  /* Graficos.html Tablet */
  .features-grid-gap-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid-lg {
    grid-template-columns: repeat(2, 1fr);
  }

  [style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  [style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mobile Navigation - BELOW 768px only */
@media screen and (max-width: 767px) {
  .mobile-menu-toggle {
    display: flex !important;
    z-index: 1001;
  }

  /* Hero Content Grid Mobile */
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .hero-visual {
    order: -1;
    min-height: 300px;
  }

  /* Contact Page Grid Mobile */
  .content-container > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  .navigation-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right var(--transition-smooth);
    gap: 0;
  }

  .navigation-menu.active {
    right: 0;
  }

  .navigation-menu li {
    width: 100%;
    border-bottom: 1px solid var(--light-gray);
  }

  .navigation-menu a {
    display: block;
    padding: 1rem 0;
    width: 100%;
  }

  .cta-button {
    margin-top: 1rem;
    display: block;
    text-align: center;
  }

  /* Hero Section Mobile */
  .hero-section {
    padding: var(--spacing-md) 0;
    min-height: auto;
  }

  .hero-visual {
    padding: 1rem;
    min-height: 300px;
  }

  .hero-visual .chart-container {
    height: 280px !important;
    padding: 0.5rem;
    min-height: 280px;
  }

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

  .hero-description {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
    text-align: center;
  }

  /* Charts Responsive */
  .chart-wrapper {
    height: 250px !important;
  }

  .analytics-section .chart-card {
    padding: 1rem;
  }

  .candlestick-chart {
    height: 300px !important;
  }

  /* Graficos.html Charts Mobile */
  .chart-card-coral,
  .chart-card-teal {
    padding: 1.5rem;
    min-height: auto;
  }

  .chart-wrapper-350 {
    height: 250px;
  }

  .chart-container-full {
    height: 280px;
  }

  .chart-title-large {
    font-size: 1.5rem;
  }

  .chart-header-flex {
    flex-direction: column;
    gap: 0.75rem;
  }

  /* Stats Grid Mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  /* Graficos.html Stats Section */
  .stats-grid.features-grid-lg {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .stat-label {
    font-size: 0.875rem;
  }

  /* Features Mobile */
  .features-grid {
    grid-template-columns: 1fr;
  }

  .features-grid-gap-2 {
    grid-template-columns: 1fr;
  }

  .features-grid-lg {
    grid-template-columns: 1fr;
  }

  /* Graficos.html Mobile Adaptations */
  .hero-section-graficos {
    padding: 2rem 0;
  }

  .hero-title-graficos {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .btn-group-hero {
    flex-direction: column;
    width: 100%;
  }

  .btn-group-hero .primary-btn,
  .btn-group-hero .secondary-btn {
    width: 100%;
  }

  .metric-group-triple,
  .metric-group-dual {
    gap: 1rem;
  }

  .metric-value-large-coral,
  .metric-value-large-teal {
    font-size: 2rem;
  }

  .metric-value-xl-teal,
  .metric-value-xl-coral {
    font-size: 1.8rem;
  }

  .feature-title-coral,
  .feature-title-teal {
    font-size: 1.3rem;
  }

  .ua-card-title-coral,
  .ua-card-title-teal {
    font-size: 1.5rem;
  }

  .chart-container-full {
    height: 300px;
  }

  .candlestick-section-dark {
    padding: 2rem;
  }

  /* Grid overrides for inline styles */
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1.5fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns: repeat(5, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  .grid-2col-custom,
  .grid-3col-custom {
    grid-template-columns: 1fr;
  }

  /* Analytics Mobile */

  .chart-card {
    padding: var(--spacing-sm);
  }

  .chart-wrapper {
    height: 250px;
  }

  .candlestick-chart {
    height: 300px;
  }

  /* Testimonials Mobile */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* Footer Mobile */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    text-align: center;
  }

  /* Cookie Popup Mobile */
  .cookie-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-actions {
    width: 100%;
  }

  .cookie-btn {
    flex: 1;
  }

  /* Form Mobile */
  .form-wrapper {
    padding: var(--spacing-md);
  }

  /* New Sections Mobile */
  .process-timeline::before {
    left: 20px;
  }

  .process-step {
    padding-left: 70px;
  }

  .step-icon {
    left: 5px;
    width: 40px;
    height: 40px;
  }

  .step-icon img {
    width: 30px;
    height: 30px;
  }

  .tech-categories {
    grid-template-columns: 1fr;
  }

  .carousel-wrapper {
    padding: 0 50px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .genres-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .genre-card {
    padding: 1.5rem;
  }

  .genre-desc {
    text-align: left;
  }

  .projects-carousel {
    padding: 1rem 0.5rem;
  }

  .project-card {
    min-width: 280px;
  }
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
}

/* Medium Tablet (769px - 1023px) - Tablet range */
@media screen and (min-width: 769px) and (max-width: 1023px) {
  /* Hero Visual - REMOVE height restriction to keep desktop height */

  /* Graficos.html Medium Tablet Optimizations */
  .features-grid-gap-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .features-grid-lg {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-group-triple {
    gap: 1.25rem;
  }

  .hero-section-graficos {
    padding: 4rem 0;
  }

  .hero-title-graficos {
    font-size: 2.8rem;
  }

  .chart-wrapper-350 {
    height: 320px;
  }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    gap: 0.75rem;
  }

  .social-links {
    flex-wrap: wrap;
  }

  .chart-wrapper,
  .chart-container {
    height: 200px;
  }

  .candlestick-chart {
    height: 250px;
  }

  /* Graficos.html Small Mobile */
  .hero-title-graficos {
    font-size: 1.5rem;
  }

  .section-title-graficos {
    font-size: 2rem;
  }

  .metric-value-large-coral,
  .metric-value-large-teal {
    font-size: 1.75rem;
  }

  .metric-value-lg-coral,
  .metric-value-lg-teal {
    font-size: 1.5rem;
  }

  .metric-value-md-coral,
  .metric-value-md-teal {
    font-size: 1.3rem;
  }

  .feature-card-hover-coral,
  .feature-card-hover-teal {
    padding: 1.5rem;
  }

  .card-dark-coral,
  .card-dark-teal {
    padding: 1.5rem;
  }

  .chart-wrapper-350,
  .chart-container-full {
    height: 250px;
  }

  .candlestick-section-dark {
    padding: 1.5rem;
  }

  .metric-group-triple {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .metric-group-dual {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .grid-2col-custom {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .ua-card-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* Desktop Large */
@media screen and (min-width: 1400px) {
  .content-container {
    max-width: 1600px;
  }

  .hero-content {
    max-width: 1600px;
  }

  /* Graficos.html Large Desktop */
  .features-grid-gap-2 {
    grid-template-columns: repeat(3, 1fr);
  }

  .chart-wrapper-350 {
    height: 400px;
  }

  .chart-container-full {
    height: 450px;
  }
}

/* Print Styles */
@media print {
  .main-header,
  .cookie-popup,
  .hero-actions,
  .cta-section {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .hero-section {
    background: white;
    color: black;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  /* Can be implemented if needed */
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .feature-card,
  .testimonial-card,
  .chart-card {
    border: 2px solid var(--text-graphite);
  }
}

/* Landscape Mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding: var(--spacing-md) 0;
  }

  .navigation-menu {
    height: 100vh;
    overflow-y: auto;
  }

  /* Graficos.html Landscape */
  .hero-section-graficos {
    min-height: auto;
    padding: 2rem 0;
  }

  .chart-wrapper-350,
  .chart-container-full {
    height: 250px;
  }

  .candlestick-section-dark {
    padding: 1.5rem;
  }
}
