:root {
    --color-fw-bg: #111827;
    --color-fw-card: #1f2937;
    --color-fw-border: #374151;
    --color-fw-primary: #3b82f6;
}

/* --- UTILITÁRIOS GLOBAIS --- */
.bg-fw-bg {
    background-color: var(--color-fw-bg);
}

.bg-fw-card {
    background-color: var(--color-fw-card);
}

.border-fw-border {
    border-color: var(--color-fw-border);
}

.tab-trigger.active {
    background-color: var(--color-fw-primary);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2);
}

.tab-trigger:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.text-fw-primary {
    color: var(--color-fw-primary);
}

.bg-fw-primary {
    background-color: var(--color-fw-primary);
}

input:focus,
select:focus {
    box-shadow: 0 0 0 2px rgba(var(--fw-primary-rgb), 0.2);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* --- ANIMAÇÕES GLOBAIS --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flame-pulse {

    0%,
    100% {
        filter: drop-shadow(0 0 2px rgba(249, 115, 22, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.8));
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.lucide-flame {
    animation: flame-pulse 2s infinite ease-in-out;
}

.notification-popup.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* =========================================
   SIDEBAR: BASE & COLLAPSED STATES
   ========================================= */

/* Base sidebar transition */
#sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- COLLAPSED STATE --- */
#sidebar.collapsed {
    width: 4.5rem !important;
}

/* Hide all text labels when collapsed */
#sidebar.collapsed .sidebar-text,
#sidebar.collapsed .sidebar-text-flex,
#sidebar.collapsed .sidebar-section-label {
    display: none !important;
}

/* Center nav items when collapsed */
#sidebar.collapsed .nav-item {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

#sidebar.collapsed .nav-item i {
    margin: 0;
}

/* Logo area adjustments */
#sidebar.collapsed .sidebar-logo-area {
    padding-left: 0;
    padding-right: 0;
    display: flex;
    justify-content: center;
}

#sidebar.collapsed .sidebar-logo-area a {
    justify-content: center;
}

/* Footer adjustments */
#sidebar.collapsed .sidebar-text {
    display: none !important;
}

#sidebar.collapsed .sidebar-collapsed-footer {
    display: flex !important;
}

/* Rotate collapse icon when collapsed */
#sidebar.collapsed #collapse-icon {
    transform: rotate(180deg);
}

/* --- PRODUCT SPECIFIC STYLES --- */
@keyframes soft-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}

.animate-soft-pulse {
    animation: soft-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    will-change: opacity, transform;
}

/* FW Vision Animations */
@keyframes blink-risk {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; box-shadow: 0 0 15px rgba(244, 63, 94, 0.4); }
}

.animate-risk-alert {
    animation: blink-risk 3s ease-in-out infinite;
}

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

.animate-float-point {
    animation: float-point 4s ease-in-out infinite;
}

/* AlgoMathe Pro Animations */
@keyframes draw-line {
    0% { width: 0; opacity: 0; }
    100% { width: 100%; opacity: 1; }
}

.animate-draw-line {
    animation: draw-line 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* AlgoMathe EA Animations */
@keyframes log-scroll {
    0% { transform: translateY(10px); opacity: 0; }
    10% { transform: translateY(0); opacity: 1; }
    90% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-10px); opacity: 0; }
}

.animate-log {
    animation: log-scroll 3s ease-in-out infinite;
}

.animate-log-delayed {
    animation: log-scroll 3s ease-in-out infinite 0.5s;
    opacity: 0;
}

.bg-grid {
    background-size: 20px 20px;
    background-image: linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
}

/* --- SIDEBAR NAVIGATION & CATEGORIES --- */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    color: #64748b;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid transparent;
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.nav-item i {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.nav-item:hover i {
    transform: scale(1.1);
    color: #60a5fa;
}

/* Active State: Premium Left-Accent Pill */
.active-nav-item {
    background: rgba(30, 41, 59, 0.8) !important;
    color: white !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 2px 0 0 #3b82f6 !important;
}

.active-nav-item i {
    color: #60a5fa !important;
    transform: scale(1.1);
}

/* Sidebar Section Headers (Institutional Caps) */
.sidebar-section-title {
    padding: 0 0.5rem;
    font-size: 10px;
    font-weight: 900;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

/* Custom Scrollbar for Sidebar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.1);
}

/* --- TABS --- */
.tab-button.active-tab {
    color: theme('colors.white');
    border-bottom-color: theme('colors.fw-primary');
}

.tab-content article {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* =========================================
   RPG / GAMIFICATION - ESTILO FULL ART + BORDA ANIMADA
   ========================================= */

@keyframes shimmer-border {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes border-rotate {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 200% 200%;
    }
}

/* 1. Base do Card */
.badge-card-base {
    position: relative;
    height: 22rem;
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    background-color: #020617;
    /* Borda padrão (será sobrescrita se desbloqueada) */
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

/* 2. Camada da Imagem */
.badge-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 3. Efeitos de Hover (Card) */
.badge-item:hover .badge-card-base {
    transform: translateY(-8px);
    /* Glow externo suave na cor da raridade */
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.7), 0 0 20px -5px var(--rarity-color);
}

.badge-item:hover .badge-bg-layer {
    transform: scale(1.1);
}

/* 4. Painel de Info (Reveal) */
.badge-info-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.8), transparent);
    z-index: 10;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid transparent;
}

.badge-item:hover .badge-info-panel {
    opacity: 1;
    transform: translateY(0);
    border-top-color: var(--rarity-color);
}

/* 5. UI Elements (Tags/Icons) */
.floating-rarity-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}


/* --- ESTADOS & ANIMAÇÃO DE BORDA UNIFICADA --- */

/* BLOQUEADO: Cinza e Estático */
.badge-locked .badge-bg-layer {
    filter: grayscale(100%) contrast(0.8) brightness(0.4);
}

.badge-locked .status-badge {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #64748b;
}

/* DESBLOQUEADO: Borda Animada em TODAS as raridades */
.badge-unlocked {
    /* Removemos a borda padrão para usar o pseudo-elemento animado */
    border-color: transparent;
}

.badge-unlocked .badge-bg-layer {
    filter: grayscale(0%) contrast(1.05) brightness(1);
}

/* A Mágica da Borda Animada para Todos */
.badge-unlocked::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 1.5px;
    /* Espessura da borda brilhante */

    /* Gradiente Animado usando a cor da raridade */
    background: linear-gradient(135deg,
            var(--rarity-color),
            rgba(255, 255, 255, 0.2) 25%,
            var(--rarity-color) 50%,
            transparent 75%,
            var(--rarity-color) 100%);

    /* Máscara para recortar apenas a borda */
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;

    background-size: 200% 200%;
    animation: shimmer-border 3s linear infinite;
    pointer-events: none;
    z-index: 50;
}

/* Status Icon colorido */
.badge-unlocked .status-badge {
    background: var(--rarity-color);
    color: #000;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px var(--rarity-color);
}

/* Exceção Mítica (Extra Brilho no Ícone) */
.badge-unlocked[data-rarity="mythic"] .status-badge {
    color: white;
    background: black;
    border-color: var(--rarity-color);
}

/* Wrapper Mítico (Ainda mantemos este wrapper externo para o efeito "Magma" extra forte) */
.mythic-wrapper {
    position: relative;
    padding: 3px;
    border-radius: 1.2rem;
    background: linear-gradient(135deg, #450a0a, #ff0000, #ffae00, #ff0000, #450a0a);
    background-size: 300% 300%;
    animation: shimmer-border 4s linear infinite;
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.5);
}

/* MODAL */
#achievement-modal.active {
    opacity: 1;
    pointer-events: auto;
}

#achievement-modal.active #achievement-card {
    transform: scale(1);
}

/* =========================================
   📚 BIBLIOTECA - EFEITOS NEON & GLASS
   ========================================= */

/* Sombra de Texto Suave (Usado no Autor) */
.text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Garante que o gradiente do botão brilhe */
a[href*="checkout"] {
    position: relative;
    overflow: hidden;
}

/* Efeito de "Scan" no botão de compra FW (Opcional - dá um toque muito premium) */
a[href*="checkout"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: 0.5s;
}

a[href*="checkout"]:hover::after {
    left: 100%;
    transition: 0.5s;
}

/* Ajuste fino para a borda neon dos livros */
article.group:hover {
    box-shadow: 0 0 30px -5px rgba(var(--fw-primary-rgb), 0.15);
    border-color: rgba(var(--fw-primary-rgb), 0.5);
}

/* Fallback para garantir que o ícone de fallback do livro fique centralizado */
img[style*="display: none"]+i {
    display: block !important;
}

/* --- ESTADO DESATIVADO (PENDENTE) --- */
.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    position: relative;
    /* Necessário para o tooltip */
}

.nav-item.disabled:hover {
    background-color: rgba(255, 255, 255, 0.05);
    /* Feedback visual leve */
    color: #64748b;
    /* Mantém cor cinza */
}

/* --- TOOLTIP CUSTOMIZADO --- */
.nav-item.disabled::after {
    content: "Verifique seu e-mail";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background-color: #ef4444;
    /* Vermelho alerta */
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Seta do Tooltip */
.nav-item.disabled::before {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    border-width: 5px;
    border-style: solid;
    border-color: transparent #ef4444 transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

.nav-item.disabled:hover::after,
.nav-item.disabled:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(15px);
    /* Pequeno movimento para direita */
}

.nav-item.disabled:hover::before {
    transform: translateY(-50%) translateX(5px);
}

/* Scrollbar Customizada */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Glass Effect */
.glass-effect {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animação de Conteúdo */
@keyframes contentFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-content {
    animation: contentFadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Animação da Chama */
@keyframes flame-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(249, 115, 22, 0.5));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.8));
    }
}

.flame-active {
    animation: flame-pulse 2s infinite ease-in-out;
}

/* --- BLOQUEIO VISUAL E TOOLTIP (Menu Lateral + Dropdown) --- */
.nav-item.disabled,
.dropdown-link.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    position: relative;
    /* Importante para o tooltip se posicionar */
}

/* Efeito Hover leve */
.nav-item.disabled:hover,
.dropdown-link.disabled:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #64748b;
}

/* --- O TOOLTIP --- */
.nav-item.disabled::after,
.dropdown-link.disabled::after {
    content: "Verifique seu e-mail";
    position: absolute;
    /* Posicionamento à direita do item */
    right: 100%;
    /* No dropdown fica melhor se aparecer à esquerda */
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background-color: #ef4444;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-right: 10px;
    /* Espaço extra */
}

/* Ajuste específico para o menu lateral (tooltip à direita) */
.nav-item.disabled::after {
    left: 100%;
    right: auto;
    margin-right: 0;
    margin-left: 10px;
    transform: translateY(-50%) translateX(0);
}

.nav-item.disabled:hover::after,
.dropdown-link.disabled:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Container de Notificações */
#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

/* Card do Toast */
.toast-card {
    position: relative;
    min-width: 320px;
    background: rgba(30, 41, 59, 0.95);
    /* slate-800 com glassmorphism */
    backdrop-blur: 8px;
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    overflow: hidden;
    /* Importante para a barra não vazar */
    animation: toast-slide-in 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* A Barra de Progresso */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform-origin: left;
}

/* Cores por Tipo */
.toast-success .toast-progress {
    background: #10b981;
}

/* emerald-500 */
.toast-error .toast-progress {
    background: #ef4444;
}

/* red-500 */

@keyframes toast-slide-in {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes progress-drain {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Otimização de GPU para reduzir repaints */
.animate-marquee {
    animation: marquee 35s linear infinite;
    will-change: transform;
    display: flex;
}

.animate-marquee:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.bg-grid-pattern {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* (Sidebar collapsed state moved to top of file) */

/* Floating Tooltip para Menu Lateral */
.sidebar-floating-tooltip {
    position: fixed;
    background-color: #1e293b;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-floating-tooltip.show {
    opacity: 1;
    transform: translateX(0);
}

/* (Nav item styles defined in earlier block) */

/* Dot Grid Background */
.bg-grid-dots {
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* --- PAGINATION (SPA Compatible) --- */
.paginator {
    @apply flex flex-wrap items-center justify-center gap-2 bg-[#0f172a] border border-slate-800 rounded-xl p-2;
}

.paginator li a,
.paginator li span {
    @apply px-4 py-2 text-sm rounded-lg transition-all duration-200;
}

.paginator li a {
    @apply text-slate-400 hover:bg-slate-800 hover:text-white focus:outline-none focus:ring-2 focus:ring-fw-primary;
}

.paginator li span.active {
    @apply bg-blue-600 border border-blue-500 text-white font-bold shadow-[0_0_10px_rgba(37, 99, 235, 0.3)];
}

/* Previne FOUC dos ícones */
[data-lucide] {
    visibility: hidden;
}

.lucide {
    visibility: visible;
}

/* Oculta scrollbar nativa mantendo a rolagem fluida por toque */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.bg-noise {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* =========================================
   MARKET CLOCK / QUANTITATIVE ENGINE STYLES
   ========================================= */

/* Hardware Acceleration */
.gpu-accel {
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* Premium Glows & Bloom */
.bloom-low { filter: drop-shadow(0 0 8px currentColor); }
.bloom-high { filter: drop-shadow(0 0 20px currentColor); }
.text-glow { text-shadow: 0 0 10px currentColor; }

/* Radar Effects */
.radar-sweep-bg {
    background: conic-gradient(from 0deg at 50% 50%,
            transparent 50%,
            rgba(59, 130, 246, 0.05) 75%,
            rgba(59, 130, 246, 0.4) 95%,
            rgba(96, 165, 250, 0.8) 100%);
    border-radius: 50%;
    filter: blur(2px);
}

/* Ticker Tape */
.ticker-container {
    overflow: hidden;
    white-space: nowrap;
    display: flex;
}

/* Boot Sequence */
#boot-screen { transition: opacity 0.8s ease-out, visibility 0.8s; }
.scanline {
    width: 100%;
    height: 100px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(59, 130, 246, 0.1) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.1;
    position: absolute;
    bottom: 100%;
    animation: scanline 8s linear infinite;
    pointer-events: none;
}
@keyframes scanline {
    0% { bottom: 100%; }
    100% { bottom: -100px; }
}

/* Glass Panels */
.glass-panel {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.glass-panel:hover {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================================
   QUANT ENGINE / SENTIMENT DASHBOARD
   ========================================= */

.glass-module {
    background: rgba(11, 17, 32, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(30, 41, 59, 0.7);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-module:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(59, 130, 246, 0.1);
}

.bg-orbital {
    background: radial-gradient(circle at center, rgba(59,130,246,0.15) 0%, transparent 60%);
}

@keyframes tickerMove {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: tickerMove 50s linear infinite;
}

.scanner-line {
    position: relative;
}

.scanner-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
}

.scanner-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    background: linear-gradient(180deg, transparent, rgba(59, 130, 246, 0.05), transparent);
    animation: scanner-y 5s linear infinite;
}

@keyframes scanner-y {
    from { transform: translateY(-100%); }
    to { transform: translateY(100%); }
}

@keyframes float-particle {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.2; }
    50% { transform: translateY(-20px) scale(1.5); opacity: 0.8; }
}

.particle {
    animation: float-particle 4s ease-in-out infinite;
}

/* ============================================
   STREAK SYSTEM — CSS
   ============================================ */

/* --- Perfect Week Glow Effect --- */
@keyframes streak-glow-pulse {
    0%, 100% {
        box-shadow: 0 0 8px rgba(249, 115, 22, 0.3),
                    0 0 20px rgba(249, 115, 22, 0.15),
                    inset 0 0 15px rgba(249, 115, 22, 0.05);
        border-color: rgba(249, 115, 22, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(249, 115, 22, 0.5),
                    0 0 40px rgba(249, 115, 22, 0.25),
                    0 0 60px rgba(234, 179, 8, 0.1),
                    inset 0 0 20px rgba(249, 115, 22, 0.08);
        border-color: rgba(249, 115, 22, 0.7);
    }
}

@keyframes streak-fire-flicker {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-3deg); }
    50% { transform: scale(1.15) rotate(2deg); }
    75% { transform: scale(1.05) rotate(-1deg); }
}

.streak-perfect-week {
    animation: streak-glow-pulse 2.5s ease-in-out infinite;
}

.streak-fire-icon {
    animation: streak-fire-flicker 1.5s ease-in-out infinite;
}

/* --- Streak Trigger Button — Perfect Week Mode --- */
.streak-trigger-perfect {
    animation: streak-glow-pulse 2.5s ease-in-out infinite;
    background: rgba(249, 115, 22, 0.15) !important;
    border-color: rgba(249, 115, 22, 0.5) !important;
}

/* --- Streak Dropdown --- */
#streak-dropdown {
    backdrop-filter: blur(20px);
}

#streak-dropdown::before,
#notification-menu::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
}

#streak-dropdown.active,
#notification-menu.active {
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
}



/* --- Streak Calendar Modal --- */
.streak-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.streak-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.streak-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 99991;
    width: 95%;
    max-width: 520px;
    max-height: 90vh;
    background: #0b1120;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.6),
                0 0 30px rgba(249, 115, 22, 0.05);
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.streak-modal.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* Calendar Grid */
.streak-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.streak-calendar-header {
    text-align: center;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    padding: 6px 0;
}

.streak-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    position: relative;
    transition: all 0.2s ease;
}

.streak-calendar-day.empty {
    visibility: hidden;
}

.streak-calendar-day.has-checkin {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.25);
}

.streak-calendar-day.is-today {
    border: 2px solid #3b82f6;
    color: #3b82f6;
    font-weight: 900;
}

.streak-calendar-day.is-today.has-checkin {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(59, 130, 246, 0.15));
    border-color: #f97316;
    color: #f97316;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.streak-calendar-day.future {
    opacity: 0.3;
}

/* Month transition */
@keyframes streak-month-slide-in {
    from {
        opacity: 0;
        transform: translateX(var(--slide-direction, 20px));
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


.streak-month-transition {
    animation: streak-month-slide-in 0.3s ease-out forwards;
}

/* Spinner Animation & Styles */
@keyframes streak-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.streak-spinner {
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid rgba(249, 115, 22, 0.2);
    border-top-color: #f97316;
    border-radius: 50%;
    animation: streak-spin 0.8s linear infinite;
}

/* Loading Overlay for Streak Calendar */
.streak-calendar-loader {
    position: absolute;
    inset: 0;
    background: rgba(11, 17, 32, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 20;
    border-radius: 0.5rem;
}

.streak-calendar-loader.active {
    opacity: 1;
    pointer-events: auto;
}

/* Today Check-in Dot Pulse */
@keyframes streak-pulse-blue {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 5px rgba(59, 130, 246, 0);
    }
}

.streak-dot-today {
    animation: streak-pulse-blue 2s infinite;
}

/* Stat Cards */

.streak-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    padding: 10px 12px;
    transition: all 0.2s ease;
}

.streak-stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Scrollbar for modal content */
.streak-modal-body {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.streak-modal-body::-webkit-scrollbar {
    width: 4px;
}

.streak-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.streak-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Checkin dot pulse for today */
@keyframes checkin-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(249, 115, 22, 0); }
}

.streak-dot-today {
    animation: checkin-dot-pulse 2s ease-in-out infinite;
}


/* ============================================ */
/* TIERED CONTENT ACCESS (PREMIUM GATES)      */
/* ============================================ */

/* Base container for restricted content */
.premium-locked {
    position: relative;
    transition: all 0.3s ease;
}

/* 1. Preview Mode: Blur + Gradient Fade */
.premium-preview {
    position: relative;
    overflow: hidden;
    user-select: none;
    pointer-events: none; /* Disable interaction with elements inside */
}

/* We need pointer-events: auto on the container so we can click it for the hint */
.premium-locked.premium-preview {
    pointer-events: auto;
    cursor: pointer;
}

.premium-preview > * {
    filter: blur(4px);
    transition: filter 0.3s ease;
}

.premium-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    background: linear-gradient(
        to bottom,
        rgba(15,23,42,0) 0%,
        rgba(15,23,42,0.85) 100%
    );
    pointer-events: none;
}

/* 2. Disabled Mode: Low opacity, no interaction */
.premium-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(30%);
}

.premium-locked.premium-disabled {
    pointer-events: auto;
    cursor: pointer;
}

/* 3. Readonly Mode: Visual only, but no advanced interactions */
/* The JS will intercept clicks but it doesn't have a visual mask initially */
.premium-readonly {
    /* Style depends on specific element, usually just pointer interception */
}
.premium-locked.premium-readonly {
    cursor: pointer;
}

/* Animations */
@keyframes shake-upgrade {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.animate-shake-upgrade {
    animation: shake-upgrade 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

.premium-glow-hover {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15); /* Gold tint */
    border-color: rgba(212, 175, 55, 0.3) !important;
}

/* Premium Hint Box */
.premium-hint-box {
    position: absolute;
    z-index: 9999;
    background: #0b1120;
    border: 1px solid rgba(212, 175, 55, 0.3); /* Default Gold border */
    border-radius: 0.75rem;
    padding: 1rem;
    width: 280px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.1);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.premium-hint-box.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.premium-hint-box .hint-tier {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.premium-hint-box .hint-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.premium-hint-box .hint-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.premium-hint-box .hint-benefits li {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}

.premium-hint-box .hint-benefits li::before {
    content: "✓";
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
}

.premium-hint-box .hint-action {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

/* Tier specific colors for hint box */
.premium-hint-box[data-tier="3"] { /* GOLD */
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.1);
}
.premium-hint-box[data-tier="3"] .hint-tier { background: rgba(212, 175, 55, 0.1); color: #D4AF37; }
.premium-hint-box[data-tier="3"] .hint-action { background: rgba(212, 175, 55, 0.15); color: #D4AF37; border: 1px solid rgba(212, 175, 55, 0.2); }
.premium-hint-box[data-tier="3"] .hint-action:hover { background: rgba(212, 175, 55, 0.25); }

.premium-hint-box[data-tier="2"] { /* SILVER */
    border-color: rgba(174, 182, 191, 0.3);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(174, 182, 191, 0.05);
}
.premium-hint-box[data-tier="2"] .hint-tier { background: rgba(174, 182, 191, 0.1); color: #AEB6BF; }
.premium-hint-box[data-tier="2"] .hint-action { background: rgba(174, 182, 191, 0.15); color: #AEB6BF; border: 1px solid rgba(174, 182, 191, 0.2); }
.premium-hint-box[data-tier="2"] .hint-action:hover { background: rgba(174, 182, 191, 0.25); }

.premium-hint-box[data-tier="1"] { /* BRONZE */
    border-color: rgba(205, 127, 50, 0.3);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(205, 127, 50, 0.1);
}
.premium-hint-box[data-tier="1"] .hint-tier { background: rgba(205, 127, 50, 0.1); color: #CD7F32; }
.premium-hint-box[data-tier="1"] .hint-action { background: rgba(205, 127, 50, 0.15); color: #CD7F32; border: 1px solid rgba(205, 127, 50, 0.2); }
.premium-hint-box[data-tier="1"] .hint-action:hover { background: rgba(205, 127, 50, 0.25); }


/* ============================================================
   SMART TOOLTIP
   ============================================================ */
.fw-smart-tooltip {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.95) translateY(5px);
    background: #0f172a; /* bg-slate-900 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0; /* text-slate-200 */
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    max-width: 280px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    text-align: center;
    line-height: 1.4;
    white-space: normal;
    font-family: inherit;
}
.fw-smart-tooltip.fw-tooltip-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}
/* Base Arrow */
.fw-smart-tooltip::after {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: 5px;
}
/* Positions */
.fw-smart-tooltip[data-pos="top"] { transform: scale(0.95) translateY(5px); }
.fw-smart-tooltip[data-pos="top"].fw-tooltip-visible { transform: scale(1) translateY(0); }
.fw-smart-tooltip[data-pos="top"]::after {
    top: 100%; left: 50%; transform: translateX(-50%);
    border-color: #0f172a transparent transparent transparent;
}

.fw-smart-tooltip[data-pos="bottom"] { transform: scale(0.95) translateY(-5px); }
.fw-smart-tooltip[data-pos="bottom"].fw-tooltip-visible { transform: scale(1) translateY(0); }
.fw-smart-tooltip[data-pos="bottom"]::after {
    bottom: 100%; left: 50%; transform: translateX(-50%);
    border-color: transparent transparent #0f172a transparent;
}

.fw-smart-tooltip[data-pos="left"] { transform: scale(0.95) translateX(5px); }
.fw-smart-tooltip[data-pos="left"].fw-tooltip-visible { transform: scale(1) translateX(0); }
.fw-smart-tooltip[data-pos="left"]::after {
    top: 50%; left: 100%; transform: translateY(-50%);
    border-color: transparent transparent transparent #0f172a;
}

.fw-smart-tooltip[data-pos="right"] { transform: scale(0.95) translateX(-5px); }
.fw-smart-tooltip[data-pos="right"].fw-tooltip-visible { transform: scale(1) translateX(0); }
.fw-smart-tooltip[data-pos="right"]::after {
    top: 50%; right: 100%; transform: translateY(-50%);
    border-color: transparent #0f172a transparent transparent;
}

/* ============================================================
   DASHBOARD MAIN SHELL STYLES
   ============================================================ */
/* Acessibilidade: Foco visível para navegação via teclado */
:focus-visible {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px;
}

/* Logo Glow Effect */
@keyframes logoBorderGlow {
    0%, 100% {
        box-shadow: 0 0 6px rgba(59, 130, 246, 0.4), inset 0 0 4px rgba(59, 130, 246, 0.2);
        border-color: rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 14px rgba(6, 182, 212, 0.7), 0 0 20px rgba(59, 130, 246, 0.3), inset 0 0 6px rgba(6, 182, 212, 0.4);
        border-color: rgba(6, 182, 212, 0.8);
    }
}

.logo-glow-badge {
    border: 1.5px solid rgba(59, 130, 246, 0.4);
    animation: logoBorderGlow 3s infinite ease-in-out;
    background-color: #0b1329;
}

