/* ═══════════════════════════════════════════
   nearby.css — Ayesha Dispensary Location Page
   Matches existing site color theme exactly
   Primary: #6884d3  |  Dark: #4a66b0  |  Light: #8fa4e0
═══════════════════════════════════════════ */

:root {
    --primary:   #6884d3;
    --dark:      #4a66b0;
    --light:     #8fa4e0;
    --lightest:  #e8ecff;
    --white:     #ffffff;
    --gray-bg:   #f5f7ff;
    --text:      #333333;
    --shadow:    0 4px 20px rgba(104, 132, 211, 0.15);
    --shadow-hover: 0 8px 30px rgba(104, 132, 211, 0.28);
}

/* ── STATS BAR ── */
.stats-bar-section {
    background: white;
    border-bottom: 1px solid #e2e8ff;
}

.stat-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--gray-bg);
    border: 1px solid #dce4ff;
    border-radius: 12px;
    padding: 14px 18px;
    transition: box-shadow 0.3s, transform 0.3s;
    text-align: center;
}

.stat-pill:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-pill i {
    font-size: 22px;
    color: var(--primary);
    width: 28px;
    text-align: center;
}

.stat-pill div {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.stat-num {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
}

.stat-txt {
    font-size: 11px;
    color: #9aa5c4;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── MAP SECTION ── */
.map-section { background: var(--gray-bg); }

.map-outer {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    border: 1px solid #dce4ff;
    position: relative;
    background: white;
}

.map-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
    background: white;
    border-bottom: 1px solid #e8edff;
}

.map-title {
    font-weight: 700;
    color: var(--dark);
    font-size: 15px;
}

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

.map-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-bg);
    border: 1px solid #dce4ff;
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7db3;
}

.status-dot {
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.3); }
}

.locate-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.locate-btn:hover {
    background: var(--dark);
    transform: translateY(-1px);
}

/* IMPORTANT: leaflet map needs an explicit, non-zero height or it renders blank/grey */
#tig-map {
    height: 480px;
    width: 100%;
    z-index: 1;
}

/* Location permission overlay */
.loc-overlay {
    position: absolute;
    inset: 60px 0 0 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.loc-prompt-card {
    text-align: center;
    padding: 40px;
    max-width: 380px;
}

.loc-icon {
    width: 70px; height: 70px;
    background: var(--lightest);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: var(--primary);
}

.loc-prompt-card h4 {
    color: var(--dark);
    font-weight: 700;
    margin-bottom: 10px;
}

.loc-prompt-card p {
    color: #7a8ab0;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.skip-link {
    display: inline-block;
    margin-top: 14px;
    font-size: 13px;
    color: #9aa5c4;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.skip-link:hover { color: var(--primary); }

/* Leaflet popup custom */
.dist-popup .leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid #dce4ff;
}

/* ── ROUTE INFO PANEL (turn-by-turn) ── */
.route-info-panel {
    background: white;
    padding: 16px 20px;
    border-top: 2px solid var(--primary);
    display: none;
    max-height: 250px;
    overflow-y: auto;
}
.route-info-panel.active { display: block; }

.route-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8edff;
    margin-bottom: 12px;
}
.route-summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}
.route-summary-item i { color: var(--primary); font-size: 18px; }
.route-summary-item span { color: var(--text); font-weight: 400; }

.route-steps {
    padding: 0;
    margin: 0;
    list-style: none;
}
.route-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f4ff;
    font-size: 13px;
    color: var(--text);
}
.route-step:last-child { border-bottom: none; }
.route-step-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: var(--lightest);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--primary);
    font-weight: 700;
}
.route-step-text { flex: 1; }
.route-step-distance {
    font-size: 11px;
    color: #9aa5c4;
    font-weight: 600;
    white-space: nowrap;
}

/* ── CENTERS / DISPENSARY CARD SECTION ── */
.centers-section { background: var(--gray-bg); }

.section-title h2 { color: var(--dark); }

.center-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.center-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.center-card-header {
    padding: 20px 22px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #6884d3, #4a66b0);
}

.center-icon-wrap {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.center-badge {
    background: rgba(255,255,255,0.25);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.center-card-body {
    padding: 18px 22px;
    flex: 1;
}

.center-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 6px;
}

.center-area {
    color: #7a8ab0;
    font-size: 13px;
    margin-bottom: 12px;
}
.center-area i { color: var(--primary); }

.center-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.center-meta span {
    font-size: 12px;
    color: #7a8ab0;
    font-weight: 600;
}
.center-meta i { color: var(--primary); }

.vaccine-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.vtag {
    background: var(--lightest);
    color: var(--dark);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid #c9d3f5;
}

.center-distance {
    font-size: 12px;
    color: #9aa5c4;
    font-weight: 600;
    padding: 8px 0;
    border-top: 1px solid #f0f4ff;
}
.center-distance.has-distance {
    color: var(--primary);
    font-weight: 700;
}

.center-card-footer {
    padding: 14px 22px;
    border-top: 1px solid #f0f4ff;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.center-card-footer .btn {
    font-size: 12px;
    font-weight: 600;
}

/* ── VIEW ON MAP BUTTON ── */
.view-map-btn-container {
    text-align: center;
    padding: 40px 0 60px 0;
    background: var(--gray-bg);
}
.view-map-btn {
    background: #ffffff;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}
.view-map-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* ── APPOINTMENT FLOATING BAR ── */
.appointment-floating-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 850px;
    background: #ffffff;
    padding: 18px 30px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #eaeaea;
    z-index: 999;
}
.appointment-text h4 {
    color: #333;
    font-size: 18px;
    margin-bottom: 4px;
}
.appointment-text p {
    color: #666;
    font-size: 14px;
}
.btn-book-now {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}
.btn-book-now:hover {
    background: var(--dark);
    color: white;
}

/* ── MAP / SATELLITE TOGGLE — custom button control ──
   Plain <button> elements (built in nearby.js via L.Control.extend),
   NOT Leaflet's native radio-based layer control. This avoids the site's
   global `* { margin:0; padding:0; }` reset and Bootstrap's form-control
   styles from collapsing native <input type="radio"> to zero size —
   which is exactly what was making the old control render as an empty
   blank box. */
.map-layer-toggle {
    display: flex;
    background: #ffffff;
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(104, 132, 211, 0.25);
    border: 1px solid #dce4ff;
    gap: 2px;
}

.map-toggle-btn {
    border: none;
    background: transparent;
    color: #4a66b0;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.25s ease, color 0.25s ease;
    font-family: Arial, sans-serif;
}

.map-toggle-btn:hover {
    background: #eef2ff;
}

.map-toggle-btn.active {
    background: #6884d3;
    color: #ffffff;
}

/* Dark theme — toggle buttons */
body.dark-theme .map-layer-toggle {
    background: #151a28;
    border: 1px solid #2a3348;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

body.dark-theme .map-toggle-btn {
    color: #a9b3cc;
}

body.dark-theme .map-toggle-btn:hover {
    background: #1c2338;
}

body.dark-theme .map-toggle-btn.active {
    background: #6884d3;
    color: #ffffff;
}

/* ── ROUTE INFO PANEL (distance / time / turn-by-turn steps) —
   dark theme fix. This block was accidentally dropped when nearby.css
   was rewritten for the custom Map/Satellite toggle — restored here. ── */
body.dark-theme .route-info-panel {
    background-color: #151a28 !important;
    border-top: 2px solid #6884d3 !important;
}

body.dark-theme .route-summary {
    border-bottom: 1px solid #2a3348 !important;
}

body.dark-theme .route-summary-item {
    color: #8fa4e0 !important;
}

body.dark-theme .route-summary-item i {
    color: #8fa4e0 !important;
}

body.dark-theme .route-summary-item span {
    color: #e8e8e8 !important;
}

body.dark-theme .route-step {
    color: #e8e8e8 !important;
    border-bottom: 1px solid #2a3348 !important;
}

body.dark-theme .route-step-text {
    color: #e8e8e8 !important;
}

body.dark-theme .route-step-icon {
    background: rgba(104, 132, 211, 0.18) !important;
    color: #8fa4e0 !important;
}

body.dark-theme .route-step-distance {
    color: #a9b3cc !important;
}

body.dark-theme .map-status-badge {
    color: #c3cbe0 !important;
}

body.dark-theme .stat-pill {
    background-color: #151a28 !important;
    border-color: #2a3348 !important;
}

body.dark-theme .stat-txt {
    color: #a9b3cc !important;
}

/* ── ZOOM CONTROL (+/-) — dark theme fix ──
   Targets every element Leaflet actually generates for this control
   (the wrapping bar, both buttons individually, and the inner span
   holding the +/- symbol) with high-specificity + !important, so a
   generic "a { color: ... }" rule from Bootstrap/global CSS can never
   win regardless of load order. */
body.dark-theme .leaflet-control-zoom.leaflet-bar {
    border: 1px solid #2a3348 !important;
}

body.dark-theme .leaflet-control-zoom a,
body.dark-theme .leaflet-control-zoom-in,
body.dark-theme .leaflet-control-zoom-out {
    background-color: #151a28 !important;
    color: #e8e8e8 !important;
    border-color: #2a3348 !important;
}

body.dark-theme .leaflet-control-zoom a span {
    color: #e8e8e8 !important;
}

body.dark-theme .leaflet-control-zoom a:hover,
body.dark-theme .leaflet-control-zoom-in:hover,
body.dark-theme .leaflet-control-zoom-out:hover {
    background-color: #1c2338 !important;
}

body.dark-theme .leaflet-control-attribution {
    background: rgba(11, 13, 18, 0.75) !important;
    color: #a9b3cc !important;
}

body.dark-theme .leaflet-control-attribution a {
    color: #8fa4e0 !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    #tig-map { height: 320px; }

    .map-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .stat-pill { padding: 10px 12px; }
    .stat-num  { font-size: 16px; }

    .route-summary { gap: 10px; }
    .route-summary-item { font-size: 12px; }

    .appointment-floating-bar {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        bottom: 15px;
        padding: 20px 15px;
        width: 95%;
    }

    .map-toggle-btn span,
    .map-toggle-btn { font-size: 11px; padding: 6px 10px; }
}

@media (max-width: 480px) {
    .center-card-footer { flex-direction: column; }
    .center-card-footer .btn { width: 100%; text-align: center; }
    .stat-pill { flex-direction: column; gap: 4px; padding: 10px 8px; }
    .stat-pill i { font-size: 18px; }
    .stat-num { font-size: 14px; }
    .stat-txt { font-size: 10px; }
}