/* Mobile First - Responsivo */

/* Mobile (até 768px) */
/* Tornar cards do carrossel clicáveis no mobile */
@media (max-width: 768px) {
    .carrossel-card {
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    }
    
    .carrossel-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .carrossel-card.ativo:active {
        transform: scale(1.03);
    }
}

@media (max-width: 768px) {
    .hero-banner-pc {
        display: none;
    }

    .hero-banner-mobile {
        display: block;
        width: 100%;
        height: auto;
    }

    .navbar-lateral-banner {
        display: none;
    }
    .navbar-container {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        align-items: flex-start;
    }

    .navbar-logo {
        font-size: 1.25rem;
    }

    .logo-img {
        height: 32px;
    }

    .btn-menu-hamburguer {
        width: 36px;
        height: 36px;
    }

    .btn-menu-hamburguer .menu-icon-svg {
        width: 20px;
        height: 20px;
    }

    .navbar-busca {
        order: 3;
        width: calc(100% - 1rem);
        max-width: 100%;
        margin-top: 1.5rem;
        margin-left: auto;
        margin-right: auto;
        flex-basis: 100%;
    }

    .input-busca {
        margin: 0;
        padding-right: 2.75rem;
    }

    .busca-icone {
        width: 32px;
        height: 32px;
        right: 0.5rem;
    }

    .busca-icone i {
        font-size: 0.9rem;
    }

    .busca-spinner {
        width: 14px;
        height: 14px;
    }

    .hero-titulo {
        font-size: 2rem;
    }

    .hero-subtitulo {
        font-size: 1rem;
    }

    .btn-cta {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    .carrossel-container {
        padding: 1rem 2.5rem 2rem;
        gap: 0.75rem;
        justify-content: flex-start;
        scroll-padding: 0 2.5rem;
        align-items: flex-end;
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
    }
    
    .carrossel-container:active {
        cursor: grabbing;
    }

    .carrossel-card {
        flex: 0 0 240px;
        min-height: 120px;
        max-height: 120px;
        padding: 1rem;
        border-radius: 12px 12px 0 0;
        border-bottom: 3px solid transparent;
    }

    .carrossel-card.ativo {
        flex: 0 0 280px;
        min-height: 130px;
        max-height: 130px;
        padding: 1.25rem;
        border-bottom: 3px solid var(--cor-amarelo);
    }

    .carrossel-card-logo {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        /* Logos "Mitos", "Teocentrismo", "Conhecimento" em amarelo escuro no mobile */
        color: var(--cor-amarelo-escuro);
    }

    .carrossel-card-titulo {
        font-size: 0.85rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        margin-bottom: 0.4rem;
        /* Título do card no hero em amarelo escuro apenas no mobile */
        color: var(--cor-amarelo-escuro);
    }

    .carrossel-card-descricao {
        font-size: 0.8rem;
        line-height: 1.4;
        -webkit-line-clamp: 2;
        margin-bottom: 0.5rem;
    }

    .carrossel-card-link {
        font-size: 0.8rem;
        padding-top: 0.5rem;
    }

    .carrossel-link-arrow {
        width: 14px;
        height: 14px;
        vertical-align: middle;
    }

    .carrossel-arrow {
        width: 32px;
        height: 32px;
    }

    .carrossel-arrow-icon {
        width: 20px;
        height: 20px;
    }

    .carrossel-prev {
        left: 0.5rem;
    }

    .carrossel-next {
        right: 0.5rem;
    }

    .carrossel-pagination {
        bottom: 0.75rem;
        gap: 0.4rem;
    }

    .carrossel-dot {
        width: 6px;
        height: 6px;
    }

    .carrossel-dot.ativo {
        width: 20px;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .card {
        padding: 1.25rem;
        display: flex;
        flex-direction: column;
    }

    /* Reorganizar ordem no mobile: header primeiro, depois botões, depois conteúdo */
    .card-header {
        order: 1;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .card-botoes {
        order: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        margin-top: 0;
    }

    .card-conteudo {
        order: 3;
        margin-top: 0;
    }

    .btn-card.explicar {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
    }

    .btn-card.ouvir {
        grid-column: 1;
        grid-row: 2;
    }

    .btn-card.quiz {
        grid-column: 2;
        grid-row: 2;
    }

    .btn-card {
        width: 100%;
    }

    .card-emoji {
        font-size: 2rem;
    }

    .card-titulo {
        font-size: 1.25rem;
    }

    .navbar-inferior {
        display: flex;
    }

    .navbar-perfil {
        gap: 0.25rem;
    }

    .btn-perfil {
        width: 36px;
        height: 36px;
    }

    .btn-minha-conta {
        padding: 0.5rem;
        gap: 0;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .minha-conta-texto {
        display: none;
    }

    .btn-minha-conta svg {
        width: 18px;
        height: 18px;
    }

    .btn-sair {
        padding: 0.5rem;
        margin-left: 0;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-acessar {
        padding: 0.5rem 0.75rem;
        gap: 0.375rem;
        font-size: 0.85rem;
    }

    .btn-acessar .acessar-icon {
        width: 16px;
        height: 16px;
    }

    .auth-btn-icon {
        width: 18px;
        height: 18px;
    }

    .btn-acessar .acessar-texto {
        display: none;
    }

    .sair-icon {
        width: 18px;
        height: 18px;
    }

    body {
        padding-bottom: 80px;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .modal-content {
        max-width: 100%;
        margin: 1rem;
        max-height: 85vh;
    }

    .chat-container {
        min-height: 300px;
        max-height: 400px;
    }

    .mensagem {
        max-width: 90%;
        min-width: 100px;
    }

    .quiz-ilustracao img {
        max-width: 120px;
    }

    .quiz-container {
        padding: 1rem;
        max-height: 70vh;
    }

    .pergunta-quiz {
        margin-bottom: 1.25rem;
    }

    .pergunta-titulo {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }

    .opcoes-quiz {
        gap: 0.5rem;
    }

    .opcao-quiz {
        padding: 0.75rem;
        font-size: 0.85rem;
        border-width: 1.5px;
    }

    .resultado-quiz {
        padding: 0.75rem;
    }

    .pontuacao-quiz {
        font-size: 1.25rem;
        margin-bottom: 0.375rem;
    }

    #modal-quiz .modal-header {
        padding: 0.75rem 1rem;
    }

    #modal-quiz .modal-header h2 {
        font-size: 1.1rem;
    }

    #modal-quiz .modal-header h2 svg {
        width: 18px;
        height: 18px;
        margin-right: 0.375rem;
    }

    #modal-quiz .btn-fechar {
        font-size: 1.5rem;
        width: 28px;
        height: 28px;
    }

    .quiz-ilustracao {
        margin-bottom: 1rem;
    }

    .pagina-trilha,
    .pagina-perfil,
    .pagina-explorar {
        padding: 1.5rem 1rem;
    }

    .titulo-pagina {
        font-size: 2rem;
    }

    .modulo-card {
        padding: 1.5rem;
    }

    .modulo-header {
        gap: 1rem;
    }

    .modulo-ilustracao {
        width: 80px;
        height: 80px;
    }

    .modulo-icone-fallback {
        font-size: 2rem;
    }

    .modulo-titulo {
        font-size: 1.5rem;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .filtros-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .filtros-container::-webkit-scrollbar {
        height: 4px;
    }

    .filtros-container::-webkit-scrollbar-track {
        background: var(--cor-fundo-card);
        border-radius: 2px;
    }

    .filtros-container::-webkit-scrollbar-thumb {
        background: var(--cor-borda);
        border-radius: 2px;
    }

    .filtros-container::-webkit-scrollbar-thumb:hover {
        background: var(--cor-azul);
    }

    .filtro-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-form {
        flex-direction: column;
    }

    .footer-form button {
        width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-metadados {
        justify-content: center;
    }

    .footer-logo {
        justify-content: center;
        text-align: center;
    }
    .footer-logo img {
        height: 48px;
        max-width: 190px;
    }

    .footer-legenda,
    .footer-descricao,
    .footer-newsletter,
    .footer-modulos,
    .footer-links {
        text-align: center;
        align-items: center;
    }

    .footer-links ul,
    .footer-modulos ul,
    .footer-contatos,
    .footer-metricas {
        justify-content: center;
    }

    .footer-contatos {
        align-items: center;
        text-align: center;
    }

    .footer-contatos .contato {
        justify-content: center;
    }
}

/* Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-banner-pc {
        display: block;
        width: 100%;
        height: auto;
    }

    .hero-banner-mobile {
        display: none;
    }

    .navbar-container {
        padding: 0 1.25rem;
    }

    .main-content {
        padding: 2rem 1.25rem;
    }

    .card-botoes {
        flex-wrap: wrap;
    }

    .btn-card {
        flex: 1;
        min-width: 140px;
    }

    .navbar-inferior {
        display: none;
    }

    .btn-menu-hamburguer {
        display: flex;
    }
}

/* Desktop (acima de 1024px) */
/* Desktop - Ilustrações do Quiz */
@media (min-width: 769px) {
    .quiz-ilustracao img {
        max-width: 280px;
    }
}

@media (min-width: 1025px) {
    .hero-banner-pc {
        display: block;
        width: 100%;
        height: auto;
    }

    .hero-banner-mobile {
        display: none;
    }

    /* Overlay escuro expandido para cobrir todo o banner no desktop */
    .hero-background::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100%;
        width: 100%;
        background: linear-gradient(to bottom, 
            rgba(0, 0, 0, 0.15) 0%, 
            rgba(0, 0, 0, 0.25) 20%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(0, 0, 0, 0.6) 75%,
            rgba(0, 0, 0, 0.75) 100%);
        z-index: 1;
        pointer-events: none;
    }

    .carrossel-container {
        justify-content: center;
    }

    .carrossel-pagination {
        z-index: 3;
    }

    .carrossel-arrow {
        z-index: 3;
    }

    .carrossel-container {
        justify-content: center;
    }

    .navbar-inferior {
        display: none;
    }

    .btn-menu-hamburguer {
        display: flex;
    }

    .navbar-container {
        gap: 0;
    }

    .navbar-logo-container {
        gap: 0.75rem;
        margin-right: 0.5rem;
    }

    .navbar-logo {
        margin-right: 0;
    }

    .btn-menu-hamburguer {
        margin-right: 0;
    }


    .navbar-busca {
        max-width: 500px;
        width: 400px;
        height: auto;
        margin-left: 0;
        flex: 0 0 auto;
        order: 2;
        transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: visible;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 3px;
        margin: -3px;
    }

    .navbar-busca:focus-within {
        max-width: 500px;
        width: auto;
        height: auto;
        justify-content: flex-start;
        overflow: visible;
    }

    .navbar-busca.fechando {
        max-width: 500px !important;
        width: auto !important;
        height: auto !important;
        justify-content: flex-start !important;
    }

    .input-busca {
        width: auto;
        min-width: 200px;
        flex: 1;
        padding: 0.75rem 8rem 0.75rem 1rem;
        margin: 0;
        opacity: 1;
        border: 1px solid var(--cor-borda);
        border-radius: var(--raio-borda);
        transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), border 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        order: 1;
        height: auto;
        line-height: 1.5;
    }

    .navbar-busca:focus-within .input-busca {
        width: auto;
        min-width: 200px;
        flex: 1;
        padding: 0.75rem 8rem 0.75rem 1rem;
        opacity: 1;
        border: 1px solid var(--cor-borda);
        border-radius: var(--raio-borda);
        height: auto;
        line-height: 1.5;
    }

    .microfone-icone {
        position: absolute;
        right: 3rem;
        top: 50%;
        transform: translateY(-50%);
        opacity: 1;
        pointer-events: all;
        transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        width: 36px;
        height: 36px;
        z-index: 3;
    }

    .microfone-icone svg {
        width: 18px;
        height: 18px;
    }

    .navbar-busca:focus-within .microfone-icone {
        opacity: 1;
        pointer-events: all;
    }

    .navbar-busca.fechando .microfone-icone {
        opacity: 1;
        pointer-events: all;
    }

    .navbar-busca.fechando .input-busca {
        width: auto !important;
        min-width: 200px !important;
        padding: 0.75rem 8rem 0.75rem 1rem !important;
        opacity: 1 !important;
        border: 1px solid var(--cor-borda) !important;
    }

    .navbar-busca:focus-within .input-busca:focus {
        outline: none;
        border-color: var(--cor-azul);
        box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
        border-radius: var(--raio-borda);
    }

    .navbar-busca:focus-within {
        padding: 3px;
        margin: -3px;
    }

    .busca-icone {
        position: absolute;
        right: 0.5rem;
        top: 50%;
        transform: translateY(-50%);
        flex-shrink: 0;
        order: 2;
        margin: 0;
        width: 36px;
        height: 36px;
        background: var(--cor-azul);
        color: white;
        border: none;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        align-items: center;
        justify-content: center;
        display: flex;
    }

    .busca-icone:hover {
        background: var(--cor-azul-escuro);
        transform: translateY(-50%) scale(1.05);
    }

    .navbar-busca:focus-within .microfone-icone {
        right: 3rem;
    }

    .navbar-busca:focus-within .busca-icone {
        position: absolute;
        right: 0.5rem;
        top: 50%;
        transform: translateY(-50%);
        background: var(--cor-azul);
        color: white;
        border: none;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        align-items: center;
        justify-content: center;
        display: flex;
        width: 36px;
        height: 36px;
    }

    .navbar-busca.fechando .busca-icone {
        position: absolute !important;
        right: 0.5rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        background: var(--cor-azul) !important;
        color: white !important;
        border: none !important;
    }

    .navbar-busca:focus-within .busca-icone:hover {
        background: var(--cor-azul-escuro);
        transform: translateY(-50%) scale(1.05);
    }

    .navbar-perfil {
        order: 3;
        margin-left: auto;
    }

    .btn-acessar .acessar-texto {
        display: inline;
    }

    .card-botoes {
        flex-wrap: nowrap;
    }

    .btn-card {
        flex: 1;
    }
}

/* Telas muito pequenas (até 480px) */
@media (max-width: 480px) {
    .carrossel-container {
        padding: 0.75rem 2rem 1.75rem;
        gap: 0.5rem;
        scroll-padding: 0 2rem;
        align-items: flex-end;
    }

    .carrossel-card {
        flex: 0 0 200px;
        min-height: 110px;
        max-height: 110px;
        padding: 0.875rem;
        border-radius: 12px 12px 0 0;
        border-bottom: 3px solid transparent;
    }

    .carrossel-card.ativo {
        flex: 0 0 240px;
        min-height: 120px;
        max-height: 120px;
        padding: 1rem;
        border-bottom: 3px solid var(--cor-amarelo);
    }

    .carrossel-card-logo {
        font-size: 0.7rem;
        margin-bottom: 0.4rem;
        /* Garantir amarelo escuro também em telas muito pequenas */
        color: var(--cor-amarelo-escuro);
    }

    .carrossel-card-titulo {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
        margin-bottom: 0.35rem;
        /* Manter título em amarelo escuro nas telas muito pequenas */
        color: var(--cor-amarelo-escuro);
    }

    .carrossel-card-descricao {
        font-size: 0.75rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        margin-bottom: 0.4rem;
    }

    .carrossel-card-link {
        font-size: 0.75rem;
        padding-top: 0.45rem;
    }

    .carrossel-link-arrow {
        width: 12px;
        height: 12px;
        vertical-align: middle;
    }

    .carrossel-arrow {
        width: 28px;
        height: 28px;
    }

    .carrossel-arrow-icon {
        width: 18px;
        height: 18px;
    }

    .carrossel-prev {
        left: 0.25rem;
    }

    .carrossel-next {
        right: 0.25rem;
    }

    .carrossel-pagination {
        bottom: 0.5rem;
        gap: 0.3rem;
    }

    .carrossel-dot {
        width: 5px;
        height: 5px;
    }

    .carrossel-dot.ativo {
        width: 18px;
    }

    .hero-titulo {
        font-size: 1.75rem;
    }

    .card {
        padding: 1rem;
    }

    .card-titulo {
        font-size: 1.1rem;
    }

    .card-conteudo {
        font-size: 0.875rem;
        padding: 0.75rem;
    }

    .btn-card {
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }

    .nav-item {
        padding: 0.5rem 0.5rem;
        font-size: 0.7rem;
    }

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

    .modal-header h2 {
        font-size: 1.25rem;
    }

    #modal-chat .modal-header h2 {
        font-size: 1.1rem;
    }

    .perfil-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .perfil-nome {
        font-size: 1.75rem;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 1rem;
    }

    .navbar-inferior {
        padding: 0.25rem 0;
    }

    .nav-item {
        padding: 0.25rem 0.5rem;
    }
}

/* Ajustes para touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn-card,
    .card,
    .modulo-card {
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
    }

    .btn-card:active,
    .card:active {
        transform: scale(0.98);
    }
}

/* Acessibilidade - Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

