* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex; justify-content: center; align-items: center;
    height: 100dvh; width: 100vw; overflow: hidden;
    margin: 0; padding: 0;
}

.dashboard {
    width: 100%; max-width: 100%;
    padding: 12px 16px;
    display: flex; flex-direction: column;
    height: 100%;
}

/* NAGŁÓWEK I KARTY STATYSTYK */
.glass-header {
    display: flex; justify-content: center; align-items: center;
    margin-bottom: 10px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-grid { display: flex; gap: 10px; width: 100%; justify-content: center; }

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 12px;
    display: flex; flex-direction: column; 
    flex: 0 1 200px; min-width: 140px; max-width: 220px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s ease;
    align-items: center; 
    justify-content: center;
}

/* Dedykowany styl dla klikalnego kafelka TradingView */
.tv-card {
    text-decoration: none !important;
    cursor: pointer !important;
    border-bottom: 2px solid #2962FF !important;
}

.tv-card:hover {
    background: rgba(41, 98, 255, 0.12) !important;
    border-color: rgba(41, 98, 255, 0.4) !important;
}

.tv-card .stat-label {
    color: #2962FF !important;
}

.tv-card .stat-value {
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

.stat-label { font-size: 10px; color: #8e8e93; font-weight: 600; letter-spacing: 0.05em; margin-bottom: 3px; text-align: center; text-transform: uppercase; }
.stat-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; color: #ffffff; }

.loading-state { flex-grow: 1; display: flex; justify-content: center; align-items: center; color: #8e8e93; font-size: 13px; font-weight: 500; }
footer { text-align: center; font-size: 11px; color: #48484a; padding-top: 8px; }

/* PASEK PRZYCISKÓW */
.timeframe-selector {
    display: flex; gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px; border-radius: 6px; width: fit-content;
    margin: 0 auto 8px auto; 
    position: relative; z-index: 10;
    align-items: center;
}

.tf-btn {
    background: transparent; border: none; color: #8e8e93;
    font-size: 11px; font-weight: 500; padding: 4px 10px;
    border-radius: 4px; cursor: pointer; transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
}

.tf-btn:hover { color: #ffffff; }
.tf-btn.active {
    background: rgba(255, 255, 255, 0.15); color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#chart-wrapper { flex-grow: 1; width: 100%; height: 100%; display: flex; flex-direction: column; position: relative; }

#chart-main { 
    flex-grow: 1; 
    width: 100%;
    min-height: 0; 
    transition: opacity 0.25s ease-in-out; 
}

.apexcharts-tooltip {
    background: rgba(20, 20, 22, 0.85) !important;
    backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important; border-radius: 6px !important;
    color: #ffffff !important; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
}

.apexcharts-tooltip-title {
    background: transparent !important; border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-weight: 600 !important; font-size: 11px !important; padding: 6px 10px !important;
}
.apexcharts-annotations text { font-family: 'Inter', sans-serif !important; }

#chart-main .apexcharts-grid,
#chart-main .apexcharts-yaxis,
#chart-main .apexcharts-xaxis {
    transition: opacity 0.4s ease-in-out !important;
}

#chart-main:hover .apexcharts-grid,
#chart-main:hover .apexcharts-yaxis,
#chart-main:hover .apexcharts-xaxis {
    opacity: 0.2 !important;
}

/* REAKSYWNOŚĆ MOBILNA */
@media (max-width: 768px) {
    .dashboard { padding: 8px 4px !important; }
    
    .glass-header {
        margin-bottom: 8px !important;
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }

    .stats-grid { 
        flex-direction: row; 
        overflow: hidden; 
        gap: 4px !important; 
        padding-bottom: 4px; 
        width: 100% !important;
    }

    .stat-card { 
        flex: 1 1 0 !important; 
        min-width: 0 !important; 
        max-width: none !important;
        padding: 6px 4px !important; 
        border-radius: 6px !important;
    }

    .tv-card .stat-value {
        font-size: 11px !important;
    }

    .timeframe-selector {
        transform: translateX(-50%) !important;
        top: 0px !important;
        width: 94% !important; 
        max-width: 400px;
        justify-content: space-between;
    }
    
    .tf-btn {
        flex: 1; 
        padding: 3px 8px !important;
        font-size: 10px !important;
        margin: 0 1px;
    }

    footer {
        padding-bottom: 8px;
        font-size: 9px !important; 
    }
}

@keyframes smoothReveal { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
.stat-card { opacity: 0; animation: smoothReveal 0.4s ease forwards; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }