/**
 * Tropa Aprovada — Estilos Complementares ao Tailwind
 */

/* Transições suaves para Alpine.js */
[x-cloak] {
    display: none !important;
}

/* Line clamp para descrições */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #E4ECF7;
}
::-webkit-scrollbar-thumb {
    background: #4A7FBF;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #1B3A6B;
}

/* Player de vídeo responsivo */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================================
   MARCA D'ÁGUA ANTI-PIRATARIA (nome + e-mail do aluno no player)
   Anda lentamente entre os 4 cantos (ciclo de 2 min) pra não
   poder ser recortada da gravação de tela.
   ============================================================ */
.marca-dagua {
    position: absolute;
    z-index: 10;
    top: 8%;
    right: 3%;
    pointer-events: none; /* nunca bloqueia os controles do player */
    color: rgba(255, 255, 255, .55);
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
    user-select: none;
    animation: marca-dagua-anda 120s linear infinite;
}
.marca-dagua-aluno { display: block; font-weight: 600; }
.marca-dagua-site { display: block; opacity: .85; letter-spacing: .04em; }
@keyframes marca-dagua-anda {
    0%, 100% { top: 8%;    right: 3%; bottom: auto; left: auto; text-align: right; }
    25%      { top: auto;  right: 3%; bottom: 14%; left: auto; text-align: right; }
    50%      { top: auto;  right: auto; bottom: 14%; left: 3%;  text-align: left;  }
    75%      { top: 8%;    right: auto; bottom: auto; left: 3%;  text-align: left;  }
}
@media (prefers-reduced-motion: reduce) {
    .marca-dagua { animation: none; } /* acessibilidade: fica fixa no canto */
}

/* ============================================================
   HERO ANIMATIONS
   ============================================================ */

/* Gradiente navy estático com textura sutil de grade (identidade militar sóbria) */
.hero-gradient {
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(165deg, #0A2342 0%, #1B3A6B 55%, #0A2342 100%);
    background-size: 56px 56px, 56px 56px, 100% 100%;
}

/* Fade-in escalonado do conteúdo */
.hero-content .hero-item-1 { animation: fadeInUp 0.6s ease-out 0.1s both; }
.hero-content .hero-item-2 { animation: fadeInUp 0.6s ease-out 0.3s both; }
.hero-content .hero-item-3 { animation: fadeInUp 0.6s ease-out 0.5s both; }
.hero-content .hero-item-4 { animation: fadeInUp 0.6s ease-out 0.7s both; }
.hero-content .hero-item-5 { animation: fadeInUp 0.6s ease-out 0.9s both; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Visual flutuante */
.hero-visual {
    animation: fadeIn 0.8s ease-out 0.4s both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* Floating animation */
.floating {
    animation: float 4s ease-in-out infinite;
}

.floating-delayed {
    animation: float 4s ease-in-out 0.5s infinite;
}

.floating-delayed-2 {
    animation: float 4s ease-in-out 1s infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

/* Dots decorativos pulsando */
.hero-dot {
    animation: pulse 3s ease-in-out infinite;
}

.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-500 { animation-delay: 0.5s; }
.animate-delay-700 { animation-delay: 0.7s; }

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.5); }
}

/* Barra de progresso animada */
.progress-bar {
    transition: width 0.6s ease;
}

/* Toast notifications */
.toast {
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 4.7s forwards;
}
@keyframes slideIn {
    from { transform: translateY(-1rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Sidebar do admin — sticky */
.admin-sidebar {
    position: sticky;
    top: 1rem;
}

/* Aulas sidebar scroll (a gaveta mobile é fixed inset-y-0: ocupa a tela toda) */
.aulas-sidebar {
    overflow-y: auto;
}
@media (min-width: 1024px) {
    .aulas-sidebar {
        max-height: calc(100vh - 2rem);
    }
}

/* Certificado print styles */
@media print {
    body {
        background: white !important;
    }
    .no-print {
        display: none !important;
    }
    .certificado-container {
        border: none !important;
        box-shadow: none !important;
    }
}

/* ============================================================
   ARTIGOS — CORPO DO CONTEÚDO (blog)
   ============================================================ */
.artigo-conteudo > h2:first-child,
.artigo-conteudo > p:first-child { margin-top: 0; }

.artigo-conteudo h2 {
    font-family: 'Oswald', 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0A2342; /* primary-700 */
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.artigo-conteudo h3 {
    font-family: 'Oswald', 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1B3A6B; /* primary-600 */
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.artigo-conteudo p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
    color: #374151; /* gray-700 */
}
.artigo-conteudo ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.75;
    color: #374151;
}
.artigo-conteudo li { margin-bottom: 0.5rem; }
.artigo-conteudo ul li::marker { color: #C8102E; } /* accent-600 */
.artigo-conteudo strong { color: #0A2342; font-weight: 700; }
.artigo-conteudo a {
    color: #1B3A6B;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.artigo-conteudo a:hover { color: #C8102E; }

/* Aulas técnicas: código, tabelas, dicas */
.artigo-conteudo pre {
    background: #0A2342;
    color: #E4ECF7;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}
.artigo-conteudo pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.artigo-conteudo code {
    background: #E4ECF7;
    color: #1B3A6B;
    border-radius: 0.375rem;
    padding: 0.125rem 0.375rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875em;
}
.artigo-conteudo table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.artigo-conteudo table th {
    background: #0A2342;
    color: #ffffff;
    text-align: left;
    padding: 0.625rem 0.875rem;
    font-weight: 600;
}
.artigo-conteudo table td {
    border: 1px solid #C9D9EE;
    padding: 0.5rem 0.875rem;
    color: #374151;
}
.artigo-conteudo table tr:nth-child(even) td { background: #F2F6FB; }
.artigo-conteudo blockquote {
    border-left: 4px solid #C8102E;
    background: #FBEBED;
    padding: 0.875rem 1.125rem;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-bottom: 1.25rem;
    color: #650816;
    font-weight: 500;
    line-height: 1.7;
}

/* BIZU da aula — box de revisão rápida no fim da aula (conteúdo online) */
.artigo-conteudo .bizu {
    background: linear-gradient(160deg, #0A2342 0%, #1B3A6B 100%);
    border-radius: 1rem;
    padding: 1.75rem 2rem;
    margin: 3rem 0 1.5rem;
    box-shadow: 0 12px 28px rgba(10, 35, 66, 0.22);
}
.artigo-conteudo .bizu h2 {
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 0.35rem;
}
.artigo-conteudo .bizu h2::before {
    content: '★ ';
    color: #C8102E;
}
.artigo-conteudo .bizu .bizu-sub {
    color: #B9CCE4;
    margin-bottom: 1.4rem;
}
.artigo-conteudo .bizu .bizu-rotulo {
    margin-bottom: 0.4rem;
}
.artigo-conteudo .bizu .bizu-rotulo strong {
    display: inline-block;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.artigo-conteudo .bizu ul {
    color: #DCE7F5;
    margin-bottom: 1.4rem;
}
.artigo-conteudo .bizu ul li::marker { color: #C8102E; }
.artigo-conteudo .bizu li { margin-bottom: 0.55rem; }
.artigo-conteudo .bizu li strong { color: #ffffff; }
.artigo-conteudo .bizu blockquote {
    background: transparent;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
    color: #E8F0FA;
    margin-bottom: 0;
    font-weight: 400;
}
.artigo-conteudo .bizu blockquote strong { color: #ffffff; }

/* ============================================================
   LANDING PAGE — utilitárias fora do build do Tailwind
   ============================================================ */

/* Badge "SIMULADO" no card de curso — classe ausente do app.css
   (corrige também o mesmo uso em cursos.php) */
.left-3 {
    left: 0.75rem;
}

/* Resposta do FAQ — padding-bottom ausente do build */
.pb-5 {
    padding-bottom: 1.25rem;
}

/* ============================================================
   LABORATÓRIO — terminal Linux no navegador (v86)
   ============================================================ */
.lab-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}
@media (min-width: 1024px) {
    .lab-layout {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }
    .lab-coluna {
        position: sticky;
        top: 4.5rem; /* abaixo da barra fixa da aula — o terminal acompanha a leitura */
    }
}
.lab-roteiro { min-width: 0; }
.lab-coluna { min-width: 0; }
.lab-terminal {
    background: #000;
    border: 1px solid #1f2937;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}
.lab-terminal > div { height: 100%; }

/* ============================================================
   LABORATÓRIO — modal do terminal + janela separada
   ============================================================ */
/* Classes utilitárias ausentes do build do Tailwind */
.max-w-5xl { max-width: 64rem; }
.pr-5 { padding-right: 1.25rem; }

/* Modal: altura máxima controlada, corpo com rolagem própria */
.lab-modal {
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}
.lab-modal-corpo {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* No modal, o terminal vem PRIMEIRO no mobile (é uma ferramenta de uso);
   no desktop, roteiro à esquerda e terminal à direita. */
.lab-modal-layout { display: flex; flex-direction: column; }
.lab-modal-layout .lab-coluna { order: -1; }
@media (min-width: 1024px) {
    .lab-modal-layout {
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }
    .lab-modal-layout .lab-coluna { order: 0; }
}

/* Barra escura da janela separada (aluno/lab.php) */
.lab-pill {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    padding: 0.125rem;
}
.lab-btn-escuro {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: background-color 0.15s;
}
.lab-btn-escuro:hover { background: rgba(255, 255, 255, 0.22); }
.lab-btn-escuro:disabled { opacity: 0.4; }

/* Hover do botao Terminal da barra superior do player (bg-gray-900 -> gray-700) */
.hover-bg-gray-700:hover { background-color: #374151; }

/* ============================================================
   ATENDENTE TROPA — widget do chat (classes fora do build Tailwind)
   ============================================================ */
.agente-fixo { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 50; }
.agente-painel { width: 24rem; max-width: calc(100vw - 3rem); }
.agente-painel-msgs { max-height: 22rem; }
.agente-msg { white-space: pre-wrap; word-break: break-word; }
.agente-msg a { color: #2563EB; text-decoration: underline; font-weight: 600; }
.agente-msg a:hover { opacity: 0.85; }
.agente-msg-user a { color: #ffffff; }
.agente-botao { width: 3.5rem; height: 3.5rem; }
.agente-avatar { width: 2rem; height: 2rem; }
.agente-icone { width: 1.5rem; height: 1.5rem; }
.ml-auto { margin-left: auto; }

/* ============================================================
   EDITOR DE CURSOS em 3 níveis — utilitárias fora do build do Tailwind
   (módulo → tópico → subtópico: rail do tópico, botões ↑↓, badge de
    questões guardadas, modal de edição de HTML e sidebar do aluno)
   ============================================================ */
.pt-1  { padding-top: 0.25rem; }
.pt-2\.5 { padding-top: 0.625rem; }
.pl-4  { padding-left: 1rem; }
.pl-8  { padding-left: 2rem; }
.pr-4  { padding-right: 1rem; }
.w-28  { width: 7rem; }
.w-40  { width: 10rem; }
.max-h-36 { max-height: 9rem; }
.min-w-\[160px\] { min-width: 160px; }
.rounded-b-2xl { border-radius: 0 0 1rem 1rem; }
.border-l-2 { border-left-width: 2px; }
.border-primary-100 { border-color: #E4ECF7; }
.bg-primary-50\/50 { background-color: rgb(242 246 251 / 0.5); }
.divide-gray-50 > :not([hidden]) ~ :not([hidden]) { border-color: #F9FAFB; }
.text-amber-600 { color: #D97706; }
.shadow {
    --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.disabled\:opacity-30:disabled { opacity: 0.3; }
.disabled\:bg-gray-100:disabled { background-color: #F3F4F6; }

/* Modal de edição de HTML: altura máxima (o corpo rola; cabeçalho/rodapé fixos) */
.editor-modal-caixa {
    max-height: 90vh;
}

/* ============================================================
   PLAYER DO SIMULADO (aluno/curso.php) — utilitárias fora do build
   (navegação de questões, botões de entrega, alternativas e estados:
    respondida, correta e marcada errada; primary-400 = tailwind.config)
   ============================================================ */
.w-14  { width: 3.5rem; }
.h-14  { height: 3.5rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.mr-1  { margin-right: 0.25rem; }
.min-h-full { min-height: 100%; }
.border-green-300 { border-color: #86EFAC; }
.border-green-400 { border-color: #4ADE80; }
.border-red-300 { border-color: #FCA5A5; }
.hover\:bg-red-700:hover { background-color: #B91C1C; }
.hover\:border-primary-400:hover { border-color: #4A7FBF; }
@media (min-width: 1024px) {
    .lg\:p-8 { padding: 2rem; }
}
