/* ============================================================
   Jabodetabek Navigator — Blue Glassmorphism Theme
   Auto dark/light via prefers-color-scheme
   ============================================================ */

/* ---------- DARK MODE (default) ---------- */
:root {
    --bg: #060d1f;
    --bg-2: #0a1628;
    --bg-3: #0d1f3c;
    --glass: rgba(10, 22, 40, 0.55);
    --glass-hover: rgba(10, 22, 40, 0.75);
    --glass-border: rgba(96, 165, 250, 0.2);
    --glass-border-hover: rgba(0, 212, 255, 0.5);
    --text: #e2e8f0;
    --text-strong: #f0f6ff;
    --muted: #7a9ab8;
    --muted-2: #4e6d8c;
    --accent: #1d6aff;
    --accent-2: #60a5fa;
    --electric: #00d4ff;
    --green: #10b981;
    --red: #ef4444;
    --amber: #f59e0b;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
    --radius: 14px;
    --font: "Plus Jakarta Sans", Arial, sans-serif;
    --mono: "DM Mono", Consolas, monospace;
    --blur: blur(18px);
}

/* ---------- LIGHT MODE ---------- */
@media (prefers-color-scheme: light) {
    :root {
        --bg: #eef3ff;
        --bg-2: #f5f8ff;
        --bg-3: #e8f0ff;
        --glass: rgba(255, 255, 255, 0.7);
        --glass-hover: rgba(255, 255, 255, 0.92);
        --glass-border: rgba(59, 130, 246, 0.18);
        --glass-border-hover: rgba(29, 106, 255, 0.45);
        --text: #0f1f3d;
        --text-strong: #060d1f;
        --muted: #4a6080;
        --muted-2: #8baac8;
        --accent: #1d6aff;
        --accent-2: #3b82f6;
        --electric: #0057e7;
        --green: #059669;
        --red: #dc2626;
        --amber: #d97706;
        --shadow: 0 4px 24px rgba(59, 130, 246, 0.1);
        --shadow-sm: 0 2px 8px rgba(59, 130, 246, 0.07);
    }
}

/* ---------- RESET ---------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(0, 212, 255, 0.06) 0%, transparent 40%),
        linear-gradient(225deg, rgba(29, 106, 255, 0.08) 0%, transparent 40%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
}

@media (prefers-color-scheme: light) {
    body {
        background:
            linear-gradient(135deg, rgba(29, 106, 255, 0.06) 0%, transparent 40%),
            linear-gradient(225deg, rgba(0, 170, 255, 0.05) 0%, transparent 40%),
            var(--bg);
    }
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, p {
    margin-top: 0;
}

/* ---------- HEADER ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    padding: 0 24px;
    background: var(--glass);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow-sm);
}

.logo {
    font-size: 18px;
    font-weight: 800;
    color: var(--electric);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.logo span {
    color: var(--text-strong);
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-nav a {
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    background: rgba(59, 130, 246, 0.05);
    backdrop-filter: var(--blur);
    transition: color 0.2s, border-color 0.2s;
}

.top-nav a:hover {
    color: var(--electric);
    border-color: var(--glass-border-hover);
}

/* ---------- MAIN LAYOUT ---------- */
main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 70px;
}

/* ---------- GLASS CARD (shared) ---------- */
.hero-copy,
.status-card,
.tool-card,
.info-card,
.auth-panel,
.dashboard-header,
.form-panel,
.upload-card,
.empty-state,
.detail-panel,
.road-update-card,
.route-card,
.emergency-card,
.place-row {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow);
}

/* ---------- HERO ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

.hero-copy {
    padding: 32px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--electric);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

h1 {
    max-width: 760px;
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 14px;
    color: var(--text-strong);
}

.hero-copy p {
    max-width: 720px;
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
}

.hero-actions,
.form-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* ---------- BUTTONS ---------- */
.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 10px;
    font: 800 13px var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #00aaff);
    border: none;
    box-shadow: 0 4px 16px rgba(29, 106, 255, 0.3);
}

.primary-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.secondary-btn {
    color: var(--accent-2);
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    border-color: var(--glass-border-hover);
    color: var(--electric);
}

/* ---------- STATUS CARD ---------- */
.status-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.status-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-card strong {
    display: block;
    margin: 12px 0 8px;
    color: var(--electric);
    font-size: 36px;
    font-weight: 800;
}

.status-card small {
    color: var(--muted);
    line-height: 1.6;
    font-size: 13px;
}

/* ---------- GLOW DIVIDER ---------- */
.glow-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--electric), transparent);
    margin: 4px 0 14px;
    opacity: 0.3;
    border: none;
}

/* ---------- ROAD UPDATE ---------- */
.road-update-panel {
    margin: 0 0 16px;
}

.road-update-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.road-update-card {
    padding: 18px;
    transition: border-color 0.2s, transform 0.2s;
}

.road-update-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.road-update-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.road-update-card h3 {
    margin: 0;
    font-size: 15px;
    color: var(--text-strong);
}

.road-update-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.road-update-card a {
    color: var(--electric);
    font-weight: 800;
    font-size: 13px;
}

.update-time {
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 700;
}

/* ---------- CONTENT GRID (info cards) ---------- */
.content-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.info-card {
    min-height: 200px;
    display: block;
    padding: 18px;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.info-card:hover {
    border-color: var(--glass-border-hover);
    background: var(--glass-hover);
    transform: translateY(-3px);
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    background: rgba(29, 106, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 22px;
}

.info-card h2 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-strong);
}

.info-card p {
    color: var(--muted);
    line-height: 1.65;
    font-size: 13px;
}

.info-card strong {
    color: var(--electric);
    font-weight: 800;
    font-size: 13px;
}

/* ---------- SECTION HEADING ---------- */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-strong);
}

.section-heading a {
    color: var(--electric);
    font-weight: 800;
    font-size: 13px;
}

/* ---------- DETAIL PAGE ---------- */
.detail-page {
    max-width: 640px;
}

.back-link {
    display: inline-flex;
    margin-bottom: 16px;
    color: var(--electric);
    font-weight: 800;
    font-size: 13px;
}

.detail-panel {
    padding: 22px;
    margin-bottom: 16px;
}

.detail-panel h1 {
    font-size: 26px;
    line-height: 1.2;
    color: var(--text-strong);
}

/* ---------- TOLL CALCULATOR ---------- */
.toll-calculator {
    margin-top: 14px;
}

.toll-calculator .primary-btn {
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-box {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(29, 106, 255, 0.04);
    font-size: 13px;
}

/* ---------- DETAIL LIST ---------- */
.detail-list {
    display: grid;
    gap: 10px;
}

.section-line {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted-2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.section-line::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

/* ---------- ROUTE / EMERGENCY / PLACE CARDS ---------- */
.route-card,
.emergency-card,
.place-row {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px;
    transition: border-color 0.2s, transform 0.2s;
}

.route-card:hover,
.emergency-card:hover,
.place-row:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.route-card {
    justify-content: space-between;
}

.route-card h2,
.emergency-card h2,
.place-row h2 {
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--text-strong);
}

.route-card > strong {
    color: var(--electric);
    white-space: nowrap;
    font-family: var(--mono);
    font-size: 14px;
}

.mini-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
}

.mini-meta a,
.place-body a {
    color: var(--electric);
    font-weight: 800;
}

/* ---------- STATUS PILLS ---------- */
.status-pill {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.status-pill.lancar {
    color: var(--green);
    background: rgba(16, 185, 129, 0.12);
}

.status-pill.padat {
    color: var(--amber);
    background: rgba(245, 158, 11, 0.12);
}

/* ---------- EMERGENCY ---------- */
.danger-list {
    max-width: 560px;
    margin: 0 auto;
}

.emergency-card {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.04);
}

.emergency-icon,
.place-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    background: rgba(29, 106, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font-size: 22px;
}

.emergency-body {
    flex: 1;
}

.emergency-body strong {
    color: var(--electric);
    font-size: 14px;
}

.emergency-body p,
.place-body p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.call-btn {
    padding: 10px 18px;
    color: #fff;
    background: var(--red);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transition: opacity 0.2s;
}

.call-btn:hover {
    opacity: 0.85;
}

/* ---------- FILTER CHIPS ---------- */
.filter-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 4px;
}

.filter-chip {
    flex: 0 0 auto;
    padding: 8px 18px;
    color: var(--muted);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font: 800 12px var(--font);
    cursor: pointer;
    backdrop-filter: var(--blur);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.filter-chip.active,
.filter-chip:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #00aaff);
    border-color: transparent;
}

/* ---------- PLACE ROW ---------- */
.place-row {
    align-items: flex-start;
}

.place-body {
    min-width: 0;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.small-tag {
    padding: 3px 10px;
    color: var(--muted);
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.small-tag.warning {
    color: var(--amber);
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
}

/* ---------- LATEST SECTION ---------- */
.latest-section {
    margin-top: 24px;
}

.upload-card,
.empty-state {
    padding: 18px;
    margin-bottom: 12px;
}

.upload-meta {
    color: var(--muted-2);
    font: 500 12px var(--mono);
    margin-bottom: 8px;
}

.upload-card h3 {
    margin-bottom: 8px;
    color: var(--text-strong);
}

.upload-card p {
    color: var(--muted);
    line-height: 1.65;
    font-size: 14px;
}

.upload-card img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-top: 12px;
}

/* ---------- FORMS ---------- */
input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    margin: 0 0 12px;
    padding: 11px 14px;
    color: var(--text);
    background: rgba(29, 106, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    font: 500 14px var(--font);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

label {
    display: block;
    margin: 8px 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 106, 255, 0.12);
}

/* ---------- AUTH PAGE ---------- */
.auth-page {
    max-width: 520px;
}

.auth-panel {
    padding: 32px;
}

.auth-panel h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.auth-panel p {
    color: var(--muted);
    margin-bottom: 20px;
    font-size: 14px;
}

.form-links {
    margin-top: 16px;
}

.form-links a {
    color: var(--electric);
    font-size: 13px;
    font-weight: 700;
}

/* ---------- DASHBOARD ---------- */
.dashboard-page {
    max-width: 860px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 24px;
}

.dashboard-header h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.dashboard-header p {
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.form-panel {
    padding: 24px;
    margin-bottom: 16px;
}

.form-panel h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-strong);
}

/* ---------- ALERTS ---------- */
.alert {
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
}

.alert.error {
    color: var(--red);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert.success {
    color: var(--green);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
    .hero,
    .road-update-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .info-card {
        min-height: auto;
    }
}

@media (max-width: 620px) {
    .site-header,
    .dashboard-header,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    h1 {
        font-size: 28px;
    }

    .route-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .emergency-card {
        align-items: flex-start;
    }

    .call-btn {
        align-self: center;
    }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
