/* Power Curtailment - AG Grid + KPI + auto-refresh styles */

/* ---------- Area grids ---------- */
/* The shared ag-grid-module template hardcodes style="height: 75vh" on its inner
   <div id="agGrid_*">, so we force the wrapper chain to 100% height and cap the
   outer container (same pattern as eaf-electrodes-summary). */
#grid-area-1,
#grid-area-2,
#grid-area-3,
#grid-area-4,
#grid-area-5 {
    height: 36vh;
    border: 1px solid #ccc;
    overflow: hidden;
}

#grid-area-1 > .ag-grid-module,
#grid-area-2 > .ag-grid-module,
#grid-area-3 > .ag-grid-module,
#grid-area-4 > .ag-grid-module,
#grid-area-5 > .ag-grid-module {
    height: 100%;
    width: 100%;
    display: block;
}

#grid-area-1 .ag-grid-module > div[id^="agGrid_"],
#grid-area-2 .ag-grid-module > div[id^="agGrid_"],
#grid-area-3 .ag-grid-module > div[id^="agGrid_"],
#grid-area-4 .ag-grid-module > div[id^="agGrid_"],
#grid-area-5 .ag-grid-module > div[id^="agGrid_"] {
    height: 100% !important;
    width: 100%;
}

.processes-grid-container .ag-theme-alpine {
    --ag-header-height: 34px;
}

.ag-theme-alpine .ag-header {
    background-color: #f8f8f8;
    border-bottom: 1px solid #babfc7;
}

.ag-theme-alpine .ag-header-cell-label {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.ag-theme-alpine .ag-header-cell {
    padding-left: 6px;
    padding-right: 6px;
}

/* Emergency column header — tinted to stand out */
.ag-theme-alpine .ag-header-cell.header-emergency {
    background-color: #fff3e0;
    color: #b45309;
    font-weight: 600;
}

/* AG Grid loading overlay (match other modern screens) */
.ag-theme-alpine .ag-overlay-loading-center {
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
}

/* ---------- Status cell colors ---------- */
.ag-theme-alpine .ag-cell.cell-ok {
    background-color: #6dc76dd4 !important;
    color: #0b3d0b !important;
    font-weight: 700;
}

.ag-theme-alpine .ag-cell.cell-danger {
    background-color: #ff0000d4 !important;
    color: #ffffff !important;
    font-weight: 700;
}

.ag-theme-alpine .ag-cell.cell-muted {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
}

/* Equipment (row label) cell — left-aligned bold */
.ag-theme-alpine .ag-cell.cell-equipment {
    font-weight: 600;
    color: #202124;
    text-transform: uppercase;
    font-size: 12px;
}

/* ---------- Area card accents ---------- */
.area-card.area-caster-1 { border-left: 4px solid #1f6fdf; }
.area-card.area-caster-2 { border-left: 4px solid #8e44ad; }
.area-card.area-lmf      { border-left: 4px solid #17a83a; }
.area-card.area-vtd      { border-left: 4px solid #e67e22; }
.area-card.area-refractory { border-left: 4px solid #c0392b; }
.area-card.area-notes    { border-left: 4px solid #94a3b8; }

.area-card {
    min-height: 36vh;
}

/* ---------- KPI cards ---------- */
.kpi-card {
    border-left: 4px solid transparent;
}
.kpi-card.kpi-ok    { border-left-color: #22c55e; }
.kpi-card.kpi-off   { border-left-color: #ef4444; }
.kpi-card.kpi-total { border-left-color: #6b7280; }

.kpi-card .kpi-value {
    line-height: 1.1;
}
.kpi-card .kpi-label {
    margin-bottom: 2px;
}

/* ---------- Auto-refresh pill ---------- */
.auto-refresh-pill {
    border: 1px solid transparent;
    cursor: pointer;
    user-select: none;
    min-width: 120px;
    justify-content: center;
}

.auto-refresh-pill.auto-on {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}
.auto-refresh-pill.auto-on:hover {
    background-color: #d1fae5;
}

.auto-refresh-pill.auto-off {
    background-color: #f3f4f6;
    color: #4b5563;
    border-color: #d1d5db;
}
.auto-refresh-pill.auto-off:hover {
    background-color: #e5e7eb;
}

.auto-refresh-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #9ca3af;
}
.auto-refresh-dot.is-on {
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: pulse-dot 1.6s infinite;
}

@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ---------- Legend bar ---------- */
.legend-bar {
    gap: 6px;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 2px 4px 2px 0;
}

.legend-chip.chip-ok {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.legend-chip.chip-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.legend-divider {
    display: inline-block;
    width: 1px;
    height: 16px;
    background-color: #e5e7eb;
    margin: 0 6px;
}

/* ---------- Notes card ---------- */
.notes-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.note-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: #374151;
    background-color: #f8fafc;
    border-left: 3px solid #94a3b8;
}

.note-item.note-info {
    background-color: #f1f5f9;
    border-left-color: #3b82f6;
}

.note-item.note-warning {
    background-color: #fffbeb;
    border-left-color: #f59e0b;
    color: #78350f;
    font-weight: 500;
}

.note-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #fff;
    color: #3b82f6;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.note-item.note-warning .note-icon {
    color: #d97706;
}

.note-body {
    flex: 1;
    padding-top: 2px;
}
