/* ============================================================
   style.css — Energy Comparison Platform
   ============================================================ */

/* --- Root Variables ---------------------------------------- */
:root {
    --ec-primary:     #1a73e8;
    --ec-primary-dark: #1557b0;
    --ec-success:     #34a853;
    --ec-warning:     #fbbc04;
    --ec-danger:      #ea4335;
    --ec-dark:        #1a1a2e;
    --ec-light-bg:    #f8f9fa;
    --ec-border:      #dee2e6;
    --ec-card-shadow: 0 2px 12px rgba(0,0,0,0.08);
    --ec-radius:      0.5rem;
}

/* --- Base -------------------------------------------------- */
body {
    background-color: var(--ec-light-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

/* --- Page container top spacing (consistent across all pages) --- */
.container, .container-fluid {
    padding-top: 1.5rem;
}

/* --- Cards ------------------------------------------------- */
.card {
    border: none;
    border-radius: var(--ec-radius);
    box-shadow: var(--ec-card-shadow);
    transition: box-shadow 0.2s ease;
}

.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

.card-header {
    background: #fff;
    border-bottom: 2px solid var(--ec-primary);
    font-weight: 600;
    border-radius: var(--ec-radius) var(--ec-radius) 0 0 !important;
}

/* --- Stat Cards -------------------------------------------- */
.stat-card {
    border-left: 4px solid var(--ec-primary);
    padding: 1.25rem;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--ec-primary); }
.stat-card .stat-label { font-size: 0.85rem; color: #666; text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Comparison Results ------------------------------------ */
.comparison-table th { background: #f0f4ff; }
.best-deal {
    background: #e8f5e9 !important;
    border-left: 4px solid var(--ec-success) !important;
}
.best-deal-badge {
    background: var(--ec-success);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    vertical-align: middle;
}
.current-tariff-row { background: #fff8e1 !important; }
.savings-positive { color: var(--ec-success); font-weight: 600; }
.savings-negative { color: var(--ec-danger); font-weight: 600; }
.partial-month-note { font-size: 0.78rem; color: #888; font-style: italic; }
.region-changed-badge {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
}

/* --- Tariff Type Badges ------------------------------------ */
.tariff-type-standard  { background: #1a73e8; }
.tariff-type-economy7  { background: #34a853; }
.tariff-type-tou       { background: #fbbc04; color: #333 !important; }
.tariff-type-dynamic   { background: #ea4335; }

/* --- Rate History Table ------------------------------------ */
.rate-history-table .current-rate { background: #e8f5e9; font-weight: 600; }
.rate-history-table .expired-rate { color: #999; }

/* --- Upload Area ------------------------------------------- */
.upload-dropzone {
    border: 2px dashed var(--ec-primary);
    border-radius: var(--ec-radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease;
    background: #f8fbff;
}
.upload-dropzone:hover, .upload-dropzone.drag-over {
    background: #e8f0fe;
}
.upload-dropzone i { font-size: 3rem; color: var(--ec-primary); }

/* --- Auth Pages -------------------------------------------- */
.auth-card {
    max-width: 440px;
    margin: 3rem auto;
}
.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-logo i { font-size: 3rem; color: var(--ec-primary); }

/* --- Admin Sidebar ----------------------------------------- */
.admin-sidebar {
    background: #fff;
    border-right: 1px solid var(--ec-border);
    min-height: calc(100vh - 56px);
    padding-top: 1rem;
}
.admin-sidebar .nav-link {
    color: #444;
    padding: 0.6rem 1.2rem;
    border-radius: 0.375rem;
    margin: 2px 8px;
    transition: background 0.15s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: #e8f0fe;
    color: var(--ec-primary);
}
.admin-sidebar .nav-link i { width: 20px; }

/* --- Supplier Card ----------------------------------------- */
.supplier-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
}
.supplier-logo-placeholder {
    width: 48px;
    height: 48px;
    background: #e8f0fe;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ec-primary);
    font-size: 1.4rem;
}
.referral-banner {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 1px solid #a5d6a7;
    border-radius: var(--ec-radius);
    padding: 0.75rem 1rem;
}

/* --- Chart containers -------------------------------------- */
.chart-container { position: relative; }

/* --- ToU Band Builder -------------------------------------- */
.tou-band-row {
    background: #f8f9fa;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}
.tou-coverage-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.tou-coverage-fill {
    height: 100%;
    background: var(--ec-success);
    transition: width 0.3s ease;
}
.tou-coverage-fill.incomplete { background: var(--ec-warning); }

/* --- Reading History --------------------------------------- */
.reading-upload-card {
    border-left: 3px solid var(--ec-primary);
    padding: 1rem;
    background: #fff;
    border-radius: 0 var(--ec-radius) var(--ec-radius) 0;
    margin-bottom: 0.75rem;
    box-shadow: var(--ec-card-shadow);
}

/* --- Utilities --------------------------------------------- */
.cursor-pointer { cursor: pointer; }
.text-primary { color: var(--ec-primary) !important; }
.bg-primary-soft { background-color: #e8f0fe; }
.border-primary-soft { border-color: #c5d8fb; }
.fw-500 { font-weight: 500; }
.fs-sm { font-size: 0.85rem; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 768px) {
    .stat-card .stat-value { font-size: 1.4rem; }
    .auth-card { margin: 1rem; }
    .upload-dropzone { padding: 1.5rem; }
}
