/**
 * Mobile Enhancements CSS
 * Melhorias específicas para dispositivos móveis
 * Turismo Mato Grosso - 2025
 */

/* ============================================
   FASE 1: NAVEGAÇÃO MOBILE
   ============================================ */

/* Touch targets mínimos (44x44px) */
@media (max-width: 768px) {
    .btn,
    .nav-link,
    .bioma-icon,
    button,
    a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Navbar mobile otimizada */
    .navbar {
        padding: 15px 0;
    }

    .navbar .container {
        padding: 0 20px;
    }

    .logo {
        font-size: 1.2rem;
        max-width: 150px;
    }

    .logo img {
        max-height: 40px;
        width: auto;
    }

    /* Menu hamburger melhorado */
    .menu-toggle {
        width: 44px;
        height: 44px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .menu-toggle:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.2);
    }

    .menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: white;
        margin: 5px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    /* Animação do menu hamburger */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Menu mobile overlay */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: rgba(10, 26, 20, 0.98);
        backdrop-filter: blur(20px);
        padding: 80px 30px 30px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 999;
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.active {
        right: 0;
    }

    /* Overlay escuro */
    .nav-menu::before {
        content: '';
        position: fixed;
        top: 0;
        left: -100vw;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        opacity: 0;
        transition: opacity 0.4s ease;
        pointer-events: none;
    }

    .nav-menu.active::before {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
    }

    .nav-link {
        width: 100%;
        padding: 18px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1.1rem;
        justify-content: flex-start;
        transition: all 0.3s ease;
    }

    .nav-link:hover,
    .nav-link:active {
        background: rgba(0, 230, 118, 0.1);
        padding-left: 30px;
    }

    .nav-cta {
        width: 100%;
        margin-top: 20px;
        padding: 16px;
        font-size: 1.1rem;
    }
}

/* ============================================
   FASE 2: LAYOUT E GRIDS
   ============================================ */

@media (max-width: 768px) {
    /* Hero section otimizada */
    .hero {
        min-height: 85vh;
        padding: 100px 0 60px;
    }

    .hero-content {
        padding: 0 10px;
    }

    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-top: 40px;
    }

    .stat-item {
        padding: 15px;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    /* Sections */
    .section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 40px;
        text-align: center;
    }

    .section-header h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .section-header p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Cards otimizados */
    .bioma-card,
    .destino-card,
    .experiencia-card {
        padding: 25px;
        margin-bottom: 20px;
    }

    .bioma-card h3,
    .destino-card h4,
    .experiencia-card h4 {
        font-size: 1.3rem;
    }

    /* Destinos showcase */
    .destinos-showcase {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .destino-card {
        min-height: 300px;
    }

    /* Sustainability section */
    .sustainability-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .sustainability-visual {
        order: -1;
        margin-bottom: 30px;
    }

    .eco-features {
        gap: 20px;
    }

    .eco-feature {
        padding: 15px;
    }

    /* Experiências grid */
    .experiencias-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .experiencia-card {
        padding: 20px;
    }

    .experiencia-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
}

/* Mobile small (< 480px) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .bioma-icon {
        font-size: 2.5rem;
        width: 60px;
        height: 60px;
    }
}

/* ============================================
   FASE 3: TIPOGRAFIA E ESPAÇAMENTO
   ============================================ */

@media (max-width: 768px) {
    body {
        line-height: 1.6;
        font-size: 16px;
    }

    h1 { font-size: clamp(2rem, 8vw, 2.5rem); }
    h2 { font-size: clamp(1.75rem, 6vw, 2rem); }
    h3 { font-size: clamp(1.3rem, 5vw, 1.5rem); }
    h4 { font-size: clamp(1.1rem, 4vw, 1.25rem); }

    p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    /* Botões full-width */
    .btn-primary,
    .btn-secondary,
    .btn-outline {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
        text-align: center;
    }

    /* Espaçamentos reduzidos */
    .container {
        padding: 0 20px;
    }

    .section {
        padding: 50px 0;
    }

    .section-header {
        margin-bottom: 30px;
    }

    /* Badges */
    .section-badge,
    .hero-badge,
    .destino-badge {
        font-size: 0.75rem;
        padding: 6px 14px;
    }
}

/* ============================================
   FASE 4: MAPAS E INTERATIVIDADE
   ============================================ */

@media (max-width: 768px) {
    /* Mapa container */
    .mapa-container {
        height: 400px;
        margin: 30px 0;
        border-radius: 12px;
        overflow: hidden;
    }

    #mapa-interativo {
        height: 100%;
        width: 100%;
    }

    /* Controles do mapa maiores */
    .leaflet-control-zoom a {
        width: 40px !important;
        height: 40px !important;
        line-height: 40px !important;
        font-size: 20px !important;
    }

    /* Popups do mapa */
    .leaflet-popup-content {
        font-size: 0.9rem;
        padding: 12px;
        min-width: 200px;
    }

    .leaflet-popup-content-wrapper {
        border-radius: 12px;
    }

    /* Legenda do mapa */
    .mapa-legend {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        padding: 15px;
    }

    .legend-item {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .legend-dot {
        width: 12px;
        height: 12px;
    }

    /* Galeria de fotos */
    .galeria-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .foto-card {
        height: 250px;
    }

    /* Swipe indicator */
    .swipe-indicator {
        display: block;
        text-align: center;
        padding: 10px;
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.6);
    }

    .swipe-indicator::before {
        content: '← Deslize →';
    }
}

/* ============================================
   FASE 5: PERFORMANCE MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Reduzir animações */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }

    /* Desabilitar parallax */
    .parallax,
    .hero-bg {
        background-attachment: scroll !important;
    }

    /* Simplificar sombras */
    .card,
    .btn,
    .bioma-card,
    .destino-card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    }

    /* Remover blur pesado */
    .glass-effect {
        backdrop-filter: none !important;
        background: rgba(10, 26, 20, 0.9) !important;
    }

    /* Otimizar gradientes */
    body::before {
        opacity: 0.5;
    }
}

/* ============================================
   FASE 6: FORMULÁRIOS E INPUTS
   ============================================ */

@media (max-width: 768px) {
    /* Inputs maiores */
    input,
    textarea,
    select {
        font-size: 16px !important; /* Previne zoom no iOS */
        padding: 14px 16px;
        min-height: 48px;
    }

    textarea {
        min-height: 120px;
    }

    /* Labels */
    label {
        font-size: 0.95rem;
        margin-bottom: 8px;
        font-weight: 500;
    }

    /* Form rows */
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Mensagens de erro */
    .error-message,
    .success-message {
        font-size: 0.9rem;
        padding: 12px 16px;
        margin-top: 10px;
    }

    /* Botões de formulário */
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Select customizado */
    select {
        background-size: 16px;
        padding-right: 40px;
    }

    /* Checkbox e radio maiores */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }
}

/* ============================================
   UTILITÁRIOS MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Esconder em mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Mostrar apenas em mobile */
    .show-mobile {
        display: block !important;
    }

    /* Texto centralizado em mobile */
    .text-center-mobile {
        text-align: center !important;
    }

    /* Stack em mobile */
    .stack-mobile {
        flex-direction: column !important;
    }

    /* Full width em mobile */
    .full-width-mobile {
        width: 100% !important;
    }

    /* Padding mobile */
    .p-mobile {
        padding: 20px !important;
    }

    /* Margin mobile */
    .m-mobile {
        margin: 20px 0 !important;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */

@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 80px 0 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .nav-menu {
        padding: 60px 20px 20px;
    }
}

/* ============================================
   ACESSIBILIDADE MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Foco visível */
    *:focus {
        outline: 3px solid var(--primary-green);
        outline-offset: 2px;
    }

    /* Skip to content */
    .skip-to-content {
        position: absolute;
        top: -100px;
        left: 20px;
        background: var(--primary-green);
        color: var(--bg-dark);
        padding: 12px 20px;
        border-radius: 8px;
        font-weight: 600;
        z-index: 9999;
        transition: top 0.3s ease;
    }

    .skip-to-content:focus {
        top: 20px;
    }

    /* Aumentar contraste */
    @media (prefers-contrast: high) {
        body {
            background: #000;
            color: #fff;
        }

        .btn {
            border: 2px solid currentColor;
        }
    }
}
