/* Grundfärger */
:root {
    --bg-color: #000000;
    --old-white: #F5F5DC;
    --dim: rgba(245, 245, 220, 0.15);
}

/* Dynamisk Puls för Nuclear Mode */
@keyframes dynamic-pulse {
    0% { transform: scale(var(--base-scale, 1)); box-shadow: 0 0 5px rgba(255, 0, 0, 0.5); }
    50% { transform: scale(var(--max-scale, 1.1)); box-shadow: 0 0 20px rgba(255, 0, 0, 0.8); }
    100% { transform: scale(var(--base-scale, 1)); box-shadow: 0 0 5px rgba(255, 0, 0, 0.5); }
}

.active-pulse {
    animation: dynamic-pulse var(--pulse-speed, 1s) infinite ease-in-out;
    background-color: #ff0000 !important;
    z-index: 100;
}

/* Tooltips & Hovring */
.chart-tooltip, .scale-tooltip {
    visibility: hidden; 
    opacity: 0; 
    position: absolute; 
    bottom: 60px; 
    left: 0;
    background: rgba(5, 5, 5, 0.95); 
    border: 1px solid rgba(245, 245, 220, 0.25);
    padding: 25px; 
    border-radius: 12px; 
    z-index: 1000; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}

/* Grafens behållare */
.chart-tooltip {
    width: 60vw;
    height: 45vh;
    padding: 40px 40px 60px 80px !important;
}

.scale-tooltip { 
    width: 320px; 
    padding: 20px;
}

#btn-stats:hover .chart-tooltip { visibility: visible; opacity: 1; transform: translateY(-10px); }
#btn-scale:hover .scale-tooltip { visibility: visible; opacity: 1; transform: translateY(-10px); }

/* Y-axeln och siffror */
.tick {
    position: absolute;
    right: 10px;
    font-size: 0.7rem;
    color: var(--old-white);
    font-weight: bold;
    opacity: 0.6;
    z-index: 10;
}

.grid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(245, 245, 220, 0.05);
    z-index: 1;
}

/* Den svarta boxen som följer muspekaren */
.chart-hover-box {
    position: fixed;
    padding: 10px 14px;
    background: var(--old-white);
    color: #000;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 800;
    pointer-events: none;
    display: none;
    z-index: 2500;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
    white-space: nowrap;
    border-left: 5px solid #000;
}

/* Skal-info (€) */
.scale-grid { 
    display: grid; 
    grid-template-columns: 20px 1fr 80px; 
    gap: 12px; 
    font-size: 0.85rem; 
    align-items: center; 
}

.color-box { 
    width: 16px; 
    height: 16px; 
    border-radius: 3px; 
    border: 1px solid rgba(255,255,255,0.1);
}

.scale-footer {
    margin-top: 15px; 
    padding-top: 12px;
    border-top: 1px solid var(--dim);
    font-size: 0.9rem; 
    font-weight: 800;
    color: #ff4444; 
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 1px;
}

/* Behållaren för staplarna */
#bars-content { 
    display: flex; 
    align-items: flex-end; 
    width: 100%; 
    height: 100%; 
    gap: 1.5px; /* <--- Här ställer du in det lilla mellanrummet */
    position: relative; 
}

.bar {
    flex: 1;
    border-radius: 1px 1px 0 0;
    z-index: 5;
    cursor: crosshair;
    /* Behåll din transition - den är perfekt! */
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.8s ease;
    position: relative;
    min-width: 2px;
    
    /* Lägg till denna för att säkerställa att gradienten syns bäst */
    background-size: cover; 
    background-color: transparent; 
}
/* Subtil vertikal toning för att ge staplarna lite liv utan att bryta gradienten */
.bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.2) 0%, transparent 100%);
    pointer-events: none;
}

.y-axis { 
    position: absolute; 
    left: 0; 
    top: 40px; 
    bottom: 60px; 
    width: 70px; 
    border-right: 1px solid var(--dim); 
}

/* X-axeln */
.x-axis {
    position: absolute;
    left: 80px;
    right: 30px;
    bottom: 15px;
    height: 35px;
    border-top: 1px solid var(--dim);
    z-index: 20;
}

.x-tick {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--old-white);
    padding-top: 10px;
    font-weight: bold;
    opacity: 0.7;
}

.x-mark {
    position: absolute;
    top: 0;
    width: 1px;
    height: 6px;
    background: var(--old-white);
    opacity: 0.3;
}
