/* =================================================================
   UNIFIED EV CHARGING AGGREGATOR PLATFORM - DESIGN SYSTEM
   Professional Modern Light Theme Palette
   ================================================================= */

:root {
    --primary: #059669;          /* Emerald Green EV accent */
    --primary-hover: #047857;
    --primary-light: #ecfdf5;
    --secondary: #2563eb;        /* Electric Blue accent */
    --secondary-light: #eff6ff;
    --dark: #0f172a;             /* Dark Slate typography */
    --slate: #475569;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08), 0 2px 6px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 28px -4px rgba(0,0,0,0.12), 0 4px 12px -2px rgba(0,0,0,0.06);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--light-bg);
    color: var(--dark);
    line-height: 1.5;
    overflow-x: hidden;
}

/* App Container (Mobile PWA Centered Viewport on Desktop) */
#app-root {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--light-bg);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    padding-bottom: 72px; /* Space for bottom navbar */
}

/* Header & Top Bar */
.app-header {
    background: #ffffff;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--dark);
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Bottom Navigation Bar (PWA Style) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--slate);
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    flex: 1;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item.active {
    color: var(--primary);
}

/* Card Components */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 18px;
    margin: 14px 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Hero Wallet Balance Card */
.wallet-card {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 22px;
    margin: 16px;
    box-shadow: 0 10px 25px -5px rgba(5, 150, 105, 0.4);
    position: relative;
    overflow: hidden;
}

.wallet-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 130px;
    height: 130px;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    pointer-events: none;
}

.wallet-title {
    font-size: 0.85rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.wallet-amount {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 6px 0 16px 0;
    letter-spacing: -0.5px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-light {
    background-color: #ffffff;
    color: var(--primary);
    font-weight: 700;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--dark);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-available {
    background-color: var(--primary-light);
    color: var(--primary);
}

.badge-busy {
    background-color: #fffbe6;
    color: #d97706;
}

.badge-offline {
    background-color: #f1f5f9;
    color: var(--slate);
}

/* Station Card */
.station-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.station-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.operator-badge {
    background: #f1f5f9;
    color: var(--dark);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.station-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
}

.station-meta {
    display: flex;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--slate);
}

/* Live Charging Dashboard Card */
.charging-hero-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 16px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.3);
}

.gauge-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 8px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    margin: 16px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: spinGauge 8s linear infinite;
}

.live-kwh {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-sheet {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-sheet {
    transform: translateY(0);
}

/* Maps Container */
#map-container {
    width: 100%;
    height: 380px;
    border-radius: var(--radius-md);
    background: #e2e8f0;
    overflow: hidden;
}

/* Helper Utilities */
.text-muted { color: var(--slate); }
.font-bold { font-weight: 700; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* Desktop Dashboard Enhancements for Admin/Operator */
.desktop-body {
    max-width: 100% !important;
    padding-bottom: 0 !important;
}

.desktop-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.main-content {
    flex: 1;
    padding: 30px;
    background: var(--light-bg);
}
