/* ============================================================
   Exit Plan 2037 — Financial Dashboard Styles (Glassmorphism)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #06090e;
    --bg-overlay: rgba(10, 15, 25, 0.5);
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-hover: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-dim: #475569;
    --text-footer: #334155;

    /* Neon Accents */
    --accent: #00e1ff;
    --accent-glow: rgba(0, 225, 255, 0.3);
    --green: #10b981;
    --red: #f43f5e;

    /* Asset Colors */
    --icon-property: #10b981;
    --icon-kiwisaver: #3b82f6;
    --icon-stocks: #8b5cf6;
    --icon-crypto: #f59e0b;
    --icon-cash: #06b6d4;
    --icon-mortgage: #f43f5e;

    /* Buttons */
    --btn-bg: rgba(0, 225, 255, 0.1);
    --btn-border: rgba(0, 225, 255, 0.3);
    --btn-hover: rgba(0, 225, 255, 0.25);

    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Dynamic Animated Background Blobs */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    animation: drift 25s infinite alternate ease-in-out;
}

body::before {
    background: rgba(0, 225, 255, 0.07);
    top: -10%;
    left: -10%;
}

body::after {
    background: rgba(139, 92, 246, 0.07);
    bottom: -10%;
    right: -10%;
    animation-delay: -12s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(150px, 150px) scale(1.2);
    }
}

/* ---- Header ---- */
.header {
    background: rgba(10, 15, 25, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 24px 40px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.header .subtitle {
    color: var(--accent);
    font-size: 14px;
    font-weight: 500;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

.countdown {
    text-align: right;
}

.countdown .years {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px var(--accent-glow);
}

.countdown .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-top: 4px;
}

.countdown .days-sub {
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 4px;
}

/* ---- Status Bar ---- */
.status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 40px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.status-bar .status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.live {
    background: var(--green);
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px var(--green);
}

.status-dot.stale {
    background: #f59e0b;
}

.status-dot.error {
    background: var(--red);
}

.status-dot.manual {
    background: var(--text-muted);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ---- Dashboard Container ---- */
.dashboard {
    padding: 32px 40px;
    max-width: 1500px;
    margin: 0 auto;
}

/* ---- Metric Cards ---- */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.metric-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 225, 255, 0.05);
}

.metric-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
    font-weight: 600;
}

.metric-card .value {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.metric-card .change {
    font-size: 13px;
    margin-top: 10px;
    font-weight: 500;
}

.metric-card .change.positive {
    color: var(--green);
}

.metric-card .change.negative {
    color: var(--red);
}

.metric-card .change.neutral {
    color: var(--text-muted);
}

/* ---- Chart Cards ---- */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 28px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.chart-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.chart-card h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

/* ---- Tables ---- */
.table-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 28px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-soft);
    overflow-x: auto;
}

.table-card h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 24px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    text-align: left;
    padding: 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    transition: background 0.2s;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: #fff;
}

/* ---- Asset icons ---- */
.asset-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #fff;
}

.asset-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-property {
    color: var(--icon-property);
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.icon-kiwisaver {
    color: var(--icon-kiwisaver);
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.1);
}

.icon-stocks {
    color: var(--icon-stocks);
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
}

.icon-crypto {
    color: var(--icon-crypto);
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.1);
}

.icon-cash {
    color: var(--icon-cash);
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.1);
}

.icon-mortgage {
    color: var(--icon-mortgage);
    border-color: rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.1);
}

/* ---- Progress bars ---- */
.progress-bar-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    height: 6px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 8px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #3b82f6, var(--accent));
}

/* ---- Error banner ---- */
.error-banner {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: var(--border-radius);
    padding: 16px 24px;
    margin-bottom: 24px;
    color: #fda4af;
    font-size: 14px;
    display: none;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.1);
}

.error-banner.visible {
    display: block;
}

/* ---- Buttons ---- */
.update-btn {
    background: var(--btn-bg);
    color: var(--accent);
    border: 1px solid var(--btn-border);
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.update-btn:hover {
    background: var(--btn-hover);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-1px);
}

.update-btn:active {
    transform: translateY(1px);
}

/* ---- Footer ---- */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-footer);
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    margin-top: 40px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .countdown {
        text-align: center;
        margin-top: 16px;
    }

    .dashboard {
        padding: 20px;
    }

    .status-bar {
        padding: 12px 20px;
        justify-content: center;
    }
}