/* ===================================
   Instituto LúdicoDev - Responsive Layout
   Mobile & Desktop Adaptations
   =================================== */

/* ===== Tablet & Small Desktop ===== */
@media (max-width: 1200px) {
    :root {
        --spacing-xxl: 4rem;
    }
    
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    
    .header-wrapper {
        padding: 1rem 1.5rem;
    }
    
    .hero-content {
        gap: 3rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .features-grid,
    .courses-grid,
    .testimonials-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .analytics-content {
        gap: 3rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

/* ===== Tablet ===== */
@media (max-width: 992px) {
    :root {
        --spacing-xl: 3rem;
        --spacing-xxl: 3.5rem;
    }
    
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    
    /* Header - Mobile Menu */
    .primary-navigation {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: white;
        box-shadow: var(--shadow-xl);
        transition: left var(--transition-base);
        z-index: 1001;
        padding: 5rem 2rem 2rem;
    }
    
    .primary-navigation.active {
        left: 0;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 1.75rem 1.25rem 2rem;
        background: white;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem 1.75rem;
        border-bottom: 1px solid rgba(225, 232, 237, 0.3);
        border-radius: 0;
        transition: all var(--transition-fast);
        margin-bottom: 0;
        font-size: 1rem;
        font-weight: 500;
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .nav-link:last-child:not(.nav-link-cta) {
        border-bottom: none;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 0;
        background: var(--color-turquoise);
        transition: height var(--transition-base);
    }
    
    .nav-link:hover::before {
        height: 60%;
    }
    
    .nav-link:hover {
        background: linear-gradient(90deg, rgba(46, 196, 182, 0.06) 0%, transparent 100%);
        padding-left: 2rem;
        color: var(--color-turquoise);
    }
    
    .nav-link.active {
        background: linear-gradient(90deg, rgba(46, 196, 182, 0.1) 0%, transparent 100%);
        color: var(--color-turquoise);
        font-weight: 600;
    }
    
    .nav-link.active::before {
        height: 70%;
        background: linear-gradient(180deg, var(--color-turquoise), var(--color-amber));
    }
    
    .nav-link-cta {
        margin-top: 1.25rem;
        padding-top: 1.25rem;
        border-top: 2px solid var(--color-off-white);
        text-align: center;
        background: linear-gradient(135deg, var(--color-turquoise), #26a89a);
        color: white !important;
        border-radius: var(--radius-md);
        border-bottom: none;
        padding: 1rem 1.75rem;
        box-shadow: 0 4px 12px rgba(46, 196, 182, 0.25);
        font-weight: 600;
    }
    
    .nav-link-cta::before {
        display: none;
    }
    
    .nav-link-cta:hover {
        background: linear-gradient(135deg, #26a89a, var(--color-turquoise));
        padding-left: 1.75rem;
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(46, 196, 182, 0.35);
    }
    
    .nav-link-cta.active {
        background: linear-gradient(135deg, var(--color-amber), #f5c456);
        box-shadow: 0 4px 12px rgba(255, 209, 102, 0.3);
    }
    
    .mobile-menu-toggle {
        display: flex;
        z-index: 1002;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Hero */
    .hero-section {
        padding: 7rem 1.5rem 4rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .hero-stats {
        gap: 1.5rem;
        justify-content: space-between;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Sections */
    .section-container {
        padding: 0 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 2rem;
    }
    
    /* Courses */
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Analytics */
    .analytics-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* CTA */
    .cta-title {
        font-size: 2.25rem;
    }
    
    .cta-description {
        font-size: 1.1rem;
    }
    
    /* Registration */
    .registration-wrapper {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 2.5rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-legal {
        flex-direction: column;
        text-align: center;
    }
    
    .legal-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* Cookie Popup */
    .cookie-popup {
        left: 1rem;
        right: 1rem;
        max-width: none;
        bottom: 1rem;
    }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    html {
        font-size: 15px;
        scroll-padding-top: 100px;
    }
    
    body {
        padding-top: 100px;
    }
    
    .site-header {
        top: 10px;
        width: calc(100% - 2rem);
        border-radius: var(--radius-lg);
    }
    
    .header-wrapper {
        padding: 0.875rem 1.5rem;
    }
    
    :root {
        --spacing-lg: 2rem;
        --spacing-xl: 2.5rem;
        --spacing-xxl: 3rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .brand-name {
        font-size: 1.1rem;
    }
    
    .hero-section {
        padding: 6rem 1rem 3rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-item {
        align-items: center;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .features-section,
    .courses-preview-section,
    .testimonials-section,
    .analytics-section,
    .registration-section {
        padding: var(--spacing-xl) 0;
    }
    
    .feature-card,
    .course-card,
    .testimonial-card {
        padding: 1.75rem;
    }
    
    .course-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cta-section {
        padding: var(--spacing-xl) 1.5rem;
    }
    
    .cta-title {
        font-size: 1.85rem;
    }
    
    .cta-description {
        font-size: 1rem;
    }
    
    .registration-wrapper {
        padding: 2rem 1.5rem;
    }
    
    .form-title {
        font-size: 1.85rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .btn-large {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .btn-cta {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .chart-container,
    .chart-wrapper {
        padding: 1.25rem;
    }
    
    #mainChartCanvas,
    #candlestickChart {
        min-height: 250px !important;
    }
}

/* ===== Small Mobile ===== */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .header-wrapper {
        padding: 1rem;
    }
    
    .brand-logo .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    .brand-name {
        font-size: 1rem;
    }
    
    .hero-section {
        padding: 5rem 1rem 2.5rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-header {
        margin-bottom: var(--spacing-md);
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .hero-actions {
        gap: 0.75rem;
    }
    
    .feature-icon,
    .benefit-icon {
        width: 48px;
        height: 48px;
    }
    
    .feature-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .course-title,
    .feature-title {
        font-size: 1.35rem;
    }
    
    .form-input {
        padding: 0.75rem 1rem;
    }
    
    .cookie-popup {
        padding: 1.5rem;
    }
    
    .cookie-actions {
        flex-direction: column;
    }
    
    .cookie-actions .btn {
        width: 100%;
    }
    
    .footer-grid {
        gap: 1.5rem;
    }
    
    .footer-content {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }
    
    .site-footer {
        padding: var(--spacing-lg) 1rem 1rem;
    }
    
    .chart-container {
        min-height: 250px;
        padding: 1rem;
    }
    
    .chart-wrapper {
        min-height: 220px;
        padding: 1rem;
    }
    
    #mainChartCanvas,
    #candlestickChart {
        min-height: 200px !important;
    }
}

/* ===== Print Styles ===== */
@media print {
    .site-header,
    .mobile-menu-toggle,
    .hero-actions,
    .cookie-popup,
    .btn,
    .registration-section {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .hero-section {
        padding-top: 2rem;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
    :root {
        --color-text-secondary: #2A2A2A;
        --color-border: #404040;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .form-input {
        border-width: 3px;
    }
}

/* ===== Landscape Mobile ===== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        padding: 5rem 1.5rem 3rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 2rem;
    }
}

/* ===== New Sections Responsive ===== */
@media (max-width: 1200px) {
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-slider {
        padding: 0 2rem;
    }
    
    .gallery-caption {
        padding: 1rem;
    }
    
    .gallery-caption h3 {
        font-size: 1.25rem;
    }
    
    .gallery-caption p {
        font-size: 0.9rem;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
    }
    
    .process-steps,
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .step-number {
        font-size: 2.5rem;
        top: -0.75rem;
        right: 1rem;
    }
    
    .process-step {
        padding: 1.5rem;
    }
    
    .tech-card {
        padding: 1.5rem;
    }
    
    .achievement-card {
        padding: 1.5rem;
    }
    
    .achievement-number {
        font-size: 3rem;
    }
    
    .achievement-label {
        font-size: 1.1rem;
    }
    
    .faq-question {
        padding: 1rem 1.5rem;
    }
    
    .faq-icon {
        width: 32px;
        height: 32px;
    }
    
    .faq-question h3 {
        font-size: 1.1rem;
    }
    
    .faq-answer p {
        padding: 0 1.5rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-slider {
        padding: 0 1rem;
    }
    
    .gallery-nav {
        width: 36px;
        height: 36px;
    }
    
    .gallery-track {
        gap: 1rem;
    }
    
    .icon-large {
        width: 64px;
        height: 64px;
    }
    
    .step-title {
        font-size: 1.25rem;
    }
    
    .tech-name {
        font-size: 1.25rem;
    }
    
    .achievement-number {
        font-size: 2.5rem;
    }
    
    .achievement-icon img {
        width: 48px;
        height: 48px;
    }
}
