/*
 * Get FluencyNow - camada responsiva compartilhada
 * Funciona igual no Android (toque) e no navegador desktop.
 * Carregada por ultima para poder ajustar os estilos antigos.
 */

*, *::before, *::after { box-sizing: border-box; }

/* ---------- DESKTOP / TABLET LARGO ---------- */
@media (min-width: 901px) {
    .content {
        max-width: 1200px;
        margin: 60px auto 0;
    }

    .navbar {
        padding: 0 clamp(20px, 4vw, 60px);
    }

    .section-title {
        padding: 24px clamp(20px, 4vw, 60px);
    }

    .slider {
        height: clamp(250px, 30vw, 420px);
    }

    .courses {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        overflow: visible;
        padding-bottom: 40px;
    }

    .course-card {
        min-width: 0;
        height: clamp(180px, 16vw, 240px);
    }

    .sidenav { width: 280px; }

    .profile-menu img { width: 96px; height: 96px; }

    .lesson-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    }
}

/* ---------- CELULAR ---------- */
@media (max-width: 900px) {
    .courses {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .course-card { flex-shrink: 0; }
}

@media (max-width: 600px) {
    .section-title { font-size: 20px; }

    .lesson-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .lesson-card { min-height: 190px; }

    .lesson-title { font-size: 16px !important; }

    .profile-stats { grid-template-columns: repeat(2, 1fr) !important; }

    .stats { grid-template-columns: repeat(2, 1fr) !important; }

    .video-box iframe { height: auto; aspect-ratio: 16 / 9; }

    header h1 { font-size: 24px !important; }
}

@media (max-width: 480px) {
    .modal-content {
        width: min(320px, calc(100vw - 32px)) !important;
        padding: 20px !important;
    }

    .login-card,
    .signup-card,
    .recover-card,
    .card {
        max-width: calc(100vw - 32px) !important;
        padding: 24px 18px !important;
    }

    .lesson-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
        gap: 10px !important;
        padding: 10px !important;
    }

    .lesson-card {
        height: auto !important;
        min-height: 180px;
    }

    .lesson-content {
        position: static !important;
        padding: 12px !important;
    }

    .lesson-desc {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .prev, .next {
        width: 34px !important;
        height: 34px !important;
    }

    .sidenav { width: min(280px, 86vw); }
}

/* ---------- BOTAO DE LOGIN COM GOOGLE ---------- */
.google-btn {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 14px;
    background: #fff;
    color: #111;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.google-btn:hover { filter: brightness(.94); }

.google-btn .g {
    color: #4285F4;
    font-weight: 800;
    font-size: 20px;
    line-height: 1;
}

/* ---------- AREA SEGURA (Android com notch / teclado) ---------- */
.navbar {
    padding-top: env(safe-area-inset-top);
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

.content {
    margin-top: calc(60px + env(safe-area-inset-top));
}

.modal {
    overscroll-behavior: contain;
}

/* Overlay do menu lateral (o id duplicado em index.html foi corrigido) */
.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 1500;
}

.menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Botões do slider: visíveis mas discretos para uso com mouse */
.prev, .next { opacity: .55 !important; }

/* ---------- LANDSCAPE BAIXO (celular deitado) ---------- */
@media (max-height: 560px) and (orientation: landscape) {
    .logo-img {
        width: 150px !important;
        margin-bottom: .5rem !important;
    }

    .title {
        margin-bottom: 1rem !important;
        font-size: 1.2rem !important;
    }

    .progress-container {
        transform: scale(.8);
    }

    .slider { height: 180px !important; }
}

.lesson-image {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 14px;
    background: #1a1d24;
}
