:root {
    --bg-color: #0d0d12;
    --card-bg: #1a1a24;
    --accent-color: #00ff88;
    --accent-secondary: #7000ff;
    --text-primary: #ffffff;
    --text-secondary: #a0a0aa;
    --font-main: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    margin: 0;
    padding: 20px;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(112, 0, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 255, 136, 0.05) 0%, transparent 40%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* HEADER */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2rem;
    margin: 0;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    margin: 5px 0 0 0;
    font-size: 0.9rem;
}

.btn-refresh {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* KPI GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.kpi-card .value {
    font-size: 2.5rem;
    font-weight: 700;
}

.value.highlight {
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* CHARTS */
.chart-container {
    margin-bottom: 30px;
    padding: 20px;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-box {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 10px;
    height: 300px;
}

.chart-box.full-width {
    grid-column: span 2;
    height: 350px;
}

.chart-box h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* INPUT SECTION */
.input-section {
    margin-bottom: 30px;
    text-align: center;
}

textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    padding: 15px;
    margin: 15px 0;
    font-family: inherit;
    resize: vertical;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent-color), #00cc6a);
    color: #0d0d12;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.hidden {
    display: none;
}

/* SPINNER */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* KPI CARDS THEMES */
.kpi-card.gold {
    border-top: 4px solid #ffd700;
}

.kpi-card.gold .value {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.kpi-card.neon {
    border-top: 4px solid #00ff88;
}

.kpi-card.neon .value {
    color: #00ff88;
}

.kpi-card.purple {
    border-top: 4px solid #b388ff;
}

.kpi-card.purple .value {
    color: #b388ff;
    text-shadow: 0 0 15px rgba(179, 136, 255, 0.3);
}

/* UNICORN GALLERY */
.gallery-section h2 {
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.unicorn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.unicorn-card {
    background: linear-gradient(145deg, #1e1e2a, #16161f);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
}

.unicorn-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(112, 0, 255, 0.2);
    border-color: rgba(112, 0, 255, 0.3);
}

.unicorn-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-secondary));
}

.unicorn-card .multiplier {
    display: inline-block;
    background: rgba(112, 0, 255, 0.2);
    color: #b388ff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.unicorn-card h4 {
    margin: 10px 0;
    font-size: 1rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.unicorn-card .stats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.unicorn-card .btn-link {
    display: block;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

/* PRINT / PDF EXPORT - SOLARIZED LIGHT (Flat Claro) */
@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }

    body {
        margin: 0;
        padding: 0;
        background-color: #fdf6e3 !important;
        /* Solarized Base3 */
        color: #657b83 !important;
        /* Solarized Base00 */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        zoom: 0.85;
    }

    /* Hide Controls */
    .input-section,
    .btn-secondary,
    button,
    .status-indicator,
    .btn-refresh {
        display: none !important;
    }

    /* Minimalist Header */
    header {
        display: flex !important;
        border-bottom: 2px solid #b58900 !important;
        /* Solarized Yellow */
        margin-bottom: 20px;
    }

    header h1 {
        color: #b58900 !important;
        -webkit-text-fill-color: #b58900 !important;
        background: none !important;
    }

    header p {
        color: #93a1a1 !important;
        /* Solarized Base1 */
    }

    #dashboard {
        display: block !important;
    }

    .container {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Solarized Cards (Flat) */
    .card {
        background-color: #ffffff !important;
        border: 1px solid #eee8d5 !important;
        /* Base2 */
        box-shadow: none !important;
        margin-bottom: 15px;
        page-break-inside: avoid;
        color: #657b83 !important;
    }

    h2,
    h3 {
        color: #586e75 !important;
        /* Base01 */
    }

    .value {
        color: #0d0d12 !important;
        /* High contrast for numbers */
        text-shadow: none !important;
    }

    /* KPI Cards - Simplified borders */
    .kpi-card {
        border-top-width: 4px !important;
        background-color: #fcfbf9 !important;
    }

    /* PRO-MOVE: Invert Dark Charts to Light Charts via CSS */
    canvas {
        filter: invert(1) hue-rotate(180deg);
    }

    /* Grid Restoration */
    .charts-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }

    .chart-box {
        height: 300px !important;
        background-color: transparent !important;
        border: 1px solid #eee8d5;
        page-break-inside: avoid;
    }

    .chart-box.full-width {
        grid-column: span 2;
        page-break-before: auto;
    }

    /* Tables - Clean & Flat */
    table {
        font-size: 11px;
        color: #657b83 !important;
    }

    th {
        color: #586e75 !important;
        border-bottom: 2px solid #93a1a1 !important;
        background-color: #eee8d5 !important;
    }

    td {
        border-bottom: 1px solid #eee8d5 !important;
    }

    tr:hover {
        background-color: transparent !important;
    }

    /* Links - Solarized Cyan */
    a {
        text-decoration: none !important;
        color: #2aa198 !important;
        font-weight: bold;
    }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    text-align: left;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.perf-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
}

.perf-high {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.perf-mid {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.perf-low {
    background: rgba(255, 50, 50, 0.1);
    color: #ff5555;
}