/* ========================================================
   VANANETRA CENTRAL (VNC) - MODERN DESIGN SYSTEM
   Host Target: vnc.inayat.net (Vercel)
   ======================================================== */

:root {
    --bg-dark: #070B14;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(6, 182, 212, 0.3);

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --solar-gold: #F59E0B;
    --solar-glow: rgba(245, 158, 11, 0.25);
    --bat-green: #10B981;
    --bat-glow: rgba(16, 185, 129, 0.25);
    --load-blue: #6366F1;
    --load-glow: rgba(99, 102, 241, 0.25);
    --infrasound-cyan: #06B6D4;
    --infrasound-glow: rgba(6, 182, 212, 0.25);
    --alert-red: #F43F5E;
    --alert-glow: rgba(244, 63, 94, 0.35);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(245, 158, 11, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
}

.font-mono {
    font-family: var(--font-mono);
}

/* ========================================================
   VIEW 1: PIN LOCK SCREEN
   ======================================================== */
.lock-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(7, 11, 20, 0.95);
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s;
}

.lock-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.lock-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 30px rgba(6, 182, 212, 0.15);
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 380px;
    text-align: center;
    backdrop-filter: blur(16px);
    animation: fadeInLock 0.6s ease-out;
}

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

.lock-icon-orb {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(16, 185, 129, 0.2));
    border: 1px solid rgba(6, 182, 212, 0.4);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 16px;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.lock-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #FFF;
}

.lock-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 24px;
}

.pin-display {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
    background: var(--infrasound-cyan);
    border-color: var(--infrasound-cyan);
    box-shadow: 0 0 12px var(--infrasound-cyan);
    transform: scale(1.15);
}

.lock-error-msg {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 20px;
    margin-bottom: 20px;
    transition: color 0.3s;
}

.lock-error-msg.error {
    color: var(--alert-red);
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.key-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: #FFF;
    font-size: 1.3rem;
    font-weight: 600;
    padding: 16px 0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.key-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.key-btn:active {
    transform: scale(0.95);
    background: rgba(6, 182, 212, 0.3);
}

.key-btn.action-key {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.lock-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================================================
   VIEW 2: MAIN DASHBOARD
   ======================================================== */
.main-dashboard {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.main-dashboard.hidden {
    display: none;
}

/* Top Navbar */
.navbar {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-orb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(16, 185, 129, 0.25));
    border: 1px solid rgba(6, 182, 212, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #FFF;
}

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

.brand-sub code {
    color: var(--infrasound-cyan);
    font-family: var(--font-mono);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.status-live {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
    color: var(--bat-green);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--bat-green);
    border-radius: var(--radius-full);
    box-shadow: 0 0 10px var(--bat-green);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-lock {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #FDA4AF;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-lock:hover {
    background: rgba(244, 63, 94, 0.25);
    color: #FFF;
}

/* Dashboard Body */
.dashboard-body {
    padding: 28px;
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Alert Banner */
.alert-banner {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(225, 29, 72, 0.15));
    border: 1px solid var(--alert-red);
    box-shadow: 0 0 25px var(--alert-glow);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: flashAlert 1.5s infinite alternate;
}

.alert-banner.hidden {
    display: none;
}

@keyframes flashAlert {
    from { border-color: rgba(244, 63, 94, 0.6); }
    to { border-color: rgba(244, 63, 94, 1); box-shadow: 0 0 35px var(--alert-glow); }
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.alert-siren {
    font-size: 30px;
}

.alert-title {
    font-weight: 800;
    font-size: 1rem;
    color: #FFE4E6;
    letter-spacing: 0.5px;
}

.alert-desc {
    font-size: 0.85rem;
    color: #FDA4AF;
    margin-top: 2px;
}

.btn-dismiss-alert {
    background: var(--alert-red);
    border: none;
    color: #FFF;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-dismiss-alert:hover {
    opacity: 0.85;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 22px;
    backdrop-filter: blur(16px);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.solar-glow:hover { box-shadow: 0 10px 30px var(--solar-glow); border-color: rgba(245, 158, 11, 0.4); }
.battery-glow:hover { box-shadow: 0 10px 30px var(--bat-glow); border-color: rgba(16, 185, 129, 0.4); }
.load-glow:hover { box-shadow: 0 10px 30px var(--load-glow); border-color: rgba(99, 102, 241, 0.4); }
.infrasound-glow:hover { box-shadow: 0 10px 30px var(--infrasound-glow); border-color: rgba(6, 182, 212, 0.4); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-group h3 {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}

.kpi-icon {
    font-size: 20px;
}

.badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.badge-solar { background: rgba(245, 158, 11, 0.15); color: var(--solar-gold); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--bat-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-load { background: rgba(99, 102, 241, 0.15); color: #A5B4FC; border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-rumble { background: rgba(6, 182, 212, 0.15); color: var(--infrasound-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }

.kpi-main-val {
    font-size: 2.2rem;
    font-weight: 800;
    color: #FFF;
    margin-bottom: 16px;
    font-family: var(--font-mono);
}

.kpi-main-val .unit {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
}

.kpi-sub-metrics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 14px;
}

.sub-metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.sub-label { color: var(--text-muted); }
.sub-val { color: var(--text-primary); font-weight: 600; }

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease-in-out;
}

.progress-solar { background: var(--solar-gold); box-shadow: 0 0 10px var(--solar-gold); }
.progress-bat { background: var(--bat-green); box-shadow: 0 0 10px var(--bat-green); }
.progress-load { background: var(--load-blue); box-shadow: 0 0 10px var(--load-blue); }
.progress-rumble { background: var(--infrasound-cyan); box-shadow: 0 0 10px var(--infrasound-cyan); }

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 1000px) {
    .charts-grid { grid-template-columns: 1fr; }
}

.chart-card {
    display: flex;
    flex-direction: column;
    min-height: 380px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFF;
    letter-spacing: 0.5px;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.btn-ctrl {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-ctrl:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFF;
}

.btn-ctrl.active {
    background: rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.5);
    color: var(--infrasound-cyan);
}

.chart-body {
    flex: 1;
    position: relative;
    padding: 16px 0;
    max-height: 280px;
}

.chart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-legend {
    display: flex;
    align-items: center;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-right: 6px;
}

.footer-stat strong {
    color: var(--text-primary);
}

/* Console Logs */
.logs-card {
    padding: 20px;
}

.logs-console {
    background: #030712;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    max-height: 140px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #94A3B8;
}

.log-entry.log-success { color: #34D399; }
.log-entry.log-alert { color: #FB7185; }

/* Dashboard Footer */
.dashboard-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.dashboard-footer code {
    color: var(--infrasound-cyan);
    font-family: var(--font-mono);
}
