/* ==========================================
   VARIÁVEIS (mesma pegada do site principal)
   ========================================== */
:root {
    --color-bg: #0a0e27;
    --color-bg-light: #12183a;
    --color-primary: #00ff88;
    --color-accent: #ff006e;
    --color-text: #e8eaf0;
    --color-text-dim: #8892b0;
    --color-card: #1a2040;
    --color-border: rgba(0, 255, 136, 0.15);
    --font-display: 'Syne', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ==========================================
   RESET E BASE
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-mono);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================
   BACKGROUND GRID ANIMADO
   ========================================== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.04;
    background:
        linear-gradient(90deg, var(--color-primary) 1px, transparent 1px),
        linear-gradient(0deg, var(--color-primary) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ==========================================
   CONTAINER
   ========================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* ==========================================
   HEADER
   ========================================== */
header {
    margin-bottom: 2.5rem;
}

header h1 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--color-text-dim);
    font-size: 0.95rem;
    max-width: 640px;
}

/* ==========================================
   AVISO FALLBACK
   ========================================== */
#aviso-fallback {
    display: none;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1.2rem;
    background: rgba(255, 0, 110, 0.08);
    border: 1px solid rgba(255, 0, 110, 0.35);
    border-radius: 10px;
    color: #ff8fb8;
    font-size: 0.85rem;
}

#aviso-fallback:not(.hidden) {
    display: block;
}

/* ==========================================
   CARD DA TABELA
   ========================================== */
.table-wrapper {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.overflow-x-auto {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

thead tr {
    background: rgba(0, 0, 0, 0.35);
}

th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-dim);
    border-bottom: 1px solid var(--color-border);
}

td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(136, 146, 176, 0.08);
    color: var(--color-text);
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: rgba(0, 255, 136, 0.04);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Nome da moeda */
td:first-child {
    font-weight: 700;
    color: var(--color-text);
}

/* Valor em tempo real (verde quando ok) */
.text-green-600,
td.font-semibold {
    color: var(--color-primary) !important;
    font-weight: 600;
}

/* Valor inválido / fallback */
.text-gray-400 {
    color: var(--color-text-dim) !important;
}

/* ==========================================
   FOOTER / STATUS
   ========================================== */
footer {
    margin-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--color-text-dim);
}

#status-atualizacao {
    font-weight: 500;
}

#status-atualizacao.text-green-600 {
    color: var(--color-primary) !important;
}

#status-atualizacao.text-yellow-600 {
    color: #ffc857 !important;
}

#status-atualizacao.text-red-500 {
    color: var(--color-accent) !important;
}

#status-atualizacao.text-gray-500 {
    color: var(--color-text-dim) !important;
}

/* ==========================================
   ESTADO DE CARREGAMENTO
   ========================================== */
#tabela-cambio td[colspan] {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-dim);
}

/* ==========================================
   RESPONSIVO
   ========================================== */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header p {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.85rem 1rem;
        font-size: 0.8rem;
    }
}

/* ==========================================
   VARIAÇÃO %
   ========================================== */
.valor-ok {
    color: var(--color-primary) !important;
    font-weight: 600;
}

.valor-fallback {
    color: var(--color-text-dim) !important;
}

.variacao-alta {
    color: var(--color-primary);
    font-weight: 600;
}

.variacao-baixa {
    color: var(--color-accent);
    font-weight: 600;
}

.variacao-neutra {
    color: var(--color-text-dim);
}