/* ==========================================================================
   Estilos globais do site - Portal de Exercícios
   Usado tanto pelo index.html (portal) quanto pelas páginas de atividade
   (pagina1.html a pagina27.html).
   ========================================================================== */

:root {
    --primary-color: #0d6886;
    --secondary-color: #00b4d8;
    --accent-color: #90e0ef;
    --dark-bg: #03045e;
    --neon-effect: 0 0 10px rgba(0, 180, 216, 0.8);
    --error-color: #ff6b6b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #023e8a 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    padding: 2rem;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 180, 216, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(144, 224, 239, 0.15) 0%, transparent 40%);
    z-index: -1;
}

h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(144, 224, 239, 0.3);
}

b {
    color: var(--accent-color);
    font-weight: 500;
}

ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 180, 216, 0.5), transparent);
    margin: 1.5rem 0;
}

/* Efeitos futuristas (partículas) - usado em todas as páginas */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(144, 224, 239, 0.6);
    border-radius: 50%;
    animation: float linear infinite;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes shine {
    0% {
        left: -50%;
    }

    100% {
        left: 150%;
    }
}


/* ==========================================================================
   Páginas de atividade (pagina1.html ... pagina27.html)
   ========================================================================== */

body.pagina-atividade {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.card {
    width: 800px;
    min-height: 400px;
    background: rgba(13, 104, 134, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 180, 216, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right,
            rgba(0, 180, 216, 0) 0%,
            rgba(0, 180, 216, 0.1) 50%,
            rgba(0, 180, 216, 0) 100%);
    transform: rotate(30deg);
    transition: all 0.6s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 180, 216, 0.4);
    border: 1px solid var(--accent-color);
}

.card:hover::before {
    animation: shine 1.5s infinite;
}

@media (max-width: 850px) {
    .card {
        width: 95%;
        padding: 1.5rem;
    }

    body.pagina-atividade h1 {
        font-size: 1.6rem;
    }
}

/* ---------- Conteúdo estruturado (cenários SQL) ---------- */
.card.card-cenario {
    width: 900px;
    max-width: 95%;
    text-align: left;
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Barra de rolagem discreta, no estilo do site */
.card.card-cenario::-webkit-scrollbar {
    width: 10px;
}

.card.card-cenario::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.card.card-cenario::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 216, 0.5);
    border-radius: 8px;
}

.card.card-cenario::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 180, 216, 0.8);
}

.card.card-cenario {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 180, 216, 0.5) rgba(255, 255, 255, 0.05);
}

.card.card-cenario {
    cursor: default;
}

.card.card-cenario:hover {
    transform: none;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.card.card-cenario:hover::before {
    animation: none;
}

.card.card-cenario h1 {
    font-size: 1.7rem;
    margin-bottom: 0.3rem;
}

.card-cenario h2.subtitulo-cenario {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--accent-color);
    opacity: 0.9;
    margin-bottom: 1.2rem;
    background: none;
    -webkit-text-fill-color: initial;
}

.card-cenario h3 {
    color: var(--accent-color);
    font-size: 1.1rem;
    margin: 1.2rem 0 0.6rem 0;
    letter-spacing: 0.3px;
}

.card-cenario p.contexto {
    line-height: 1.6;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.card-cenario .badge-desafio {
    display: inline-block;
    background: rgba(0, 180, 216, 0.2);
    border: 1px solid rgba(0, 180, 216, 0.5);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    margin-right: 0.5rem;
    letter-spacing: 0.5px;
}

.card-cenario ol.lista-entidades {
    padding-left: 1.4rem;
    margin: 0.5rem 0 1rem 0;
}

.card-cenario ol.lista-entidades > li {
    margin-bottom: 0.9rem;
    line-height: 1.55;
}

.card-cenario ul.lista-regras {
    margin: 0.4rem 0 0 0.3rem;
    padding-left: 1.3rem;
    list-style: none;
}

.card-cenario ul.lista-regras > li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.3rem;
    font-size: 0.93rem;
    opacity: 0.9;
}

.card-cenario ul.lista-regras > li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.card-cenario .bloco-desafios {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 180, 216, 0.25);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    margin-top: 1rem;
}

.card-cenario .bloco-desafios h3 {
    margin-top: 0;
}

.card-cenario .bloco-desafios p {
    line-height: 1.6;
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
}

.card-cenario .lista-queries {
    list-style: none;
    padding-left: 0;
    margin-top: 0.4rem;
}

.card-cenario .lista-queries li {
    margin-bottom: 0.5rem;
    padding-left: 1.6rem;
    position: relative;
    font-size: 0.93rem;
    line-height: 1.5;
}

.card-cenario .lista-queries li::before {
    content: attr(data-q);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--secondary-color);
    color: #03045e;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
}

@media (max-width: 850px) {
    .card.card-cenario {
        padding: 1.5rem;
    }
}


/* ==========================================================================
   Portal (index.html)
   ========================================================================== */

body.portal {
    overflow-x: hidden;
}

.subtitulo {
    text-align: center;
    color: var(--accent-color);
    opacity: 0.8;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.cards-container .card {
    width: auto;
    min-height: 0;
    height: 120px;
    padding: 1.5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cards-container .card:not(.disabled):hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 180, 216, 0.4);
    border: 1px solid var(--accent-color);
}

.cards-container .card:not(.disabled):hover::before {
    animation: shine 1.5s infinite;
}

.cards-container .card.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(60%);
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.card-number {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.8rem;
    color: var(--accent-color);
}

.card-title {
    font-weight: 500;
    font-size: 1.1rem;
    z-index: 2;
}

.card-aluno {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--error-color);
    z-index: 2;
    word-break: break-word;
    padding: 0 0.3rem;
}

.card-data-hora {
    margin-top: 0.15rem;
    font-size: 0.7rem;
    color: var(--accent-color);
    opacity: 0.75;
    z-index: 2;
}

.carregando {
    text-align: center;
    color: var(--accent-color);
    opacity: 0.7;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }

    .cards-container .card {
        height: 110px;
        padding: 1rem 0.5rem;
    }

    body.portal h1 {
        font-size: 2.5rem;
    }
}

@media (min-width: 769px) {
    body.portal h1 {
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }
}


/* ---------- Modal (portal) ---------- */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 4, 94, 0.75);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.overlay.ativo {
    display: flex;
}

.modal {
    background: linear-gradient(135deg, #03045e 0%, #023e8a 100%);
    border: 1px solid rgba(0, 180, 216, 0.5);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.modal h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.modal p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 1.2rem;
}

.modal input {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 180, 216, 0.4);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
}

.modal input:focus {
    border: 1px solid var(--accent-color);
}

.modal-erro {
    color: var(--error-color);
    font-size: 0.85rem;
    min-height: 1.2rem;
    margin-bottom: 0.8rem;
}

.modal-botoes {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.btn {
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-confirmar {
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    color: #03045e;
    font-weight: 600;
}

.btn-confirmar:hover {
    filter: brightness(1.1);
}

.btn-cancelar {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-cancelar:hover {
    border-color: white;
}

/* ---------- Botão de reset (professor) ---------- */
.admin-btn {
    position: fixed;
    bottom: 1.2rem;
    right: 1.2rem;
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.4);
    color: var(--error-color);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 50;
    transition: all 0.2s ease;
}

.admin-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}
