:root {
    --color-yellow-primary: #0d50ea;
    --color-yellow-hover: #033ab9;
    --color-yellow-light: #e8f0fe;
    --color-blue-deep: #001257;
    --color-blue-vibrant: #0d50ea;
    --color-blue-royal: #001d6e;
    --color-blue-hover: #033ab9;
    --color-black-soft: #001257;
    --color-black-surface: #001d6e;
    --color-white: #FFFFFF;
    --color-white-warm: #F4F7FC;
}

/* Reset e Base */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--color-white-warm);
    color: var(--color-black-soft);
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-black-soft);
    font-weight: 700;
}

.text-auxiliary {
    font-size: 14px;
    line-height: 1.4;
}

/* Botões */
.btn-primary {
    background-color: var(--color-yellow-primary);
    color: #FFFFFF !important;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
}

.btn-primary:hover, .btn-primary:focus-visible {
    background-color: var(--color-yellow-hover);
    color: #FFFFFF !important;
    outline: 2px solid #001257;
    outline-offset: 2px;
}

.btn-secondary {
    background-color: var(--color-white);
    color: var(--color-black-soft);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 2px solid var(--color-black-soft);
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    min-height: 44px;
}

.btn-secondary:hover {
    background-color: #f0f0f0;
}

/* Suporte de alto contraste para Botões Secundários em Temas Escuros / Dark VIP */
.admin-dark-theme .btn-secondary,
.public-dark-theme .btn-secondary,
body.public-dark-theme .btn-secondary,
.dark .btn-secondary {
    background-color: #242424;
    color: #FFFFFF !important;
    border: 1px solid #444444;
}

.admin-dark-theme .btn-secondary:hover,
.public-dark-theme .btn-secondary:hover,
body.public-dark-theme .btn-secondary:hover,
.dark .btn-secondary:hover {
    background-color: #2f2f2f;
    border-color: var(--color-yellow-primary);
    color: var(--color-yellow-primary) !important;
}

/* Badges de Cadeado e Acesso */
.badge-locked {
    background-color: var(--color-white);
    color: var(--color-black-soft);
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}

.badge-unlocked {
    background-color: var(--color-yellow-primary);
    color: #FFFFFF;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Cards Estilo Flix */
.card-flix {
    background: var(--color-white);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    position: relative;
}

.card-flix:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
}

/* Prateleiras Horizontais com Scroll Suave */
.shelf-track {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.5rem 0.25rem 1.25rem 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-yellow-primary) #e5e5e5;
}

.shelf-track::-webkit-scrollbar {
    height: 6px;
}

.shelf-track::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.shelf-track::-webkit-scrollbar-thumb {
    background: var(--color-yellow-primary);
    border-radius: 4px;
}

.shelf-item {
    flex: 0 0 280px;
    max-width: 280px;
}

@media (max-width: 640px) {
    .shelf-item {
        flex: 0 0 240px;
        max-width: 240px;
    }
}

/* Botão Flutuante do WhatsApp */
.floating-whatsapp {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    background-color: var(--color-yellow-primary);
    color: #000000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.floating-whatsapp:hover, .floating-whatsapp:focus-visible {
    background-color: var(--color-yellow-hover);
    transform: scale(1.08);
    outline: 2px solid #000000;
    outline-offset: 2px;
}

/* Safe areas para Mobile */
@media (max-width: 768px) {
    .floating-whatsapp {
        bottom: 84px; /* acima da bottom nav */
        right: 16px;
        width: 54px;
        height: 54px;
    }
}

/* Barra inferior mobile (área do aluno) */
.student-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--color-black-soft);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 998;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.student-bottom-nav a {
    color: #a0a0a0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    min-width: 50px;
    padding: 6px 0;
}

.student-bottom-nav a.active {
    color: var(--color-yellow-primary);
    font-weight: 700;
}

.student-bottom-nav a svg {
    margin-bottom: 2px;
}

/* ========================================================
   TEMA VIP DARK PREMIUM — ADMIN & ÁREA DO ALUNO
   ======================================================== */

.admin-dark-theme,
.student-dark-theme {
    background-color: #121212 !important;
    color: #E5E7EB !important;
}

/* Títulos nos temas Dark */
.admin-dark-theme h1, .admin-dark-theme h2, .admin-dark-theme h3, .admin-dark-theme h4,
.student-dark-theme h1, .student-dark-theme h2, .student-dark-theme h3, .student-dark-theme h4 {
    color: #FFFFFF !important;
}

/* Cards e superfícies que usam bg-white */
.admin-dark-theme .bg-white,
.student-dark-theme .bg-white {
    background-color: #1E1E1E !important;
    border-color: #2D2D2D !important;
    color: #E5E7EB;
}

/* Superfícies secundárias que usam bg-gray-50 ou bg-gray-100 */
.admin-dark-theme .bg-gray-50,
.admin-dark-theme .bg-gray-100,
.student-dark-theme .bg-gray-50,
.student-dark-theme .bg-gray-100 {
    background-color: #181818 !important;
    border-color: #2D2D2D !important;
}

/* Bordas nos temas Dark */
.admin-dark-theme .border-gray-100,
.admin-dark-theme .border-gray-200,
.admin-dark-theme .border-gray-300,
.student-dark-theme .border-gray-100,
.student-dark-theme .border-gray-200,
.student-dark-theme .border-gray-300 {
    border-color: #2D2D2D !important;
}

/* Textos pretos que precisam ser brancos no dark mode */
.admin-dark-theme .text-black,
.admin-dark-theme .text-brand-black,
.admin-dark-theme .text-gray-900,
.admin-dark-theme .text-gray-800,
.student-dark-theme .text-black,
.student-dark-theme .text-brand-black,
.student-dark-theme .text-gray-900,
.student-dark-theme .text-gray-800 {
    color: #FFFFFF !important;
}

/* Textos secundários mais legíveis */
.admin-dark-theme .text-gray-700,
.admin-dark-theme .text-gray-600,
.student-dark-theme .text-gray-700,
.student-dark-theme .text-gray-600 {
    color: #D1D5DB !important;
}

.admin-dark-theme .text-gray-500,
.admin-dark-theme .text-gray-400,
.student-dark-theme .text-gray-500,
.student-dark-theme .text-gray-400 {
    color: #9CA3AF !important;
}

/* Inputs, Textareas e Selects nos temas Dark */
.admin-dark-theme input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
.admin-dark-theme select,
.admin-dark-theme textarea,
.student-dark-theme input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
.student-dark-theme select,
.student-dark-theme textarea {
    background-color: #141414 !important;
    border-color: #333333 !important;
    color: #FFFFFF !important;
}

.admin-dark-theme input:focus,
.admin-dark-theme select:focus,
.admin-dark-theme textarea:focus,
.student-dark-theme input:focus,
.student-dark-theme select:focus,
.student-dark-theme textarea:focus {
    border-color: var(--color-yellow-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(255, 201, 40, 0.25) !important;
}

/* Tabelas nos temas Dark */
.admin-dark-theme table thead th {
    background-color: #161616 !important;
    color: #9CA3AF !important;
    border-color: #2D2D2D !important;
}

.admin-dark-theme table tbody tr {
    border-color: #262626 !important;
}

.admin-dark-theme table tbody tr:hover {
    background-color: #242424 !important;
}

/* Botões secundários no Dark */
.admin-dark-theme .btn-secondary,
.student-dark-theme .btn-secondary {
    background-color: #242424 !important;
    color: #FFFFFF !important;
    border-color: #404040 !important;
}

.admin-dark-theme .btn-secondary:hover,
.student-dark-theme .btn-secondary:hover {
    background-color: #2E2E2E !important;
    color: var(--color-yellow-primary) !important;
    border-color: var(--color-yellow-primary) !important;
}

/* Preservar botões azuis e badges com texto e ícones brancos de alto contraste */
.admin-dark-theme .btn-primary,
.student-dark-theme .btn-primary,
.admin-dark-theme .bg-brand-yellow,
.student-dark-theme .bg-brand-yellow,
.admin-dark-theme .badge-unlocked,
.student-dark-theme .badge-unlocked,
.admin-dark-theme [class*="bg-brand-yellow"],
.student-dark-theme [class*="bg-brand-yellow"] {
    color: #FFFFFF !important;
}

.admin-dark-theme .btn-primary *,
.student-dark-theme .btn-primary *,
.admin-dark-theme .bg-brand-yellow *,
.student-dark-theme .bg-brand-yellow *,
.admin-dark-theme .badge-unlocked *,
.student-dark-theme .badge-unlocked * {
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

/* Superfícies e Chips bg-brand-yellowLight no Dark Mode: fundo azul translúcido com texto azul celeste VIP */
.admin-dark-theme .bg-brand-yellowLight,
.student-dark-theme .bg-brand-yellowLight {
    background-color: rgba(13, 80, 234, 0.15) !important;
    color: #60a5fa !important;
    border-color: rgba(13, 80, 234, 0.35) !important;
}

.admin-dark-theme .bg-brand-yellowLight *,
.student-dark-theme .bg-brand-yellowLight * {
    color: #60a5fa !important;
    stroke: #60a5fa !important;
}

/* Badges azuis (ex: role aluno) */
.admin-dark-theme .bg-yellow-100,
.student-dark-theme .bg-yellow-100 {
    background-color: rgba(13, 80, 234, 0.15) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(13, 80, 234, 0.3) !important;
}

.admin-dark-theme .bg-yellow-100 *,
.student-dark-theme .bg-yellow-100 * {
    color: #93c5fd !important;
    stroke: #93c5fd !important;
}

/* Badges verdes (ex: contagem de login e status) */
.admin-dark-theme .bg-green-100,
.student-dark-theme .bg-green-100 {
    background-color: rgba(34, 197, 94, 0.15) !important;
    color: #4ADE80 !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.admin-dark-theme .bg-green-100 *,
.student-dark-theme .bg-green-100 * {
    color: #4ADE80 !important;
    stroke: #4ADE80 !important;
}

/* Badges de bloqueio no dark mode */
.student-dark-theme .badge-locked,
.admin-dark-theme .badge-locked {
    background-color: #2A2A2A !important;
    color: #FFFFFF !important;
    border-color: #444444 !important;
}

/* Prevenção Absoluta de Quebra e Rolagem Horizontal em Qualquer Resolução */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Aspect Ratio Oficial 490x600 para Cards de Produtos */
.aspect-card-poster,
.aspect-\[490\/600\] {
    aspect-ratio: 490 / 600 !important;
}

/* Tema Dark Premium na Vitrine Pública / Home */
.public-dark-theme {
    background-color: #121212 !important;
    color: #F3F4F6 !important;
}

.public-dark-theme .card-flix {
    background-color: #1E1E1E !important;
    border-color: #2E2E2E !important;
    color: #FFFFFF !important;
}

.public-dark-theme .card-flix:hover {
    border-color: rgba(255, 201, 40, 0.5) !important;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.7) !important;
}

.public-dark-theme .card-flix h3,
.public-dark-theme .card-flix h4 {
    color: #FFFFFF !important;
}

.public-dark-theme .shelf-track {
    scrollbar-color: var(--color-yellow-primary) #1E1E1E !important;
}

.public-dark-theme .shelf-track::-webkit-scrollbar-track {
    background: #181818 !important;
}

/* Barra Inferior Mobile Estilo App para Admin */
.admin-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #181818;
    border-top: 1px solid #2A2A2A;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0.25rem;
    z-index: 45;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.admin-bottom-nav a,
.admin-bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #9CA3AF;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: color 0.15s ease;
    background: transparent;
    border: none;
}

.admin-bottom-nav a.active,
.admin-bottom-nav a:hover,
.admin-bottom-nav button:hover {
    color: var(--color-yellow-primary);
}

/* Prevenção de quebra e estouro horizontal de tabelas */
table td, table th {
    overflow-wrap: break-word;
    word-break: normal;
}
table td.break-all {
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* Suavização de Rolagem de Tabelas no Mobile (Touch-friendly) */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    max-width: 100%;
}

/* Em telas desktop e notebooks (>= 1024px), esconde barras de rolagem desnecessárias para fluidez 100% */
@media (min-width: 1024px) {
    .overflow-x-auto {
        scrollbar-width: none;
    }
    .overflow-x-auto::-webkit-scrollbar {
        display: none;
        height: 0;
    }
}

@media (max-width: 1023px) {
    .overflow-x-auto::-webkit-scrollbar {
        height: 4px;
    }
    .overflow-x-auto::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.03);
        border-radius: 9999px;
    }
    .overflow-x-auto::-webkit-scrollbar-thumb {
        background: rgba(255, 201, 40, 0.3);
        border-radius: 9999px;
    }
    .overflow-x-auto::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 201, 40, 0.6);
    }
}

/* ==========================================================================
   Modo Claro Público (Frontend Light Theme)
   ========================================================================== */
body.public-light-theme {
    background-color: #F9FAFB !important;
    color: #111827 !important;
}

body.public-light-theme header {
    background-color: #FFFFFF !important;
    border-color: #E5E7EB !important;
    color: #111827 !important;
}

body.public-light-theme header nav a {
    color: #374151 !important;
}

body.public-light-theme header nav a:hover {
    color: #000000 !important;
}

body.public-light-theme .bg-\[\#181818\],
body.public-light-theme .bg-\[\#161616\],
body.public-light-theme .bg-\[\#121212\],
body.public-light-theme .bg-\[\#1A1A1A\],
body.public-light-theme .bg-\[\#1E1E1E\] {
    background-color: #FFFFFF !important;
    border-color: #E5E7EB !important;
}

body.public-light-theme .card-flix {
    background-color: #FFFFFF !important;
    border-color: #E5E7EB !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

/* No modo claro, escurece apenas textos sobre superfícies claras, protegendo botões, gradientes e fundos escuros */
body.public-light-theme .text-white:not(.btn-primary):not(.btn-primary *):not([class*="bg-black"]):not([class*="bg-gradient"]):not([class*="bg-emerald"]):not([class*="bg-brand-yellow"]):not(.badge-unlocked):not(.badge-locked) {
    color: #111827;
}

body.public-light-theme .text-gray-100:not([class*="bg-black"] *):not([class*="bg-gradient"] *),
body.public-light-theme .text-gray-200:not([class*="bg-black"] *):not([class*="bg-gradient"] *) {
    color: #1F2937;
}

body.public-light-theme .text-gray-300:not([class*="bg-black"] *):not([class*="bg-gradient"] *),
body.public-light-theme .text-gray-400:not([class*="bg-black"] *):not([class*="bg-gradient"] *) {
    color: #4B5563;
}

/* Garante contraste perfeito para botões e fundos escuros */
body.public-light-theme .btn-primary,
body.public-light-theme .btn-primary * {
    color: #000000 !important;
}
body.public-light-theme [class*="bg-black"] .text-white,
body.public-light-theme [class*="bg-gradient"] .text-white {
    color: #FFFFFF !important;
}

body.public-light-theme .border-\[\#2A2A2A\],
body.public-light-theme .border-\[\#2E2E2E\],
body.public-light-theme .border-\[\#333\],
body.public-light-theme .border-\[\#3A3A3A\] {
    border-color: #E5E7EB;
}

body.public-light-theme footer {
    background-color: #F3F4F6 !important;
    border-color: #E5E7EB !important;
    color: #1F2937 !important;
}

body.public-light-theme footer h4 {
    color: #111827 !important;
}

body.public-light-theme footer a,
body.public-light-theme footer span,
body.public-light-theme footer p {
    color: #4B5563 !important;
}

body.public-light-theme footer a:hover {
    color: #000000 !important;
}



