/* 
 * EcoGrid-Agent Stylesheet
 * Vibrant, modern, dark mode glassmorphism
 */

:root {
    --bg-main: #060913;
    --bg-card: rgba(15, 23, 42, 0.65);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Neon Colors */
    --clr-solar: #06b6d4;      /* Cyan */
    --clr-battery: #10b981;    /* Emerald */
    --clr-grid: #a855f7;       /* Purple */
    --clr-diesel: #f97316;     /* Orange */
    --clr-demand: #f43f5e;     /* Rose */
    --clr-hub: #3b82f6;        /* Blue */
    
    /* Shadows */
    --shadow-neon-solar: 0 0 15px rgba(6, 182, 212, 0.4);
    --shadow-neon-battery: 0 0 15px rgba(16, 185, 129, 0.4);
    --shadow-neon-grid: 0 0 15px rgba(168, 85, 247, 0.4);
    --shadow-neon-diesel: 0 0 15px rgba(249, 115, 22, 0.4);
    --shadow-neon-demand: 0 0 15px rgba(244, 63, 94, 0.4);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 10% 10%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
        radial-gradient(at 90% 10%, rgba(168, 85, 247, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 80%, rgba(6, 182, 212, 0.05) 0px, transparent 50%);
    background-size: 200% 200%;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: energy-drift 25s ease infinite alternate;
}

@keyframes energy-drift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 100%; }
}

.app-container {
    position: relative;
    z-index: 7; /* render on top of background canvas (z-index 6) */
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 20px 65px 20px; /* Tambahkan bottom padding agar konten tidak terpotong oleh footer fixed */
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* Header styling */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2rem;
    color: var(--clr-solar);
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.8));
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    0% { filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.5)); }
    100% { filter: drop-shadow(0 0 15px rgba(6, 182, 212, 1)); }
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.time-panel {
    display: flex;
    gap: 25px;
}

.time-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.time-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-item .value {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 2px;
}

.weather-icon {
    color: #eab308;
    margin-right: 5px;
}

/* Glassmorphism Card base */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.glass-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr 1fr;
    gap: 20px;
}

.span-two-cols {
    grid-column: span 3;
}

/* Control Panel */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mode-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}

.mode-toggle button {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    outline: none;
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-toggle button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.mode-toggle button.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--clr-hub);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), inset 0 0 8px rgba(59, 130, 246, 0.1);
}

.profile-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}
.profile-select:focus {
    border-color: var(--clr-hub);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
.profile-select option {
    background: #0f172a;
    color: var(--text-primary);
}

.control-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    border: 1px solid transparent;
    outline: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(37, 99, 235, 0.22));
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: #22d3ee;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 0 8px rgba(6, 182, 212, 0.1);
}
.btn-primary:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(37, 99, 235, 0.35));
    border-color: #22d3ee;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.45), inset 0 0 10px rgba(6, 182, 212, 0.2);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(4, 120, 87, 0.22));
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.1);
}
.btn-success:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(4, 120, 87, 0.35));
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.45), inset 0 0 10px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(185, 28, 28, 0.22));
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 0 8px rgba(239, 68, 68, 0.1);
}
.btn-danger:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(185, 28, 28, 0.35));
    border-color: #f87171;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.45), inset 0 0 10px rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.02);
}
.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(148, 163, 184, 0.55);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.08), inset 0 0 8px rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.btn-row {
    display: flex;
    gap: 10px;
    width: 100%;
}
.btn-row .btn {
    flex: 1;
}

/* Manual Panel Buttons */
.manual-panel {
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.manual-panel h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.manual-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.btn-manual-act {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-manual-act:hover {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(59, 130, 246, 0.35);
    color: var(--text-primary);
    transform: translateY(-1px);
}
.btn-manual-act.selected {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--clr-hub);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.35), inset 0 0 6px rgba(59, 130, 246, 0.1);
}

.hidden {
    display: none !important;
}

/* Global Impact Metrics Container */
.metrics-container {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metrics-container h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grid for CO2 and Coal */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric-box {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
}
.metric-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.6);
}

.metric-box.carbon { border-left: 3px solid var(--clr-battery); }
.metric-box.coal { border-left: 3px solid #64748b; }

.m-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.m-value {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 4px 0;
    color: var(--text-primary);
}

.m-sub {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* Cost Summary Box */
.cost-summary-box {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-glass);
    border-left: 3px solid var(--clr-solar);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cost-main {
    display: flex;
    flex-direction: column;
}

.cost-val {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 2px;
}

.cost-comparison {
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comp-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.comp-row.saved {
    color: var(--clr-battery);
    font-weight: 600;
}

/* Flow Panel / Grid Flow */
.grid-flow-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 350px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    margin: 10px auto 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1.2fr 1fr;
    padding: 15px;
    gap: 10px;
}

.node {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--border-glass);
    border-radius: 14px;
    padding: 10px;
    transition: all 0.4s ease;
    z-index: 2;
}

.node-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.node-name {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

.node-val {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Posisi Node dalam Grid */
.solar-node { grid-area: 1 / 2; color: var(--clr-solar); }
.battery-node { grid-area: 2 / 1; color: var(--clr-battery); }
.grid-node { grid-area: 2 / 3; color: var(--clr-grid); }
.diesel-node { grid-area: 3 / 1; color: var(--clr-diesel); }
.demand-node { grid-area: 3 / 3; color: var(--clr-demand); }

/* Center Hub */
.hub-node {
    grid-area: 2 / 2;
    background: transparent;
    border: none;
}
.hub-circle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: radial-gradient(circle, #2563eb, #1e40af);
    border: 3px solid #60a5fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
    color: white;
}
.hub-circle i { font-size: 1.3rem; }
.hub-circle span { font-size: 0.65rem; font-weight: 800; margin-top: 2px; }

/* Status Node Aktif (Glow effect) */
.solar-node.active { border-color: var(--clr-solar); box-shadow: var(--shadow-neon-solar); }
.battery-node.active-charge { border-color: var(--clr-battery); box-shadow: var(--shadow-neon-battery); }
.battery-node.active-discharge { border-color: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); }
.grid-node.active-import { border-color: var(--clr-grid); box-shadow: var(--shadow-neon-grid); }
.grid-node.active-export { border-color: #10b981; box-shadow: 0 0 15px rgba(16, 185, 129, 0.5); }
.diesel-node.active { border-color: var(--clr-diesel); box-shadow: var(--shadow-neon-diesel); }
.demand-node.active { border-color: var(--clr-demand); box-shadow: var(--shadow-neon-demand); }

/* Baterai indicator bar */
.battery-bar-outer {
    width: 80%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}
.battery-bar-inner {
    height: 100%;
    background: var(--clr-battery);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Connecting SVG Lines */
.flow-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.svg-line {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke 0.4s ease, stroke-width 0.4s ease;
}

/* Active Glowing & Dash Moving Flows */
.svg-line.active-solar { stroke: var(--clr-solar); stroke-width: 5; filter: drop-shadow(0 0 4px var(--clr-solar)); stroke-dasharray: 8 8; animation: dash 1s linear infinite; }
.svg-line.active-battery-charge { stroke: var(--clr-battery); stroke-width: 5; filter: drop-shadow(0 0 4px var(--clr-battery)); stroke-dasharray: 8 8; animation: dash 1s linear infinite; }
.svg-line.active-battery-discharge { stroke: #3b82f6; stroke-width: 5; filter: drop-shadow(0 0 4px #3b82f6); stroke-dasharray: 8 8; animation: dash-reverse 1s linear infinite; }
.svg-line.active-grid-import { stroke: var(--clr-grid); stroke-width: 5; filter: drop-shadow(0 0 4px var(--clr-grid)); stroke-dasharray: 8 8; animation: dash 1s linear infinite; }
.svg-line.active-grid-export { stroke: #10b981; stroke-width: 5; filter: drop-shadow(0 0 4px #10b981); stroke-dasharray: 8 8; animation: dash-reverse 1s linear infinite; }
.svg-line.active-diesel { stroke: var(--clr-diesel); stroke-width: 5; filter: drop-shadow(0 0 4px var(--clr-diesel)); stroke-dasharray: 8 8; animation: dash 1s linear infinite; }
.svg-line.active-demand { stroke: var(--clr-demand); stroke-width: 5; filter: drop-shadow(0 0 4px var(--clr-demand)); stroke-dasharray: 8 8; animation: dash 1s linear infinite; }

@keyframes dash {
    to {
        stroke-dashoffset: -16;
    }
}
@keyframes dash-reverse {
    to {
        stroke-dashoffset: 16;
    }
}

/* Reasoning Panel Console */
.console-box {
    display: flex;
    flex-direction: column;
    height: 380px;
    background: #05070f;
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.console-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 15px;
    background: #0f1322;
    border-bottom: 1px solid var(--border-glass);
}

.console-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.console-dot.green { background: #10b981; }
.console-dot.yellow { background: #eab308; }
.console-dot.red { background: #ef4444; }

.console-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-left: 10px;
}

.console-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    flex: 1;
}

.prompt-symbol {
    color: var(--clr-solar);
    font-weight: bold;
}

.console-log {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.05);
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid #0284c7;
}

.console-thinking {
    color: #a7f3d0;
}

/* Chart Styles */
.charts-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    min-height: 280px;
}

.chart-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    padding: 15px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

/* Footer Styling */
footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-glass);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
}

.tab-btn {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 12px 24px;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--clr-hub);
    transition: all 0.25s ease;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--clr-hub);
}

.tab-btn:hover {
    color: var(--text-primary);
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(15, 23, 42, 0.65);
    transform: translateY(-1px);
}

.tab-btn.active {
    color: var(--text-primary);
    border-color: var(--clr-hub);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15), inset 0 0 8px rgba(59, 130, 246, 0.05);
}

.tab-btn.active::after {
    width: 80%;
}

/* Tab Content Wrappers */
.tab-content-wrapper {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Planner Grid */
.planner-grid {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 20px;
}

.planner-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.planner-input:focus {
    border-color: var(--clr-hub);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.planner-input option {
    background: #0f172a;
    color: var(--text-primary);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    width: 100%;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

/* Planner Results */
.results-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

.result-box-mini {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.result-box-mini i {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.result-box-mini.solar { border-top: 4px solid var(--clr-solar); }
.result-box-mini.solar i { color: var(--clr-solar); }

.result-box-mini.battery { border-top: 4px solid var(--clr-battery); }
.result-box-mini.battery i { color: var(--clr-battery); }

.result-box-mini.cost { border-top: 4px solid var(--clr-diesel); }
.result-box-mini.cost i { color: var(--clr-diesel); }

.result-box-mini.roi { border-top: 4px solid var(--clr-grid); }
.result-box-mini.roi i { color: var(--clr-grid); }

.result-box-mini .lbl {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.result-box-mini .val {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 6px;
    color: var(--text-primary);
}

.result-box-mini .val.text-small {
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Report Console Box */
.report-console-box {
    background: #05070f;
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.report-header {
    background: #0f1322;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-glass);
}

.report-header .console-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--clr-solar);
    letter-spacing: 0.5px;
}

.report-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.report-body h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #38bdf8;
    margin-top: 15px;
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.report-body ul, .report-body ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.report-body li {
    margin-bottom: 6px;
}

.report-body p {
    margin-bottom: 15px;
}

.report-body strong {
    color: #f1f5f9;
}

.welcome-msg {
    color: var(--text-secondary);
    text-align: center;
    margin-top: 30px;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 1100px) {
    .dashboard-grid, .planner-grid {
        grid-template-columns: 1fr;
    }
    .span-two-cols {
        grid-column: span 1;
    }
    .charts-wrapper, .results-quick-grid {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------------
 * Landing Portal Screen Styles (Immersive HUD & Split Shutters)
 * ---------------------------------------------------- */
.landing-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    background: transparent;
    pointer-events: auto;
    transition: opacity 0.5s ease;
}

body.state-simulator .landing-container {
    z-index: 1;
    pointer-events: none;
}

/* Rana Pintu Geser Kiri-Kanan (Sliding Shutters with Lightning Crack) */
.landing-shutter {
    position: fixed;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: #030712;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.95) 0%, #030712 100%),
        linear-gradient(rgba(255, 255, 255, 0.008) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.008) 1px, transparent 1px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    z-index: 5;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.left-shutter {
    left: 0;
    clip-path: polygon(0% 0%, 50% 0%, 52% 25%, 47% 45%, 53% 55%, 48% 75%, 51% 85%, 50% 100%, 0% 100%);
    filter: drop-shadow(5px 0 15px rgba(6, 182, 212, 0.65));
}

.right-shutter {
    left: 0;
    clip-path: polygon(100% 0%, 50% 0%, 52% 25%, 47% 45%, 53% 55%, 48% 75%, 51% 85%, 50% 100%, 100% 100%);
    filter: drop-shadow(-5px 0 15px rgba(6, 182, 212, 0.65));
}

/* Status Shutter Terbuka - Tergeser Penuh */
.shutter-open .left-shutter {
    transform: translateX(-100vw);
}

.shutter-open .right-shutter {
    transform: translateX(100vw);
}

/* Background Canvas */
#landing-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 6; /* render on top of shutters (z-index 5) but under wrapper (z-index 10) */
    pointer-events: none;
    opacity: 0.95;
}

/* Wrapper Konten Teks Sambutan (Holographic HUD Style) */
.landing-wrapper {
    width: 100%;
    max-width: 950px;
    text-align: center;
    padding: 60px 20px 100px 20px;
    margin: auto;
    z-index: 10;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.landing-wrapper.fade-out {
    opacity: 0;
    transform: scale(0.96);
}

.badge-conference {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.35);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #22d3ee;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 25px;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
    backdrop-filter: blur(5px);
}

.landing-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

/* Logo Petir Membelah (Split Bolt Logo) */
.split-logo-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-logo-half {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.5s ease;
}

/* Clip-path untuk membagi icon menjadi dua belahan tepat di tengah */
.split-logo-half.left-half {
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    transform-origin: center;
}

.split-logo-half.right-half {
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
    transform-origin: center;
}

.logo-bolt {
    font-size: 5rem;
    color: var(--clr-solar);
    filter: drop-shadow(0 0 15px rgba(6, 182, 212, 0.85));
    animation: pulse-glow 2s infinite alternate;
}

/* Pergeseran Belahan Petir Saat Terbuka */
.shutter-open .left-half {
    transform: translateX(-180px) rotate(-20deg) scale(0.85);
    opacity: 0;
}

.shutter-open .right-half {
    transform: translateX(180px) rotate(20deg) scale(0.85);
    opacity: 0;
}

.landing-header h1 {
    font-size: 3.25rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.05);
}

.landing-header .tagline {
    font-size: 1.25rem;
    font-weight: 600;
    color: #38bdf8;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.landing-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 760px;
    margin: 0 auto 35px auto;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    text-align: left;
    width: 100%;
}

.feat-card {
    background: rgba(10, 17, 32, 0.45);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.feat-card:hover {
    border-color: rgba(6, 182, 212, 0.4);
    background: rgba(15, 23, 42, 0.65);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.1);
}

.feat-card i {
    font-size: 1.6rem;
    color: var(--clr-hub);
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.4));
}

.feat-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.feat-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Eco Metrics Ticker (HUD Panels) */
.landing-metrics-ticker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 35px;
    text-align: left;
    width: 100%;
}

.ticker-item {
    background: rgba(10, 17, 32, 0.45);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.ticker-item:hover {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(6, 182, 212, 0.35);
    box-shadow: 0 5px 15px rgba(6, 182, 212, 0.05);
}

.t-lbl {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.t-val {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cyan-glow {
    color: var(--clr-solar);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.45);
}

.green-glow {
    color: var(--clr-battery);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

.pulse-blue {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.45);
    display: flex;
    align-items: center;
}

.dot-online {
    width: 8px;
    height: 8px;
    background: var(--clr-battery);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--clr-battery);
    animation: flash-dot 1.5s infinite alternate;
}

@keyframes flash-dot {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.btn-launch {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1d4ed8, #06b6d4, #10b981, #1d4ed8);
    background-size: 300% 300%;
    color: white;
    font-size: 1.1rem;
    padding: 16px 40px;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(6, 182, 212, 0.4);
    animation: gradient-flow 6s ease infinite, neon-pulse 2s infinite;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 700;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sweeping Energy Laser Beam */
.btn-launch::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(34, 211, 238, 0.15) 15%, 
        rgba(34, 211, 238, 0.75) 50%, 
        rgba(34, 211, 238, 0.15) 85%, 
        transparent
    );
    transform: skewX(-25deg);
    pointer-events: none;
    animation: energy-sweep 3.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    z-index: 1;
}

.btn-launch span, 
.btn-launch i {
    position: relative;
    z-index: 2; /* Keep labels on top of the sweeping laser */
}

.btn-launch:hover {
    transform: translateY(-3px) scale(1.02);
    background-position: right center;
    animation: gradient-flow 3s ease infinite, neon-pulse-hover 1.2s infinite;
    border-color: rgba(34, 211, 238, 0.5);
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes energy-sweep {
    0% { left: -150%; }
    40% { left: 150%; }
    100% { left: 150%; } /* Pause on the right before repeating */
}

@keyframes neon-pulse {
    0% { 
        box-shadow: 0 0 15px rgba(6, 182, 212, 0.3), 0 4px 10px rgba(0, 0, 0, 0.4);
    }
    50% { 
        box-shadow: 0 0 30px rgba(6, 182, 212, 0.7), 0 0 15px rgba(16, 185, 129, 0.4), 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    100% { 
        box-shadow: 0 0 15px rgba(6, 182, 212, 0.3), 0 4px 10px rgba(0, 0, 0, 0.4);
    }
}

@keyframes neon-pulse-hover {
    0% { 
        box-shadow: 0 0 25px rgba(34, 211, 238, 0.5), 0 6px 15px rgba(0, 0, 0, 0.5);
    }
    50% { 
        box-shadow: 0 0 45px rgba(34, 211, 238, 0.95), 0 0 25px rgba(16, 185, 129, 0.6), 0 6px 25px rgba(0, 0, 0, 0.6);
    }
    100% { 
        box-shadow: 0 0 25px rgba(34, 211, 238, 0.5), 0 6px 15px rgba(0, 0, 0, 0.5);
    }
}

/* Footer Styles (Fixed at the bottom of the viewport) */
footer, .landing-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    text-align: center;
    z-index: 100;
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0;
}

/* Expandable Menu Container */
.header-menu-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
}

/* Bulat Menu Trigger Button */
.btn-circle {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-glass) !important;
    background: rgba(15, 23, 42, 0.55) !important;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.1);
}

.btn-circle:hover {
    background: rgba(6, 182, 212, 0.15) !important;
    border-color: rgba(6, 182, 212, 0.4) !important;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
    transform: scale(1.05);
}

.btn-circle .trigger-icon {
    font-size: 1.15rem;
    color: var(--clr-solar);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.4));
}

/* Rotate icon and change color when active */
.btn-circle.active-trigger .trigger-icon {
    transform: rotate(135deg);
    color: var(--clr-demand);
    filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.6));
}

/* Sliding Menu Drawer */
.header-menu-drawer {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-15px) scale(0.95);
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.4s;
    padding: 2px 0;
}

/* Active slide-out state */
.header-menu-drawer.drawer-open {
    max-width: 380px; /* Lebar maksimum cukup untuk menampung kedua tombol */
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    padding-left: 5px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#btn-back-landing {
    border-color: rgba(6, 182, 212, 0.3) !important;
    color: #22d3ee !important;
    background: rgba(10, 17, 32, 0.6) !important;
}

#btn-back-landing:hover {
    background: rgba(6, 182, 212, 0.15) !important;
    border-color: #22d3ee !important;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.35), inset 0 0 8px rgba(6, 182, 212, 0.1) !important;
    transform: translateY(-1px);
}

#btn-toggle-hud {
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #34d399 !important;
    background: rgba(10, 17, 32, 0.6) !important;
}

#btn-toggle-hud:hover {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: #34d399 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.30), inset 0 0 8px rgba(16, 185, 129, 0.1) !important;
    transform: translateY(-1px);
}

/* Mode HUD Transparan (Membuat kartu & header super transparan) */
body.hud-transparent .glass-card {
    background: rgba(10, 17, 32, 0.15) !important;
    backdrop-filter: blur(4px) !important;
    border-color: rgba(6, 182, 212, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

body.hud-transparent header {
    background: rgba(10, 17, 32, 0.25) !important;
    backdrop-filter: blur(6px) !important;
    border-color: rgba(6, 182, 212, 0.1) !important;
}

body.hud-transparent .console-box {
    background: rgba(5, 8, 16, 0.25) !important;
}

/* Media queries untuk halaman sambutan responsif */
@media (max-width: 900px) {
    .landing-metrics-ticker {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .landing-features-grid {
        grid-template-columns: 1fr;
    }
    .landing-header h1 {
        font-size: 2.2rem;
    }
    .landing-metrics-ticker {
        grid-template-columns: 1fr;
    }
    .landing-wrapper {
        padding: 24px;
    }
}
