/* ABOUTME: CSS for the static EMS presentation page with REM Group branding. */
/* ABOUTME: Supports overview grid mode (all charts) and full-screen detail mode. */

/* ===== REM Group Brand Tokens ===== */
:root {
    --rem-green: #5A8A32;
    --rem-green-dark: #3D6B1A;
    --rem-green-light: #6FA040;
    --rem-navy: #1E2A38;
    --rem-navy-light: #2C3E50;
    --rem-bg: #F4F6F3;
    --rem-white: #FFFFFF;
    --rem-text: #2C3E50;
    --rem-text-muted: #6B7C8A;
    --rem-shadow: rgba(0, 0, 0, 0.08);
    --rem-shadow-strong: rgba(0, 0, 0, 0.15);
    --rem-font: 'Overpass', 'Open Sans', sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--rem-font);
    background: var(--rem-bg);
    color: var(--rem-text);
    overflow: hidden;
}

/* ===== Header ===== */
#presentation-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    background: linear-gradient(135deg, var(--rem-navy) 0%, var(--rem-navy-light) 100%);
    border-bottom: 3px solid var(--rem-green);
    transition: opacity 0.5s ease, transform 0.5s ease;
    height: 56px;
}

#presentation-header.hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    height: 30px;
    width: auto;
    background: #fff;
    padding: 3px 8px;
    border-radius: 4px;
}

.header-left h1 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.5px;
}

.header-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

#display-counter {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    min-width: 60px;
    text-align: center;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(90, 138, 50, 0.5);
}

.nav-btn.home-btn {
    font-size: 18px;
}

.nav-btn.play-pause {
    width: 42px;
    height: 42px;
    font-size: 16px;
    background: rgba(90, 138, 50, 0.3);
    border-color: rgba(90, 138, 50, 0.6);
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.data-period {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.generation-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* ===== Overview Grid ===== */
#overview-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 64px 20px 16px;
    background: var(--rem-bg);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 12px;
    overflow: hidden;
}

.overview-tile {
    background: var(--rem-white);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--rem-shadow);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.overview-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--rem-shadow-strong);
    border-color: var(--rem-green);
}

.tile-header {
    padding: 6px 10px;
    background: linear-gradient(135deg, var(--rem-navy) 0%, var(--rem-navy-light) 100%);
    flex-shrink: 0;
}

.tile-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--rem-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-subtitle {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-chart {
    flex: 1;
    min-height: 0;
    padding: 2px;
}

/* Placeholder for tiles with no chart yet */
.tile-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--rem-text-muted);
    font-size: 12px;
}

/* ===== Display Panels ===== */
.display-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 64px 24px 16px;
    display: flex;
    flex-direction: column;
    background: var(--rem-bg);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.panel-header {
    text-align: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.panel-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--rem-navy);
    margin-bottom: 2px;
}

.panel-subtitle {
    font-size: 14px;
    color: var(--rem-text-muted);
    font-weight: 300;
}

.panel-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ===== Chart Areas ===== */
.chart-area {
    flex: 1;
    min-height: 0;
    background: var(--rem-white);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--rem-shadow);
    padding: 8px;
}

.chart-small {
    flex: 2;
}

.chart-xs {
    flex: 1;
}

/* ===== Display 1: Three-column layout ===== */
.d1-layout {
    display: flex;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.d1-metrics {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.d1-chart {
    flex: 1;
    min-width: 0;
    display: flex;
}

.d1-chart .chart-area {
    width: 100%;
}

.metric-card {
    background: var(--rem-white);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px var(--rem-shadow);
    border-left: 4px solid var(--rem-green);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-label {
    font-size: 12px;
    color: var(--rem-text-muted);
    font-weight: 400;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--rem-navy);
}

/* ===== Savings Grid (Display 6, 13) ===== */
.savings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 10px;
    flex-shrink: 0;
}

.savings-card {
    background: var(--rem-white);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px var(--rem-shadow);
    text-align: center;
}

.savings-card.total {
    background: linear-gradient(135deg, var(--rem-green-dark), var(--rem-green));
    color: #fff;
}

.savings-label {
    font-size: 12px;
    color: var(--rem-text-muted);
    margin-bottom: 4px;
}

.savings-card.total .savings-label {
    color: rgba(255, 255, 255, 0.7);
}

.savings-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--rem-green);
}

.savings-card.total .savings-value {
    color: #FFD700;
}

/* ===== Display 10: Statistics cards ===== */
.d10-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.stat-card {
    background: var(--rem-white);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px var(--rem-shadow);
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: var(--rem-text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--rem-navy);
}

/* ===== Display 12: Stacked charts ===== */
.d12-charts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

/* ===== Responsive ===== */
@media (max-width: 1400px) {
    .panel-title { font-size: 20px; }
    .panel-subtitle { font-size: 12px; }
    .d1-metrics { width: 240px; }
    .metric-value { font-size: 18px; }
}
