/* MOBILE FIX - EDUCAÇÃO QUE REFLETE */
/* Correções específicas para mobile e menu hamburger */

/* ===== MENU HAMBURGER VISÍVEL ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: #2196F3;
    border: 2px solid #1976D2;
    border-radius: 4px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
}

.hamburger {
    width: 24px;
    height: 3px;
    background: white;
    margin: 2px 0;
    transition: all 0.3s ease;
    transform-origin: center;
    border-radius: 2px;
}

/* Estados do hamburger quando ativo */
.nav-toggle[aria-expanded="true"] .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== MENU MOBILE ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px 20px 20px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-item {
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f0;
        text-decoration: none;
        color: #333;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 12px;
        transition: all 0.3s ease;
        border-radius: 6px;
    }
    
    .nav-item:hover,
    .nav-item:focus {
        background: #f8f9fa;
        color: #007bff;
    }
}

/* ===== CORREÇÕES PARA IPAD ANTIGO E DISPOSITIVOS ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    #conteudo-dinamico {
        min-height: 60vh !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .conteudo-fallback {
        padding: 3rem 2rem !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: white !important;
        text-align: center !important;
        border-radius: 15px !important;
        margin: 2rem auto !important;
        max-width: 800px !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    }
    
    .conteudo-fallback h2 {
        color: white !important;
        font-size: 2rem !important;
        margin-bottom: 1rem !important;
        text-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    }
    
    .conteudo-fallback p {
        font-size: 1.2rem !important;
        margin-bottom: 1.5rem !important;
        opacity: 0.9 !important;
        line-height: 1.6 !important;
    }
    
    .loading-spinner {
        border: 4px solid rgba(255,255,255,0.3) !important;
        border-top: 4px solid white !important;
    }
}

/* ===== MELHORIAS PARA IOS ===== */
@media (max-width: 768px) {
    .nav-item {
        -webkit-user-select: none !important;
        -webkit-touch-callout: none !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
        cursor: pointer !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Feedback visual ao tocar */
    .nav-item:active {
        background: #e9ecef !important;
        transform: scale(0.98) !important;
    }
}

/* ===== GARANTIR CONTEÚDO VISÍVEL EM TODOS OS DISPOSITIVOS ===== */
#conteudo-dinamico {
    min-height: 400px !important;
    position: relative !important;
}

.conteudo-fallback {
    animation: fadeIn 1s ease-in !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* ===== CORREÇÕES ESPECÍFICAS PARA IPADS ANTIGOS ===== */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Garantir que menu funciona em iPads */
    .nav-toggle {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: #2196F3 !important;
        border: 3px solid #1976D2 !important;
        width: 50px !important;
        height: 50px !important;
        border-radius: 8px !important;
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        z-index: 10000 !important;
    }
    
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 350px !important; /* Mais largo para iPads */
        height: 100vh !important;
        background: white !important;
        flex-direction: column !important;
        padding: 120px 30px 30px !important; /* Mais padding */
        transition: right 0.4s ease !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        box-shadow: -5px 0 25px rgba(0,0,0,0.3) !important;
    }
    
    .nav-menu.active {
        right: 0 !important;
    }
    
    .nav-item {
        padding: 18px 22px !important;
        border-bottom: 2px solid #e9ecef !important;
        font-size: 20px !important; /* Texto maior para iPads */
        min-height: 55px !important; /* Área de toque maior */
        color: #333 !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        transition: all 0.3s ease !important;
    }
    
    .nav-item:hover {
        background: #f8f9fa !important;
        color: #007bff !important;
        transform: translateX(5px) !important;
    }
    
    .nav-item i {
        font-size: 22px !important;
        width: 25px !important;
        text-align: center !important;
    }
    
    /* Overlay mais escuro para iPads */
    .nav-menu::before {
        content: '' !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0,0,0,0.8) !important; /* Mais escuro */
        z-index: -1 !important;
        opacity: 0;
        transition: opacity 0.4s ease !important;
    }
    
    .nav-menu.active::before {
        opacity: 1 !important;
    }
    
    /* Social items específicos para iPad */
    .social-item {
        padding: 15px 22px !important;
        justify-content: flex-start !important;
        font-size: 18px !important;
    }
    
    .social-item i {
        color: #666 !important;
        transition: color 0.3s ease !important;
    }
    
    .social-item:hover i {
        color: #007bff !important;
    }
}

/* ===== MELHORIAS PARA IPADS NA VERTICAL ===== */
@media (max-width: 1024px) and (max-height: 1366px) and (min-width: 769px) {
    .nav-menu {
        padding: 100px 25px 25px !important; /* Menos padding em iPads verticais */
    }
    
    .nav-item {
        padding: 16px 20px !important;
        font-size: 18px !important;
    }
}

/* ===== FALLBACK PARA BROWSERS MUITO ANTIGOS ===== */
@media all and (max-width: 1024px) {
    .nav-toggle {
        display: block !important;
    }
}
