/**
 * PONTE IA - Mobile Fixes & Responsiveness
 * Correções críticas para mobile e touch devices
 */

/* ========================================
   1. TOUCH TARGETS MÍNIMOS (44x44px)
   ======================================== */

.btn,
.social-link,
.nav-link,
.play-button,
button,
a[href] {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
}

.btn-sm {
    min-height: 44px;
    padding: 0.65rem 1.25rem;
}

.btn-lg {
    min-height: 56px;
    padding: 1rem 2rem;
}

/* ========================================
   2. MOBILE OPTIMIZATION (< 768px)
   ======================================== */

@media (max-width: 767px) {
    /* Hero Section Mobile */
    .hero {
        min-height: 80vh; /* Reduzido de 100vh */
        padding: 100px 20px 60px;
    }

    .hero-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: clamp(0.95rem, 4vw, 1.1rem);
        margin-bottom: 2rem;
    }

    .hero-badge {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    /* CTAs Empilhados */
    .hero-ctas {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .hero-ctas .btn {
        width: 100%;
        justify-content: center;
    }

    /* Floating Shapes - Desabilitar em mobile */
    .floating-shape {
        display: none !important;
    }

    /* Cards Mobile - 1 Coluna */
    .solution-card,
    .team-card {
        width: 100%;
        margin-bottom: 2rem;
    }

    .solutions-grid,
    .team-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    /* CTAs nos Cards */
    .card-ctas {
        flex-direction: column;
        gap: 0.75rem;
    }

    .card-ctas .btn {
        width: 100%;
    }

    /* Desabilitar Hover 3D em Mobile */
    .card-3d:hover {
        transform: none !important;
    }

    /* Touch Active State */
    .touch-device .card-3d.touch-active {
        transform: translateY(-5px) scale(1.01);
        box-shadow: 0 10px 30px rgba(153, 244, 67, 0.3);
        transition: all 0.3s ease;
    }

    /* Manifesto - Layout Stack */
    .manifesto-content {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .manifesto-image {
        order: -1; /* Imagem primeiro */
        margin-bottom: 1rem;
    }

    .play-button {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }

    /* Método - Cards Verticais */
    .method-timeline {
        gap: 1.5rem;
    }

    .method-step {
        padding: 1.5rem;
    }

    /* Footer Mobile Stack */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

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

    .footer-column {
        width: 100%;
    }

    /* Navegação Mobile */
    .nav-content {
        padding: 0 20px;
    }

    .nav-logo img {
        height: 35px;
    }

    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 101;
    }

    .nav-toggle span {
        width: 100%;
        height: 3px;
        background: var(--color-white);
        border-radius: 2px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform-origin: center;
    }

    /* Menu Mobile Overlay */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(0, 0, 0, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        padding: 2rem;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-link {
        font-size: 1.5rem;
        padding: 1rem 2rem;
        width: 100%;
        max-width: 300px;
        text-align: center;
        border-radius: var(--radius-md);
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(153, 244, 67, 0.1);
    }

    .cta-nav {
        width: 100%;
        max-width: 300px;
        padding: 1rem 2rem;
    }

    /* Texto mínimo legível */
    body {
        font-size: 16px; /* Nunca menor que 16px */
    }

    p {
        font-size: clamp(0.95rem, 4vw, 1.1rem);
    }

    small {
        font-size: 0.875rem; /* Mínimo 14px */
    }
}

/* ========================================
   3. SMALL MOBILE (< 375px)
   ======================================== */

@media (max-width: 374px) {
    .hero {
        padding: 80px 15px 40px;
    }

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

    .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1.25rem;
    }

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

    .container {
        padding: 0 15px;
    }
}

/* ========================================
   4. TABLET (768px - 1024px)
   ======================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    .hero {
        min-height: 90vh;
        padding: 120px 40px 80px;
    }

    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    /* Menu Desktop Compacto */
    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .cta-nav {
        padding: 0.5rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ========================================
   5. LARGE DESKTOP (> 1440px)
   ======================================== */

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

    .hero {
        padding: 140px 0 100px;
    }

    .solutions-grid {
        gap: 3rem;
    }

    .team-grid {
        gap: 3.5rem;
    }
}

/* ========================================
   6. TOUCH DEVICE OPTIMIZATIONS
   ======================================== */

.touch-device .card-3d {
    cursor: pointer;
}

.touch-device .card-3d:active {
    transform: scale(0.98);
}

/* Remove hover effects em touch */
.touch-device .btn:hover {
    transform: none;
}

.touch-device .btn:active {
    transform: scale(0.96);
}

/* ========================================
   7. PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Reduzir animações em mobile */
@media (max-width: 767px) {
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }

    /* Desabilitar parallax/heavy effects */
    .is-mobile .floating-shape,
    .is-mobile [data-parallax] {
        display: none !important;
    }

    /* Simplificar sombras */
    .is-mobile .card-3d,
    .is-mobile .solution-card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    }
}

/* ========================================
   8. PREVENT SCROLL QUANDO MENU ABERTO
   ======================================== */

body.no-scroll {
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
}

/* ========================================
   9. READING PROGRESS BAR MOBILE
   ======================================== */

@media (max-width: 767px) {
    .reading-progress {
        height: 3px; /* Mais fino em mobile */
    }
}

/* ========================================
   10. PRINT STYLES
   ======================================== */

@media print {
    .nav,
    .nav-toggle,
    .floating-shape,
    .global-particles,
    .reading-progress,
    .btn,
    .cta-nav {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

/* ========================================
   11. 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;
    }

    .floating-shape,
    .global-particles {
        display: none !important;
    }
}

/* ========================================
   12. HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: high) {
    .btn-primary {
        background: #FFFF00;
        color: #000000;
        border: 2px solid #000000;
    }

    .btn-secondary {
        background: #FF00FF;
        color: #000000;
        border: 2px solid #000000;
    }

    .nav {
        background: #000000;
        border-bottom: 3px solid #FFFFFF;
    }
}

/* ========================================
   13. DARK MODE (FORCE)
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Site já é dark por padrão, mas garantir */
    body {
        background: #000000;
        color: #FFFFFF;
    }
}

/* ========================================
   14. LANDSCAPE MOBILE
   ======================================== */

@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 20px 40px;
    }

    .nav-menu {
        height: auto;
        max-height: calc(100vh - 60px);
        padding: 1rem;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* ========================================
   15. SAFE AREAS (iOS NOTCH)
   ======================================== */

@supports (padding: max(0px)) {
    .nav {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    .footer {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(40px, env(safe-area-inset-bottom));
    }
}
