:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255,255,255,0.1);
}

.status-available { color: #10b981; }
.status-preparing { color: #facc15; }
.status-charging { color: #3b82f6; font-weight: bold; }
.status-reserved { color: #a78bfa; font-weight: bold; }
.status-unavailable { color: #64748b; }
.status-faulted { color: #ef4444; }

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

body { 
    background: var(--bg-dark); 
    color: var(--text-main); 
    padding: 20px;
    padding-top: 0; /* Header is sticky, no top padding needed */
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
}

.container { width: 99%; max-width: none; margin: 0 auto; padding: 0 10px; }

header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
    /* Sticky header */
    position: sticky;
    top: 0;
    z-index: 500;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
    /* Subtle bottom shadow to separate from content */
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.header-time-container {
    display: flex;
    gap: 40px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 30px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.time-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 2px;
}

.time-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.15rem;
    color: #fff;
    font-weight: 600;
}

.logo-section h1 { 
    font-size: 2.2rem; 
    color: #60a5fa; 
    letter-spacing: -1px; 
    font-weight: 800; 
    margin: 0;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}
.logo-section span { 
    color: #94a3b8; 
    font-size: 1rem; 
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
}

header .btn-primary {
    font-size: 1rem;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
}

header .btn-primary:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    transform: translateY(-2px);
}

/* Grid Layout */
.charger-grid { display: grid; grid-template-columns: 1fr; gap: 25px; }

/* Charger Card */
.charger-card { 
    background: rgba(30, 41, 59, 0.7); 
    backdrop-filter: blur(12px);
    border-radius: 20px; 
    border: 1px solid rgba(255,255,255,0.08);
    display: grid; 
    grid-template-columns: 350px 1fr; 
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    transition: transform 0.3s ease, border-color 0.3s ease;
    width: 100%;
    max-width: none;
    margin: 0 0 25px 0;
}
.charger-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.card-left-panel { padding: 25px; border-right: 1px solid var(--border); background: rgba(0,0,0,0.1); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }

.status-badge { font-size: 0.65rem; padding: 4px 10px; border-radius: 20px; font-weight: 600; text-transform: uppercase; }
.status-available { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.status-offline { background: rgba(148, 163, 184, 0.1); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.2); }
.status-faulted { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* Visualization Section */
.visualization { 
    height: 140px; background: #000; border-radius: 12px; margin-bottom: 20px;
    position: relative; overflow: hidden; display: flex; justify-content: center; align-items: center; gap: 40px;
    border: 1px solid rgba(255,255,255,0.05);
}
.connector-visual { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pistol {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #475569; 
    border: 3px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.pistol.available { 
    background: #a855f7; /* Purple */
    animation: breathing-purple 3s infinite ease-in-out; 
}

.pistol.reserved { 
    background: #f59e0b; /* Orange */
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.pistol.preparing, .pistol.finishing { 
    background: #3b82f6; /* Blue */
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.pistol.charging { 
    background: #10b981; /* Green */
    animation: charging-pulse-green 1.5s infinite ease-in-out; 
}

.pistol.charging::after {
    content: '';
    position: absolute;
    width: 75%;
    height: 75%;
    border: 2px dashed rgba(255,255,255,0.4);
    border-radius: 50%;
    animation: rotating-core 5s linear infinite;
}

.pistol.suspendedev, .pistol.suspendedevse, .pistol.unavailable, .pistol.faulted { 
    background: #ef4444; /* Red */
    border-color: #fca5a5; 
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.pistol-label { font-size: 1.1rem; font-weight: 800; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.cable {
    width: 10px;
    height: 35px;
    background: #1e293b;
    margin-top: -5px;
    border-radius: 0 0 6px 6px;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

.cable.plugged {
    height: 60px;
    background: #334155;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Sinkronisasi Warna Kabel dengan Status Pistol */
.pistol.available + .cable.plugged { background: #a855f7; box-shadow: 0 0 15px rgba(168, 85, 247, 0.4); }
.pistol.reserved + .cable.plugged { background: #f59e0b; box-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }
.pistol.preparing + .cable.plugged, .pistol.finishing + .cable.plugged { background: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); }
.pistol.suspendedev + .cable.plugged, .pistol.suspendedevse + .cable.plugged, .pistol.faulted + .cable.plugged { background: #ef4444; box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }

/* Aliran Energi Hijau saat Charging */
.pistol.charging + .cable.plugged {
    background: linear-gradient(180deg, #064e3b, #10b981, #064e3b);
    background-size: 100% 200%;
    animation: energy-flow 1s linear infinite;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}
.cable.plugged { background: #0f172a; height: 50px; border-color: rgba(255,255,255,0.1); }

/* Energy Flow Animation */
.cable.charging::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #10b981, transparent);
    animation: energy-flow 1s infinite linear;
}

@keyframes energy-flow {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 200%; }
}

@keyframes breathing-purple {
    0%, 100% { box-shadow: 0 0 10px rgba(168, 85, 247, 0.3); transform: scale(1); }
    50% { box-shadow: 0 0 25px rgba(168, 85, 247, 0.6); transform: scale(1.05); }
}

@keyframes charging-pulse-green {
    0%, 100% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); filter: brightness(1); }
    50% { box-shadow: 0 0 35px rgba(16, 185, 129, 0.8); filter: brightness(1.3); }
}

@keyframes rotating-core {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Connector Rows */
.connector-list { display: flex; flex-direction: column; gap: 15px; }
.connector-row { 
    background: rgba(255,255,255,0.03); 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    padding: 15px; 
    transition: all 0.3s ease;
}
.connector-row.active-charging {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.05);
    box-shadow: inset 0 0 15px rgba(16, 185, 129, 0.1);
}
.conn-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.conn-id { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }

.conn-type-select { font-size: 0.65rem; padding: 2px 8px; border-radius: 4px; outline: none; cursor: pointer; font-weight: 600; }
.conn-type-ac { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.conn-type-dc { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.conn-type-select option { background: #1e293b; color: #fff; }

.conn-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.setting-item { display: flex; flex-direction: column; gap: 4px; }
.setting-item label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 800; letter-spacing: 0.5px; }
.setting-item input { background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: #fff; padding: 8px 10px; border-radius: 6px; font-size: 0.9rem; width: 100%; box-sizing: border-box; font-weight: bold; }

.conn-metrics { 
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    font-size: 0.8rem; color: var(--text-muted); margin-bottom: 15px; 
    background: rgba(0,0,0,0.25); padding: 12px; border-radius: 10px; 
    border: 1px solid rgba(255,255,255,0.05);
}
.conn-metrics div { display: flex; flex-direction: column; gap: 4px; }
.conn-metrics span { font-size: 0.6rem; text-transform: uppercase; font-weight: 700; opacity: 0.7; }
.conn-metrics strong { color: #60a5fa; font-size: 1.1rem; font-family: 'Fira Code', monospace; }
.conn-metrics .status-available { color: #10b981; }
.conn-metrics .status-charging { color: #3b82f6; }

.controls { display: flex; gap: 6px; flex-wrap: wrap; }
.btn { border: none; padding: 6px 10px; border-radius: 6px; font-weight: 600; cursor: pointer; transition: all 0.2s; font-size: 0.65rem; display: flex; align-items: center; justify-content: center; gap: 4px; flex: 1; min-width: 80px; }
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Console Panel Section */
.console-wrapper { display: flex; flex-direction: column; padding: 20px; background: rgba(0,0,0,0.05); }
.console-header { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 15px; color: #fff; font-size: 0.95rem; font-weight: bold; 
}

.console-header span { color: #ffffff !important; opacity: 1 !important; font-size: 0.9rem !important; }

.btn-clear {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 6px 12px;
    border-radius: 6px;
}
body {
    font-family: 'Inter', sans-serif;
    background: #020617; /* Deep Navy Black */
    color: #e2e8f0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
    letter-spacing: -0.01em;
}

.btn-clear:hover { background: #ef4444; color: white; }

.console-content { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 220px; max-height: 650px; margin-bottom: 0; }
.console-pane { 
    background: #000000; /* Pure Black for Ultra Contrast */
    border: 1px solid var(--border); border-radius: 8px; padding: 0; 
    font-family: 'IBM Plex Mono', monospace; font-size: 1.15rem; 
    overflow-y: auto; color: #f8fafc;
}

.console-pane::-webkit-scrollbar { width: 4px; }
.console-pane::-webkit-scrollbar-track { background: transparent; }
.console-pane::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }



.pane-title { 
    font-size: 1rem; color: #fff; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); 
    padding: 10px 15px; text-transform: uppercase; position: sticky; top: 0; z-index: 10;
    margin-top: 0; margin-left: 0; margin-right: 0;
    letter-spacing: 1.5px; font-weight: 900;
}
.pane-send .pane-title { background: #1e3a8a; border-bottom: 2px solid #3b82f6; } /* Blue for Outbound */
.pane-recv .pane-title { background: #4c1d95; border-bottom: 2px solid #8b5cf6; } /* Purple for Inbound */

.log-entry { margin-bottom: 4px; line-height: 1.4; border-bottom: 1px solid #111; padding: 0 12px 2px 12px; }
.log-entry span { color: #4ade80; opacity: 0.5; margin-right: 5px; }

/* Diagnosis Controls Section */
.diag-controls-area { width: 100%; margin-top: 15px; }
.diag-controls { 
    display: flex; gap: 10px; flex-wrap: wrap; 
    border-top: 2px solid var(--border); padding-top: 20px; 
}

.diag-controls .btn {
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 10px;
    letter-spacing: 1px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    flex: 1 1 auto;
    min-width: 120px;
}

.diag-controls .btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
}

.btn-boot { background: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.3); }
.btn-hbt { background: #8b5cf6; box-shadow: 0 0 15px rgba(139, 92, 246, 0.3); }
.btn-auth { background: #10b981; box-shadow: 0 0 15px rgba(16, 185, 129, 0.3); }
.btn-emg { background: #ef4444; border: 2px solid #fca5a5; box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
.btn-pwr { background: #f59e0b; color: #000; box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
.btn-offline { background: #06b6d4; box-shadow: 0 0 15px rgba(6, 182, 212, 0.3); }
.btn-plug { 
    background: #3b82f6; 
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3); 
    font-size: 0.85rem !important;
    font-weight: 800 !important;
}
.btn-swipe { 
    background: #10b981; 
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3); 
    font-size: 0.85rem !important;
    font-weight: 800 !important;
}

.btn-diag { 
    background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); 
    padding: 6px 12px; font-size: 0.7rem; border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.btn-diag:hover { background: rgba(255,255,255,0.1); color: white; }

/* Emergency Button Special Styling */
.emg-btn { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.emg-locked { 
    background: #ef4444 !important; color: white !important; border-color: #ef4444 !important; 
    animation: pulse-red 2.5s infinite; font-weight: bold; 
}
@keyframes pulse-red { 
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } 
}

/* Modals Section */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
    display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal { 
    background: #0f172a; border: 1px solid rgba(255,255,255,0.1); padding: 35px; border-radius: 20px; 
    width: 90%; max-width: 550px; position: relative; z-index: 1001;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-header h2 { 
    font-size: 1.8rem; color: #60a5fa; margin-bottom: 25px; 
    font-weight: 800; letter-spacing: -0.5px;
}

.form-group { 
    display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; 
    position: relative;
}
.form-group label { 
    font-size: 0.9rem; color: #94a3b8; font-weight: 700; 
    text-transform: uppercase; letter-spacing: 0.5px;
}
.form-group input, .form-group select { 
    background: #020617; border: 1px solid var(--border); color: #fff; padding: 15px; border-radius: 12px; 
    outline: none; font-size: 1.1rem; transition: all 0.2s;
    width: 100%; font-weight: bold;
}
.form-group input:focus, .form-group select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.3);
}

.btn-group { display: flex; gap: 15px; margin-top: 30px; }

.btn-modal-primary {
    background: #10b981 !important; /* Emerald Success */
    font-size: 1.1rem !important;
    padding: 15px !important;
    font-weight: 800 !important;
    color: white !important;
    border-radius: 12px !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    flex: 1;
}

.btn-modal-secondary {
    background: #334155 !important;
    color: #cbd5e1 !important;
    font-size: 1.1rem !important;
    padding: 15px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    flex: 1;
}

/* Power Button Styles */
.cp-actions {
    position: relative;
    z-index: 110; /* Di atas overlay */
}
.power-btn {
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
    pointer-events: auto !important;
}
.power-btn.power-on {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}
.power-btn.power-off {
    color: #ef4444;
    opacity: 0.6;
}
.power-btn:hover {
    transform: scale(1.2) rotate(10deg);
    opacity: 1;
}

/* Power Off Overlay */
.power-off-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 12px;
    border: 2px dashed #ef4444;
    pointer-events: all;
}
.power-off-overlay span {
    color: #ef4444;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Tambahan gaya console */
.log-entry {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    white-space: pre-wrap;
    word-break: break-all;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.dir-badge {
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}
.dir-badge.out {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.2);
}
/* High Contrast Syntax Highlighting */
.op-bracket { color: #94a3b8; } /* Muted Slate */
.op-type { color: #facc15; font-weight: bold; } /* Bright Yellow */
.op-id { color: #22d3ee; } /* Cyan */
.op-action { color: #f472b6; font-weight: bold; } /* Pink/Magenta */
.op-payload { color: #ffffff; } /* Pure White for data */

.log-entry {
    background: rgba(255, 255, 255, 0.04);
    margin: 10px 15px;
    border-radius: 8px;
    padding: 12px 18px !important;
    transition: background 0.2s;
    line-height: 1.6;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.08);
}

.log-entry span:first-child {
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: bold;
    min-width: 120px;
}
