:root {
    --brand: #0f5b43;
    --brand-dark: #083d2d;
    --brand-soft: #e9f4ef;
    --accent: #ee5d3b;
    --ink: #17212b;
    --muted: #667085;
    --line: #e7e9ed;
    --surface: #ffffff;
    --background: #f5f7f9;
    --shadow: 0 14px 34px rgba(20, 30, 55, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--background);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.screen {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px;
}


/* =========================================
   HOME / CITY SCREEN
   ========================================= */

.city-screen {
    min-height: 100vh;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;

    padding: 20px 28px;
    margin-bottom: 18px;

    border-radius: 22px;

    background:
        radial-gradient(
            circle at top right,
            rgba(255,255,255,0.16),
            transparent 38%
        ),
        linear-gradient(
            135deg,
            var(--brand-dark),
            var(--brand)
        );

    color: #fff;
    box-shadow: var(--shadow);
}


.hero h1 {
    font-size: 34px;
    line-height: 1.05;
    margin: 0;
}


.hero p {
    max-width: 650px;
    margin: 8px 0 0;

    font-size: 14px;
    line-height: 1.4;

    color: rgba(255,255,255,0.82);
}


.hero .eyebrow {
    font-size: 10px;
    margin-bottom: 5px;
}


.hero-kpis {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(105px, 1fr)
    );

    gap: 10px;
    min-width: 230px;
}


.hero-kpi {
    padding: 13px 12px;

    border-radius: 16px;

    text-align: center;

    background:
        rgba(255,255,255,0.12);

    backdrop-filter: blur(10px);
}


.hero-kpi strong {
    display: block;
    font-size: 21px;
}


.hero-kpi span {
    display: block;

    margin-top: 3px;

    font-size: 11px;

    color:
        rgba(255,255,255,0.76);
}

.selector-card {
    padding: 30px;
    background: var(--surface);
    border-radius: 26px;
    box-shadow: var(--shadow);
}

.selector-card h2 {
    margin: 0;
    font-size: 28px;
    text-align: center;
}

.section-subtitle {
    text-align: center;
    color: var(--muted);
    margin: 7px 0 24px;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.city-card {
    position: relative;
    min-height: 145px;
    padding: 22px 18px;
    border: 1px solid transparent;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(20, 30, 55, 0.08);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.city-card:hover {
    transform: translateY(-4px);
    border-color: rgba(15, 91, 67, 0.25);
    box-shadow: 0 16px 34px rgba(20, 30, 55, 0.12);
}

.city-icon {
    display: block;
    font-size: 38px;
    margin-bottom: 13px;
}

.city-card strong {
    display: block;
    font-size: 18px;
}

.city-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.city-card.empty {
    opacity: 0.62;
}

.location-card {
    width: min(620px, 100%);
    margin: 24px auto 0;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 0;
    border-radius: 18px;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.location-icon {
    font-size: 30px;
}

.location-card-copy {
    flex: 1;
    text-align: left;
}

.location-card-copy strong,
.location-card-copy small {
    display: block;
}

.location-card-copy small {
    color: #547368;
    margin-top: 3px;
}

.location-arrow {
    font-size: 23px;
}


/* =========================================
   DASHBOARD
   ========================================= */

.dashboard-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.dashboard-title .eyebrow {
    color: var(--brand);
}

.dashboard-title h1 {
    font-size: clamp(25px, 3vw, 36px);
}

.back-button,
.primary-button,
.secondary-button {
    border-radius: 12px;
    padding: 11px 16px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 700;
}

.primary-button {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.primary-button.compact {
    white-space: nowrap;
}

.secondary-button:hover,
.back-button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.kpi-card {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(20, 30, 55, 0.045);
}

.kpi-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 7px;
}

.kpi-card strong {
    font-size: 23px;
}

.location-status-card strong {
    font-size: 15px;
    line-height: 1.35;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 220px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.search-box input {
    width: 100%;
    padding: 11px 0;
    border: 0;
    outline: 0;
    background: transparent;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    font-weight: 650;
    white-space: nowrap;
}

.toggle input {
    position: absolute;
    opacity: 0;
}

.toggle-ui {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #d0d5dd;
    transition: 0.2s;
}

.toggle-ui::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 3px;
    left: 3px;
    border-radius: 50%;
    background: #fff;
    transition: 0.2s;
}

.toggle input:checked + .toggle-ui {
    background: var(--brand);
}

.toggle input:checked + .toggle-ui::after {
    transform: translateX(18px);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(330px, 0.65fr);
    gap: 14px;
    min-height: 650px;
}

.map-panel,
.list-panel {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 650px;
}

.map-legend {
    position: absolute;
    z-index: 5;
    top: 14px;
    left: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 12px;
    background: rgba(255,255,255,0.94);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.map-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.shiva-dot {
    background: #d94b36;
}



.me-dot {
    background: #14a36f;
}

.map-message {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 10;
    transform: translate(-50%, -50%);
    max-width: 390px;
    padding: 18px;
    border-radius: 14px;
    text-align: center;
    background: rgba(255,255,255,0.97);
    box-shadow: var(--shadow);
}

.list-panel {
    display: flex;
    flex-direction: column;
}

.list-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--line);
}

.list-header h2 {
    margin: 0;
    font-size: 19px;
}

.list-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.result-count {
    min-width: 38px;
    padding: 7px 9px;
    text-align: center;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}

.temple-list {
    flex: 1;
    overflow-y: auto;
    max-height: 588px;
}

.temple-item {
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    transition: background 0.15s;
}

.temple-item:hover {
    background: #f8faf9;
}

.temple-row {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.temple-item h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
}

.temple-item p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.shiva {
    color: #a33526;
    background: #ffebe7;
}

.badge.other {
    color: #214b9a;
    background: #eaf1ff;
}

.distance {
    margin-top: 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}

.temple-actions {
    display: flex;
    gap: 8px;
    margin-top: 11px;
}

.mini-button {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 7px 9px;
    background: #fff;
    color: var(--ink);
    font-size: 11px;
    font-weight: 750;
}

.mini-button.primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}


/* =========================================
   MAP MARKERS / INFO WINDOW
   ========================================= */

.temple-marker {
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 10%;
    transform: rotate(-45deg);
    box-shadow: 0 5px 13px rgba(0,0,0,0.22);
}

.temple-marker > span {
    transform: rotate(45deg);
    font-size: 19px;
}

.temple-marker.shiva {
    background: #d94b36;
}

.temple-marker.other {
    background: #245fc7;
}

.user-marker {
    width: 24px;
    height: 24px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #14a36f;
    box-shadow:
        0 0 0 8px rgba(20,163,111,0.18),
        0 4px 12px rgba(0,0,0,0.2);
}

.info-card {
    max-width: 280px;
    padding: 3px 2px 4px;
}

.info-card h3 {
    margin: 0 0 7px;
    font-size: 16px;
    line-height: 1.3;
}

.info-meta {
    color: var(--muted);
    font-size: 12px;
    margin: 4px 0;
    line-height: 1.45;
}

.info-actions {
    display: flex;
    gap: 7px;
    margin-top: 11px;
}

.info-button {
    border: 0;
    border-radius: 8px;
    padding: 8px 9px;
    font-size: 11px;
    font-weight: 800;
}

.info-button.direction {
    background: var(--brand);
    color: #fff;
}

.info-button.maps {
    background: #eef1f4;
    color: var(--ink);
}


/* =========================================
   MESSAGES
   ========================================= */

.message {
    margin: 18px auto 0;
    max-width: 620px;
    padding: 12px 14px;
    border-radius: 11px;
    color: #8a3b2c;
    background: #fff2ef;
    text-align: center;
}


/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 1100px) {
    .city-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    #map {
        height: 520px;
    }

    .temple-list {
        max-height: 500px;
    }
}

@media (max-width: 820px) {
    .screen {
        padding: 14px;
    }

    .hero {
        display: block;
        padding: 24px;
    }

    .hero-kpis {
        min-width: 0;
        margin-top: 22px;
    }

    .city-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-header {
        grid-template-columns: auto 1fr;
    }

    .dashboard-header .primary-button {
        grid-column: 1 / -1;
    }

    .dashboard-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .secondary-button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .city-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .city-card {
        min-height: 126px;
        padding: 17px 14px;
    }

    .city-icon {
        font-size: 31px;
    }

    .city-card strong {
        font-size: 15px;
    }

    .hero-kpis {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .hero-kpi {
        padding: 13px 8px;
    }

    .hero-kpi strong {
        font-size: 20px;
    }

    .selector-card {
        padding: 20px 14px;
    }

    .dashboard-kpis {
        grid-template-columns: 1fr 1fr;
    }

    #map {
        height: 470px;
    }
}
