/* graphs.css
 *
 * Styles für Diagramm- / Graph-Layouts auf der Overview-Seite.
 * Baut auf dem bestehenden Dark-Theme / Card-Design auf.
 */

/* === Layout-Grid für Graph-Bereiche === */

.graphs-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 960px) {
    .graphs-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* === Graph Cards === */

.graph-card {
    position: relative;
    padding: 1.25rem 1.4rem;
    border-radius: 1rem;
    background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 60%),
                radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.12), transparent 60%),
                rgba(17, 24, 39, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.75),
        0 0 0 1px rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.graph-card.compact {
    padding: 1.0rem 1.1rem;
}

/* === Header im Graph-Card === */

.graph-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
}

.graph-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.9);
}

.graph-subtitle {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.9);
}

.graph-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: rgba(226, 232, 240, 0.9);
    background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.25), transparent 55%),
                rgba(15, 23, 42, 0.9);
    white-space: nowrap;
}

/* === Body-Bereich === */

.graph-body {
    margin-top: 0.25rem;
}

/* === Horizontal-Bar-Chart (Vergleichswerte) === */

.bar-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin: 0.35rem 0;
}

.bar-label {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.95);
    white-space: nowrap;
}

.bar-track {
    position: relative;
    width: 100%;
    height: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        rgba(15, 23, 42, 0.85),
        rgba(30, 64, 175, 0.75)
    );
    overflow: hidden;
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.8),
        0 0 0 1px rgba(30, 64, 175, 0.35);
}

.bar-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        rgba(96, 165, 250, 1),
        rgba(129, 140, 248, 1),
        rgba(236, 72, 153, 1)
    );
    box-shadow:
        0 0 12px rgba(59, 130, 246, 0.7),
        0 0 24px rgba(236, 72, 153, 0.6);
    transform-origin: left center;
    transition: width 420ms ease-out;
}

.bar-fill.alt {
    background: linear-gradient(
        90deg,
        rgba(52, 211, 153, 1),
        rgba(34, 197, 94, 1),
        rgba(129, 230, 217, 1)
    );
    box-shadow:
        0 0 12px rgba(45, 212, 191, 0.7),
        0 0 24px rgba(34, 197, 94, 0.6);
}

.bar-fill.danger {
    background: linear-gradient(
        90deg,
        rgba(248, 113, 113, 1),
        rgba(239, 68, 68, 1),
        rgba(248, 113, 113, 1)
    );
    box-shadow:
        0 0 12px rgba(248, 113, 113, 0.75),
        0 0 24px rgba(248, 113, 113, 0.6);
}

.bar-value {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    color: rgba(226, 232, 240, 0.95);
    white-space: nowrap;
}

/* === Kleine Helper für "Legenden" / Meta-Infos === */

.graph-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    margin-top: 0.65rem;
}

.graph-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.95);
}

.graph-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #60a5fa, #a855f7);
}

/* === Placeholder / Empty State === */

.graph-empty {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.8);
    padding: 0.5rem 0;
}

/* === Optional: smoother Hover auf Graph Cards === */

.graph-card:hover {
    border-color: rgba(248, 250, 252, 0.16);
    box-shadow:
        0 22px 55px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(30, 64, 175, 0.55);
    transform: translateY(-1px);
    transition:
        box-shadow 160ms ease-out,
        border-color 160ms ease-out,
        transform 160ms ease-out;
}

.graph-card {
    transition:
        box-shadow 160ms ease-out,
        border-color 160ms ease-out,
        transform 160ms ease-out;
}






/* ECONOMY LINE CHART */

.line-chart {
    position: relative;
    width: 100%;
    height: 260px;
}

.chart-placeholder > .line-chart {
    flex: 1 1 auto;
}

.line-chart-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Gitternetz / Achsen */

.line-chart-grid-line {
    stroke: rgba(148, 163, 184, 0.18);
    stroke-width: 1;
}

.line-chart-axis {
    stroke: rgba(148, 163, 184, 0.4);
    stroke-width: 1.2;
}

.line-chart-y-label,
.line-chart-x-label {
    fill: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-main);
}

/* Linie & Punkte */

.line-chart-path {
    fill: none;
    stroke: var(--accent-strong);
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.45));
}

.line-chart-point {
    fill: var(--accent-strong);
    stroke: rgba(15, 23, 42, 0.95);
    stroke-width: 1.6;
}

/* Optional: dezente Fläche unter der Linie */

.line-chart-area {
    fill: url(#econAreaGradient);
    opacity: 0.35;
}

/* Tooltip-Layer vorbereiten (falls du später Lust hast) */

.line-chart-tooltip-layer {
    pointer-events: none;
}

.line-chart {
    user-select: none;
}


/* Economy-Chart Layout */
.chart-shell {
    position: relative;
    width: 100%;
    height: 320px;           /* Höhe der Box, kannst du anpassen */
    margin-top: 8px;
}

#economy-chart {
    width: 100%;
    height: 100%;
    display: block;
}

/* Tooltip für den Hover über einem Punkt */
.chart-tooltip {
    position: absolute;
    min-width: 130px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(139, 92, 246, 0.7);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
    font-size: 0.75rem;
    pointer-events: none;
    transform: translate(-50%, -110%);
    z-index: 5;
}

.chart-tooltip span {
    display: block;
}

.chart-tooltip .tooltip-date {
    color: #9ca3af;
    margin-bottom: 2px;
}

.chart-tooltip .tooltip-value {
    font-weight: 600;
}

.economy-chart-wrapper {
    position: relative;
}



