﻿/* =============================================================
   eventsummary.css
   Shared styles for EventSummary.cshtml & EventSummarySearch.cshtml
   ============================================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

/* =============================================================
   TYPOGRAPHY SYSTEM
   ============================================================= */

:root {
    /* Font Sizes */
    --fs-title: 22px;
    --fs-subtitle: 18px;
    --fs-label: 15px;
    --fs-body: 14px;
    --fs-small: 12px;
    /* Font Weights */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    /* Common Colors */
    --text-dark: #1a1a1a;
    --text-medium: #555;
    --text-heading: #7b1d3c;
}

/* ── Font scope ── */
body,
.db-wrap, .db-wrap input, .db-wrap select, .db-wrap button,
.db-wrap span, .db-wrap div, .db-wrap p, .db-wrap label, .db-wrap a,
.search-wrap, .search-wrap input, .search-wrap select, .search-wrap button,
.search-wrap span, .search-wrap div, .search-wrap p, .search-wrap label {
    font-family: 'DM Sans', sans-serif;
}

/* ── Page background ── */
.main-bg-color {
    background: var(--theme-bg-gray, #f7f3f0);
    padding: 0;
}

.event-summary-header {
    position: relative;
    width: 100%;
    min-height: 46vh;
    background-image: url('../images/EventSummaryHeader.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-color: #f7f7f7;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Mobile */
@media (max-width: 768px) {
    .event-summary-header {
        width: 100%;
        height: 140px !important;
        min-height: 140px !important;
        background-size: 100% 100% !important;
        background-position: center center;
        background-repeat: no-repeat;
        margin: 0 !important;
        overflow: hidden;
        padding: 0 !important;
    }

    .header-container {
        padding: 0 !important;
        margin: 0 !important;
    }

    .db-wrap {
        margin-top: 4px;
    }
}

/* ── Shared button base ── */
.btn-search,
.btn-reset,
.btn-more,
.more-btn {
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .2s;
    white-space: nowrap;
    display: inline-block;
    text-align: center;
}

.btn-search {
    background: #1a6bbf;
}

.btn-reset {
    background: #d63b2f;
}

.btn-more,
.more-btn {
    background: linear-gradient(90deg, #c73060, #e05a2b);
}

    .btn-search:hover,
    .btn-reset:hover,
    .btn-more:hover,
    .more-btn:hover {
        opacity: .88;
        color: #fff;
        text-decoration: none;
    }

/* ── No-results / loader ── */
.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* =============================================================
   EventSummary — Map + Stats dashboard
   ============================================================= */

.db-wrap {
    background: #f7f3f0;
    border-radius: 12px;
    overflow-x: hidden;
    overflow-y: visible;
    margin: 20px;
    position: relative;
    z-index: 1;
}

.db-header {
    background: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e8e0d8;
}

.db-title {
    font-size: var(--fs-title);
    font-weight: var(--fw-semibold);
    color: var(--text-heading);
    letter-spacing: -0.3px;
}

.db-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 520px;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: visible;
}

/* =========================
   MAP
========================= */

.map-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 26px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    width: fit-content;
    letter-spacing: -0.4px;
}

    .map-title i {
        font-size: 22px;
    }

.map-side {
    background: #fff;
    padding: 18px;
    position: relative;
    border-right: 1px solid #e8e0d8;
    overflow: hidden;
    z-index: 1;
}

#map {
    height: 650px;
    width: 100%;
    border-radius: 12px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: #f8f8f8;
    display: block;
}

/* Force Leaflet internals to never clip tooltips */
/*.leaflet-container,
.leaflet-pane,
.leaflet-map-pane,
.leaflet-overlay-pane,
.leaflet-tooltip-pane,
.leaflet-popup-pane,
.leaflet-marker-pane,
.leaflet-shadow-pane,
.leaflet-top,
.leaflet-bottom {
    overflow: visible !important;
}*/

.leaflet-tooltip-pane,
.leaflet-popup-pane {
    overflow: visible !important;
}

/* =============================================================
   ZOOM CONTROLS
   ============================================================= */

.zoom-controls {
    position: absolute;
    bottom: 30px;
    left: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    font-size: 20px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    line-height: 1;
    transition: all 0.15s ease;
}

    .zoom-btn:hover {
        background: #f3f3f3;
    }

/* =============================================================
   STATS SIDE
   ============================================================= */

.stats-side {
    background: #fff;
    padding: 30px 22px;
    display: flex;
    flex-direction: column;
}

.stats-label {
    font-size: var(--fs-label);
    font-weight: var(--fw-medium);
    color: var(--text-medium);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.taluka-title {
    font-size: var(--fs-title);
    font-weight: var(--fw-semibold);
    color: var(--text-heading);
    margin-bottom: 16px;
}

.taluka-select {
    width: 100%;
    border: 1px solid #d8cfc8;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 16px;
    font-family: inherit;
    color: #0e0d0d;
    background: #fff;
    margin-bottom: 16px;
    cursor: pointer;
}

/* =============================================================
   STAT CARDS
   ============================================================= */

.stat-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    border-radius: 10px;
    background: #fdf8f5;
    border: 1px solid #ede5dc;
    transition: background 0.15s ease;
}

    .stat-card:hover {
        background: #fdf0e8;
    }

.stat-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.stat-name {
    font-size: var(--fs-label);
    font-weight: var(--fw-medium);
    color: var(--text-medium);
}

.stat-val {
    font-size: var(--fs-subtitle);
    font-weight: var(--fw-semibold);
    color: var(--text-dark);
    min-width: 40px;
    text-align: right;
}

.more-btn {
    margin-top: 18px;
    width: 100%;
    padding: 12px 0;
    font-size: 18px;
    letter-spacing: 0.2px;
    border-radius: 10px;
}

/* =============================================================
   COUNT LINKS
   ============================================================= */

.count-link {
    text-decoration: underline;
    color: #1a1a1a;
    cursor: pointer;
}

    .count-link:hover {
        color: #a41c73;
    }

/* =============================================================
   LEAFLET OVERRIDES
   ============================================================= */

.leaflet-control-attribution,
.leaflet-control-zoom {
    display: none !important;
}

.leaflet-tooltip-pane {
    z-index: 99999 !important;
    overflow: visible !important;
}

/* =============================================================
   TOOLTIP
   ============================================================= */

.leaflet-taluka-tooltip,
.leaflet-taluka-tooltip * {
    pointer-events: none !important;
}

.leaflet-taluka-tooltip {
    background: #3d1a2e;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    min-width: 190px;
    z-index: 999999 !important;
}

    .leaflet-taluka-tooltip::before {
        display: none;
    }

.tt-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #f5c08a;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    letter-spacing: 0.2px;
}

.tt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #e8d5c4;
    padding: 2px 0;
    gap: 16px;
}

    .tt-row span:last-child {
        font-weight: 600;
        color: #fff;
    }

/* =============================================================
   EventSummarySearch — Facility search & results
   ============================================================= */

.search-wrap {
    background: #fff;
    border: 1px solid #e0d6ce;
    border-radius: 18px;
    padding: 18px 22px;
    width: 92%;
    max-width: 1200px;
    margin: 14px auto 0;
    position: relative;
    z-index: 2;
}

.search-title {
    font-size: 15px;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

.search-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-select {
    border: 1px solid #b0a8a0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 15px;
    color: #333;
    background: #fff;
    flex: 1 1 180px;
    min-width: 0;
}

/* Results */

.results-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px 0 46px;
}

.facility-card {
    background: #fff;
    border: 1px solid #e0d6ce;
    border-radius: 18px;
    padding: 18px 22px;
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
}

.facility-name {
    font-size: var(--fs-subtitle);
    font-weight: var(--fw-semibold);
    color: #c73060;
    margin-bottom: 14px;
    text-transform: uppercase;
    word-break: break-word;
}

.facility-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 20px;
}

.facility-field {
    font-size: var(--fs-body);
    font-weight: var(--fw-regular);
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

    .facility-field b {
        color: #000;
    }

.facility-footer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0e8e0;
    align-items: center;
}

.btn-direction {
    background: #d63b2f;
    color: #fff;
    border-radius: 6px;
    padding: 7px 16px;
    text-decoration: none;
    justify-self: end;
    font-size: 14px;
    white-space: nowrap;
}

    .btn-direction:hover {
        background: #1a6bbf;
        color: #fff;
    }

/* Pagination */

.pagination-wrap {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.page-btn {
    border: 1px solid #d8cfc8;
    background: #fff;
    color: #555;
    border-radius: 8px;
    padding: 8px 14px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
}

    .page-btn:hover,
    .page-btn.active {
        background: #c73060;
        color: #fff;
        border-color: #c73060;
    }

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

@media (max-width: 900px) {

    .db-body {
        grid-template-columns: 1fr;
        overflow: visible !important;
    }

    .map-side {
        border-right: none;
        border-bottom: 1px solid #e8e0d8;
    }

    #map {
        height: 420px;
    }

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

    .btn-direction {
        justify-self: start;
    }
}

@media (max-width: 580px) {
    .db-body {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    .db-wrap {
        margin: 8px !important;
    }

    .map-side {
        width: 100% !important;
        max-width: 100% !important;
        padding: 8px !important;
        border-right: none !important;
    }

    .map-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

        .map-title i {
            font-size: 18px;
        }

    .header-img {
        width: 100%;
        height: auto;
    }

    #map {
        width: 100% !important;
        height: 340px !important;
        min-height: 340px !important;
    }

    .search-wrap,
    .facility-card {
        width: 96%;
        padding: 14px;
    }

    .search-controls {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .search-select,
    .btn-search,
    .btn-reset {
        width: 100%;
        max-width: 100%;
        flex: unset;
    }

    .search-select {
        font-size: 14px;
    }

    .btn-search,
    .btn-reset,
    .btn-more {
        width: 100%;
        text-align: center;
    }

    .facility-grid,
    .facility-footer {
        grid-template-columns: 1fr;
    }

    .facility-name {
        font-size: 16px;
    }

    .btn-direction {
        justify-self: stretch;
        text-align: center;
    }

    .stat-name {
        font-size: 14px;
    }

    .stat-val {
        font-size: 15px;
    }

    .taluka-title {
        font-size: 18px;
    }

    .leaflet-taluka-tooltip {
        min-width: 150px;
        padding: 7px 10px;
    }

    .tt-name {
        font-size: 11px;
    }

    .tt-row {
        font-size: 10px;
        gap: 8px;
    }
}
