/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* ========================================
   MOBILE FIRST APPROACH
   ======================================== */

/* Base styles (mobile) already defined in main.css */

/* ========================================
   MOBILE SPECIFIC OVERRIDES
   ======================================== */

@media (max-width: 767px) {
    /* Hero - stack text above image */
    .hero-content {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-lg);
        align-items: center;
        width: 100%;
    }
    .hero-text { order: 1; }
    .hero-visual { order: 2; }
    .dashboard-mockup { max-width: 100%; width: 100%; }
    .dashboard-img { width: 100%; max-width: 100%; height: auto; }

    /* Summary Table Section - Mobile */
    .summary-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }

    .summary-text h2 {
        font-size: var(--text-2xl);
    }

    .summary-features {
        gap: var(--spacing-sm);
    }

    .summary-feature {
        justify-content: flex-start;
    }
    
    /* Reports Section - Mobile */
    .reports-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .reports-text {
        order: 2;
    }
    
    .reports-carousel {
        order: 1;
    }
    
    .carousel-images {
        height: 400px;
    }
    
}

/* ========================================
   TABLET (768px+)
   ======================================== */

@media (min-width: 768px) {
    /* Header tablet */
    .header {
        left: 8rem;
        right: 8rem;
    }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-xl);
    }
    
    /* Hero Section */
    .hero {
        padding: 140px 0 100px;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1.3fr;
        gap: 60px;
        align-items: center;
    }
    
    .hero-text {
        text-align: left;
        padding-right: var(--spacing-lg);
    }
    
    .hero h1 {
        font-size: var(--text-5xl);
    }
    
    .hero p {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Process Flow */
    .flow-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Features Grid */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Benefits Grid */
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr 2fr;
        gap: var(--spacing-2xl);
        text-align: left;
    }
    
    .footer-brand {
        text-align: left;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
        gap: var(--spacing-xl);
    }
    
    /* Summary Table Section */
    .summary-content {
        gap: var(--spacing-xl);
    }
    
    .summary-text h2 {
        font-size: var(--text-2xl);
    }
}

/* ========================================
   DESKTOP (1024px+)
   ======================================== */

@media (min-width: 1024px) {
    /* Typography */
    .hero h1 {
        font-size: var(--text-6xl);
    }
    
    /* Process Flow */
    .flow-steps {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-md);
    }
    
    .flow-step {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    /* Features Grid */
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Benefits Grid */
    .benefits-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Spacing adjustments */
    .process-flow,
    .seo-content,
    .cta-final {
        padding: 120px 0;
    }
    
    .why-it-works {
        padding: 60px 0 16px;
    }
    
    .features {
        padding: 64px 0 120px;
    }
    
    .benefits {
        padding: 80px 0 120px;
    }
}

/* ========================================
   TALL PORTRAIT SCREENS (e.g., vertical monitor)
   ======================================== */
@media (min-height: 1000px) and (orientation: portrait) {
    .hero {
        min-height: auto;
        padding: 80px 0 80px;
        align-items: flex-start;
    }
}

/* ========================================
   LARGE DESKTOP (1280px+)
   ======================================== */

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
    
    /* Hero adjustments */
    .hero-content {
        gap: 80px;
    }
    
    .dashboard-mockup {
        max-width: 1183px;
    }
}

/* ========================================
   EXTRA LARGE (1536px+)
   ======================================== */

@media (min-width: 1536px) {
    .container {
        max-width: 1400px;
    }
}

/* ========================================
   MOBILE SPECIFIC ADJUSTMENTS
   ======================================== */

@media (max-width: 767px) {
    /* Body mobile */
    body {
        padding-top: 50px;
    }
    
    /* Header mobile */
    .header {
        left: 2rem;
        right: 2rem;
        padding: 6px var(--spacing-md);
        border-radius: 16px;
        height: 48px;
    }
    
    .logo-img {
        height: 26px;
    }
    
    .btn-primary {
        padding: 8px 14px;
        font-size: var(--text-xs);
    }
    
    .btn-secondary {
        padding: 6px 14px;
        font-size: var(--text-xs);
    }
    
    /* Hero mobile */
    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }
    
    
    
    .hero h1 {
        font-size: var(--text-3xl);
    }
    
    .hero p {
        font-size: var(--text-base);
    }
    
    .btn-primary-large {
        padding: 12px 20px;
        font-size: var(--text-sm);
    }
    
    /* Sections mobile */
    .process-flow,
    .seo-content {
        padding: 60px 0;
    }
    
    .why-it-works {
        padding: 40px 0 16px;
    }
    
    .features {
        padding: 64px 0 60px;
    }
    
    .benefits {
        padding: 40px 0 60px;
    }
    
    .cta-final {
        padding: 80px 0;
    }
    
    /* Flow steps mobile */
    .flow-step {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
        padding: var(--spacing-lg);
    }
    
    .step-icon {
        width: 60px;
        height: 60px;
        margin: 0 auto;
    }
    
    .step-icon svg {
        width: 32px;
        height: 32px;
    }
    
    /* Feature cards mobile */
    .feature-image {
        height: 200px;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    }
    
    .feature-content {
        padding: var(--spacing-md);
    }
    
    /* Benefit items mobile */
    .benefit-item {
        padding: var(--spacing-lg);
    }
    
    .benefit-icon {
        width: 60px;
        height: 60px;
    }
    
    /* Typography mobile */
    .why-it-works h2,
    .features h2,
    .benefits h2,
    .seo-content h2,
    .cta-final h2 {
        font-size: var(--text-2xl);
    }
    
    .seo-content h3 {
        font-size: var(--text-lg);
    }
    
    /* Footer mobile */
    .footer {
        padding: 60px 0 40px;
    }
    
    .footer-content {
        gap: var(--spacing-xl);
    }
}

/* ========================================
   SMALL MOBILE (480px and below)
   ======================================== */

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Header - extra small devices (e.g., iPhone SE) */
    .header { height: 44px; }
    .logo-img { height: 22px; }
    .btn-primary { padding: 6px 12px; font-size: 0.75rem; }
    .btn-primary-large { padding: 10px 16px; font-size: var(--text-sm); }

    .hero h1 { font-size: var(--text-2xl); }
    
    .btn-primary-large {
        padding: 12px 20px;
        font-size: var(--text-sm);
        width: 100%;
        justify-content: center;
    }
    
    .feature-content,
    .benefit-item {
        padding: var(--spacing-sm);
    }
    
    .flow-step {
        padding: var(--spacing-md);
    }
    
    .step-icon,
    .benefit-icon {
        width: 50px;
        height: 50px;
    }
    
    .step-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .why-it-works h2,
    .features h2,
    .benefits h2,
    .seo-content h2,
    .cta-final h2 {
        font-size: var(--text-xl);
    }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 120px 0 60px;
    }
}

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

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Adjustments for high DPI displays */
    .logo-img,
    .footer-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .header,
    .cta-final,
    .footer {
        display: none;
    }
    
    .hero {
        padding: 0;
        margin-bottom: 2rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .feature-card,
    .benefit-item,
    .flow-step {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .animate-on-scroll {
        animation: none;
    }
    
    .dashboard-img:hover,
    .feature-card:hover,
    .benefit-item:hover,
    .flow-step:hover {
        transform: none;
    }
}

/* ========================================
   GUIA VISUAL RESPONSIVO
   ======================================== */

/* Mobile */
@media (max-width: 767px) {
    .guide-steps {
        flex-direction: column;
        gap: var(--spacing-lg);
        align-items: center;
    }
    
    .guide-arrow {
        transform: rotate(90deg);
        height: auto;
        margin: var(--spacing-sm) 0;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    
    .guide-arrow svg {
        width: 25px;
        height: 12px;
        display: block;
        margin: 0 auto;
    }
    
    .step-circle {
        width: 60px;
        height: 60px;
    }
    
    .step-circle span {
        font-size: var(--text-lg);
        line-height: 1;
    }
    
    .linearity-guide {
        padding: var(--spacing-md);
        margin-top: var(--spacing-sm);
    }
    
    .guide-step {
        max-width: 250px;
        min-height: auto;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .guide-steps {
        gap: var(--spacing-md);
    }
    
    .guide-step {
        max-width: 150px;
    }
    
    .step-circle {
        width: 70px;
        height: 70px;
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Note: Implementar se necessário no futuro */
    /* Por enquanto mantemos apenas light mode */
}

/* ========================================
   FOCUS VISIBLE SUPPORT
   ======================================== */

@supports selector(:focus-visible) {
    .btn:focus {
        outline: none;
        box-shadow: none;
    }
    
    .btn:focus-visible {
        box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
    }
}

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

/* Preparado para container queries quando houver suporte amplo */
/*
@container (min-width: 768px) {
    .feature-card {
        display: flex;
        flex-direction: row;
    }
    
    .feature-image {
        width: 40%;
        height: auto;
        min-height: 180px;
        border-radius: var(--border-radius-lg);
    }
    
    .feature-content {
        width: 60%;
    }
}
*/

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
    
    .feature-card,
    .benefit-item,
    .flow-step {
        border: 1px solid currentColor;
    }
}

/* Increased font size preference */
@media (prefers-font-size: large) {
    html {
        font-size: 1.125rem;
    }
}

/* ========================================
   BROWSER SPECIFIC FIXES
   ======================================== */

/* Safari specific */
@supports (-webkit-appearance: none) {
    .dashboard-img {
        transform: translateZ(0);
    }
}

/* Firefox specific */
@-moz-document url-prefix() {
    .flow-step,
    .feature-card,
    .benefit-item {
        transform: translateZ(0);
    }
}

/* Edge/IE specific */
@supports (-ms-ime-align: auto) {
    .hero-content {
        display: -ms-grid;
    }
}
