﻿
/* ========================================
   EVENT DISCOVERY LAYOUT
   ======================================== */

.event-discovery-page {
    display: grid;
    grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
    min-height: calc(100vh - 72px);
    background: #F3F4F6;
    font-family: "Poppins", sans-serif;
    color: #111827;
}

.event-discovery-list {
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    border-right: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.event-discovery-map {
    position: relative;
    min-width: 0;
    height: calc(100vh - 72px);
    overflow: hidden;
}

.event-discovery-map-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.event-discovery-map-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 500;
    display: flex;
    width: min(300px, calc(100% - 32px));
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 22px;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    color: #6B7280;
    text-align: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
    pointer-events: none;
}

    .event-discovery-map-empty i {
        color: #7C3AED;
        font-size: 30px;
    }

    .event-discovery-map-empty strong {
        color: #111827;
        font-size: 14px;
    }

    .event-discovery-map-empty span {
        font-size: 11px;
        line-height: 1.5;
    }

.event-discovery-mobile-toggle {
    display: none;
}

/* ========================================
   EVENT LIST PANEL
   ======================================== */

.event-list-panel {
    width: 100%;
    padding: 20px 16px 28px;
}

.event-list-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

    .event-list-panel-header h1 {
        margin: 0 0 4px;
        color: #111827;
        font-size: 21px;
        font-weight: 700;
    }

    .event-list-panel-header p {
        margin: 0;
        color: #6B7280;
        font-size: 12px;
    }

.event-list-panel-count {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: #EDE9FE;
    color: #7C3AED;
    font-size: 11px;
    font-weight: 600;
}

.event-list-panel-results {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ========================================
   EVENT CARD
   ======================================== */

.event-list-card {
    overflow: hidden;
    width: 100%;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 5px 16px rgba(17, 24, 39, 0.05);
}

.event-list-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #F3F4F6;
}

    .event-list-card-cover img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.event-list-card-cover-empty {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6B7280;
    font-size: 12px;
}

    .event-list-card-cover-empty i {
        color: #7C3AED;
        font-size: 30px;
    }

.event-list-card-status {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #10B981;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(17, 24, 39, 0.12);
}

.event-list-card-content {
    padding: 15px;
}

/* Event Categories */

.event-list-card-categories {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    overflow: hidden;
}

    .event-list-card-categories span {
        min-width: 0;
        overflow: hidden;
        padding: 5px 9px;
        border-radius: 6px;
        background: #F3F4F6;
        color: #374151;
        font-size: 10px;
        font-weight: 600;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* Event Title and Description */

.event-list-card-title {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 6px;
    color: #111827;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-width: 0;
    overflow-wrap: anywhere;
}

.event-list-card-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 12px;
    color: #6B7280;
    font-size: 12px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Event Location */

.event-list-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 13px;
    color: #4B5563;
    font-size: 11px;
}

    .event-list-card-meta > span {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 6px;
    }

        .event-list-card-meta > span:last-child {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .event-list-card-meta i {
        flex-shrink: 0;
        color: #6B7280;
    }

.event-list-card-location {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
    gap: 6px;
}

    .event-list-card-location i {
        flex-shrink: 0;
    }

.event-list-card-location-text {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   PHILIPPINE TIME CARD
   ======================================== */

.event-list-card-time {
    padding: 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #F9FAFB;
}

.event-list-card-time-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

    .event-list-card-time-header > span:first-child {
        color: #374151;
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

.event-list-card-time-zone {
    justify-self: end;
    padding: 4px 7px;
    border-radius: 5px;
    background: #E5E7EB;
    color: #374151;
    font-size: 9px;
    font-weight: 600;
}

.event-list-card-time > strong {
    display: block;
    margin-bottom: 2px;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.event-list-card-time > span:last-child {
    display: block;
    color: #111827;
    font-size: 12px;
    font-weight: 600;
}

/* ========================================
   EVENT CARD ACTIONS
   ======================================== */

.event-list-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

    .event-list-card-actions button,
    .event-list-card-actions a {
        display: inline-flex;
        min-width: 0;
        min-height: 38px;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 7px 6px;
        border: 1px solid #E5E7EB;
        border-radius: 7px;
        background: #F9FAFB;
        color: #374151;
        font-family: inherit;
        font-size: 10px;
        font-weight: 600;
        white-space: nowrap;
        text-decoration: none;
        cursor: pointer;
        transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    }

        .event-list-card-actions button:hover:not(:disabled),
        .event-list-card-actions a:hover {
            border-color: #C4B5FD;
            background: #F5F3FF;
            color: #7C3AED;
        }

        .event-list-card-actions button:focus-visible,
        .event-list-card-actions a:focus-visible {
            outline: 2px solid #7C3AED;
            outline-offset: 2px;
        }

    /* Reminder Actions */

    .event-list-card-actions [data-event-reminder] {
        border-color: #DDD6FE;
        background: #F5F3FF;
        color: #7C3AED;
    }

        .event-list-card-actions [data-event-reminder]:hover:not(:disabled) {
            border-color: #7C3AED;
            background: #EDE9FE;
            color: #6D28D9;
        }

        .event-list-card-actions [data-event-reminder].is-active {
            border-color: #7C3AED;
            background: #7C3AED;
            color: #FFFFFF;
        }

            .event-list-card-actions [data-event-reminder].is-active:hover:not(:disabled) {
                border-color: #6D28D9;
                background: #6D28D9;
                color: #FFFFFF;
            }

    .event-list-card-actions button:disabled {
        cursor: not-allowed;
        opacity: 0.55;
        transform: none;
    }

/* ========================================
   EVENT ORGANIZER
   ======================================== */

.event-list-card-organizer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid #E5E7EB;
}

.event-list-card-organizer-avatar {
    display: flex;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #EDE9FE;
    color: #7C3AED;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.event-list-card-organizer > div:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.event-list-card-organizer strong {
    overflow: hidden;
    color: #111827;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-list-card-organizer span {
    color: #9CA3AF;
    font-size: 10px;
}

.event-list-card-organizer-name {
    overflow: hidden;
    color: #111827;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    min-width: 0;
    max-width: 100%;
}

    .event-list-card-organizer-name:hover,
    .event-list-card-organizer-name:focus-visible {
        color: #7C3AED;
        text-decoration: underline;
    }

/* ========================================
   EMPTY STATE
   ======================================== */

.event-list-panel-empty {
    display: flex;
    min-height: 320px;
    padding: 32px 18px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed #D1D5DB;
    border-radius: 12px;
    background: #FFFFFF;
    text-align: center;
}

    .event-list-panel-empty > i {
        margin-bottom: 14px;
        color: #7C3AED;
        font-size: 34px;
    }

    .event-list-panel-empty h2 {
        margin: 0 0 7px;
        color: #111827;
        font-size: 16px;
        font-weight: 700;
    }

    .event-list-panel-empty p {
        max-width: min(100%, 280px);
        margin: 0;
        color: #6B7280;
        font-size: 12px;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }

/* ========================================
   PAGINATION
   ======================================== */

.event-list-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

.event-list-pagination-button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 11px;
    border: 1px solid #E5E7EB;
    border-radius: 7px;
    background: #FFFFFF;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

    .event-list-pagination-button:hover {
        border-color: #7C3AED;
        color: #7C3AED;
    }

    .event-list-pagination-button.is-disabled {
        color: #9CA3AF;
        pointer-events: none;
    }

.event-list-pagination-status {
    color: #6B7280;
    font-size: 10px;
    text-align: center;
    min-width: 0;
    overflow-wrap: anywhere;
}

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

.event-map-marker {
    display: flex;
    box-sizing: border-box;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #FFFFFF;
    border-radius: 50% 50% 50% 0;
    background: #7C3AED;
    color: #FFFFFF;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.28);
    transform: rotate(-45deg);
}

    .event-map-marker i {
        font-size: 15px;
        transform: rotate(45deg);
    }

    .event-map-marker img {
        display: block;
        width: 52px;
        height: 52px;
        flex: 0 0 29px;
        border-radius: 50%;
        object-fit: cover;
        transform: rotate(45deg);
    }

    .event-map-marker.has-image i {
        display: none;
    }

.event-map-cluster {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    background: #7C3AED;
    color: #FFFFFF;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.25);
}

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

.event-map-popup .leaflet-popup-content-wrapper {
    overflow: hidden;
    padding: 0;
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 12px 32px rgba(17, 24, 39, 0.2);
}

.event-map-popup .leaflet-popup-content {
    width: 288px !important;
    margin: 0;
}

.event-map-popup .leaflet-popup-tip {
    background: #FFFFFF;
}

.event-map-popup .leaflet-popup-close-button {
    top: 7px !important;
    right: 7px !important;
    z-index: 5;
    width: 28px !important;
    height: 28px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94) !important;
    color: #374151 !important;
    font-size: 19px !important;
    line-height: 1 !important;
}

.event-map-popup-card {
    overflow: hidden;
    width: 100%;
    background: #FFFFFF;
}

.event-map-popup-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 8;
    overflow: hidden;
    background: #F3F4F6;
}

    .event-map-popup-cover img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.event-map-popup-status {
    position: absolute;
    top: 11px;
    left: 11px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #10B981;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(17, 24, 39, 0.14);
}

.event-map-popup-content {
    padding: 14px 12px 12px;
}

.event-map-popup-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 9px;
}

    .event-map-popup-categories span {
        color: #7C3AED;
        font-size: 9px;
        font-weight: 600;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

        .event-map-popup-categories span:not(:last-child)::after {
            margin-left: 5px;
            color: #9CA3AF;
            content: "•";
        }

.event-map-popup-title {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 11px;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-width: 0;
    overflow-wrap: anywhere;
}

.event-map-popup-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 13px;
}

    .event-map-popup-meta span {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 7px;
        color: #4B5563;
        font-size: 10px;
        font-weight: 500;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    .event-map-popup-meta i {
        width: 13px;
        flex: 0 0 13px;
        color: #7C3AED;
        text-align: center;
    }

.event-map-popup-details {
    display: inline-flex;
    width: 100%;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    background: #7C3AED;
    color: #FFFFFF !important;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s ease;
}

    .event-map-popup-details:hover {
        background: #6D28D9;
    }

/* ========================================
   TABLET AND MOBILE EVENT DISCOVERY
   ======================================== */

@media (max-width: 900px) {

    .event-discovery-mobile-toggle {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
        padding: 8px 12px;
        border-bottom: 1px solid #E5E7EB;
        background: #FFFFFF;
    }

        .event-discovery-mobile-toggle button {
            min-height: 39px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            border: none;
            border-radius: 9px;
            background: transparent;
            color: #6B7280;
            font-family: inherit;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
        }

            .event-discovery-mobile-toggle button.is-active {
                background: #7C3AED;
                color: #FFFFFF;
            }

    .event-discovery-page {
        display: block;
        min-height: auto;
        height: 100%;
        min-height: 0;
    }

    .event-discovery-list {
        max-height: none;
        overflow: visible;
        border-right: none;
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
    }

    .event-discovery-map {
        width: 100%;
        height: calc(100vh - 132px);
        min-height: 500px;
        height: 100%;
        min-height: 0;
    }

    .event-discovery-page[data-mobile-view="list"] .event-discovery-map {
        display: none;
    }

    .event-discovery-page[data-mobile-view="map"] .event-discovery-list {
        display: none;
    }

    .event-list-panel {
        max-width: 560px;
        margin: 0 auto;
        padding: 20px 16px 32px;
    }
}

@media (max-width: 420px) {

    .event-list-card-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .event-list-card-actions {
        grid-template-columns: 1fr;
    }

        .event-list-card-actions button,
        .event-list-card-actions a {
            width: 100%;
        }
}

/* ========================================
   BOOKMARKED EVENTS PAGE
   ======================================== */

.bookmarked-events-page {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
}

    .bookmarked-events-page .bookmarked-events-panel {
        grid-column: 2;
        grid-row: 1;
        position: relative;
        border-right: none;
        border-left: 1px solid #E5E7EB;
        background: #F9FAFB;
        box-shadow: -10px 0 30px rgba(17, 24, 39, 0.08);
        z-index: 5;
    }

    .bookmarked-events-page .event-discovery-map {
        grid-column: 1;
        grid-row: 1;
    }

    .bookmarked-events-page .bookmarked-events-panel::before {
        content: "";
        position: absolute;
        top: -10px;
        right: 62px;
        z-index: 20;
        width: 18px;
        height: 18px;
        background: #F9FAFB;
        border-top: 1px solid #E5E7EB;
        border-left: 1px solid #E5E7EB;
        transform: rotate(45deg);
    }

/* Bookmarked Mobile Layout */

@media (max-width: 900px) {

    .bookmarked-events-page {
        display: block;
    }

        .bookmarked-events-page .bookmarked-events-panel {
            border-left: none;
            box-shadow: none;
        }

            .bookmarked-events-page .bookmarked-events-panel::before {
                display: none;
            }
}

/* Bookmarked Status Toast */

.bookmarked-status-toast {
    position: fixed;
    top: 84px;
    left: 50%;
    z-index: 1100;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 10px 15px;
    border: 1px solid #DDD6FE;
    border-radius: 12px;
    background: #FFFFFF;
    color: #5B21B6;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
    pointer-events: none;
}

    .bookmarked-status-toast i {
        color: #7C3AED;
        font-size: 14px;
    }

@media (max-width: 600px) {

    .bookmarked-status-toast {
        top: 82px;
        width: calc(100% - 24px);
        justify-content: center;
        text-align: center;
    }
}

/* ========================================
   EVENT DISCOVERY CATEGORY FILTERS
   ======================================== */

.event-category-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
}

.event-category-form {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

    .event-category-form::-webkit-scrollbar {
        display: none;
    }

/* Category Navigation */

.event-category-scroll-button {
    display: inline-flex;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #EDE9FE;
    border-radius: 9px;
    background: #F5F3FF;
    color: #7C3AED;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

    .event-category-scroll-button:hover:not(:disabled) {
        background: #EDE9FE;
        border-color: #C4B5FD;
    }

    .event-category-scroll-button:focus-visible {
        outline: 2px solid #7C3AED;
        outline-offset: 2px;
    }

    .event-category-scroll-button:disabled {
        opacity: 0.3;
        cursor: default;
    }

/* Category Chips */

.event-category-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 999px;
    background: #FFFFFF;
    color: #4B5563;
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    .event-category-chip:hover {
        border-color: #A78BFA;
        background: #F5F3FF;
    }

    .event-category-chip.is-selected {
        border-color: #7C3AED;
        background: #7C3AED;
        color: #FFFFFF;
    }

        .event-category-chip.is-selected:hover {
            background: #6D28D9;
        }

    .event-category-chip:has(input:focus-visible) {
        outline: 2px solid #7C3AED;
        outline-offset: 2px;
    }

    .event-category-chip input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

/* ========================================
   MOBILE CATEGORY AND PAGE PROTECTION
   ======================================== */

@media (max-width: 768px) {

    .event-category-bar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        padding: 8px 12px;
    }

    .event-category-scroll-button {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

    .event-category-form {
        flex: 1 1 0;
        width: 0;
        min-width: 0;
        max-width: 100%;
        flex-wrap: nowrap;
        gap: 6px;
        overscroll-behavior-x: contain;
        touch-action: pan-x;
    }

    .event-category-chip {
        min-height: 30px;
        flex-shrink: 0;
        padding: 5px 12px;
        font-size: 11px;
        white-space: nowrap;
    }

    .event-discovery-page,
    .event-discovery-list,
    .event-discovery-list-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .event-discovery-map {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .event-discovery-map-canvas {
        width: 100%;
        max-width: 100%;
    }

    .event-list-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

/* ========================================
   DESKTOP EVENT LIST — VERTICAL PEEK
   ======================================== */

@media (min-width: 901px) {

    .event-discovery-page {
        --event-list-width: clamp(360px, 32vw, 430px);
        --event-spine-width: 42px;
        --event-animation-duration: 480ms;
        --event-animation-easing: cubic-bezier(0.22, 1, 0.36, 1);
        grid-template-columns: var(--event-list-width) minmax(0, 1fr);
        transition: grid-template-columns var(--event-animation-duration) var(--event-animation-easing);
    }

    /* Event List Container */

    .event-discovery-list {
        position: relative;
        display: flex;
        min-width: 0;
        overflow: hidden;
    }

    /* Event List Content */

    .event-discovery-list-content {
        box-sizing: border-box;
        flex: 0 0 calc(var(--event-list-width) - var(--event-spine-width));
        width: calc(var(--event-list-width) - var(--event-spine-width));
        min-width: 0;
        overflow-x: hidden;
        overflow-y: auto;
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        transition: opacity 260ms ease, transform 440ms var(--event-animation-easing), visibility 0s linear 0s;
    }

    /* Permanent Vertical Spine */

    .event-discovery-list-spine {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: var(--event-spine-width);
        min-width: var(--event-spine-width);
        height: 100%;
        padding: 0;
        border: none;
        border-left: 1px solid #EDE9FE;
        background: #FFFFFF;
        color: #7C3AED;
        cursor: pointer;
        transition: background-color 200ms ease, border-color 200ms ease;
    }

        .event-discovery-list-spine:hover {
            background: #F7F4FF;
        }

        .event-discovery-list-spine:focus-visible {
            outline: 2px solid #7C3AED;
            outline-offset: -3px;
        }

        /* Spine Arrow */

        .event-discovery-list-spine i {
            position: absolute;
            top: 50%;
            left: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 27px;
            height: 27px;
            border-radius: 8px;
            background: #F3EFFF;
            color: #7C3AED;
            font-size: 12px;
            line-height: 1;
            transform: translate(-50%, -50%) rotate(0deg);
            transition: transform 440ms var(--event-animation-easing), background-color 200ms ease;
        }

        .event-discovery-list-spine:hover i {
            background: #E9E0FF;
        }

    /* Vertical Event Count */

    .event-discovery-list-spine-text {
        position: absolute;
        top: 20px;
        left: 50%;
        writing-mode: vertical-rl;
        white-space: nowrap;
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 1.1px;
        line-height: 1;
        color: #7C3AED;
        opacity: 0;
        visibility: hidden;
        transform: translateX(-50%) rotate(180deg) translateY(8px);
        transition: opacity 220ms ease, transform 440ms var(--event-animation-easing), visibility 0s linear 220ms;
    }

    /* ========================================
       COLLAPSED DESKTOP EVENT LIST
       ======================================== */

    .event-discovery-page.is-list-collapsed {
        grid-template-columns: var(--event-spine-width) minmax(0, 1fr);
    }

        .event-discovery-page.is-list-collapsed
        .event-discovery-list-content {
            opacity: 0;
            visibility: hidden;
            transform: translateX(-18px);
            pointer-events: none;
            transition: opacity 200ms ease, transform 440ms var(--event-animation-easing), visibility 0s linear 440ms;
        }

        .event-discovery-page.is-list-collapsed
        .event-discovery-list-spine {
            border-left-color: transparent;
        }

            .event-discovery-page.is-list-collapsed
            .event-discovery-list-spine i {
                transform: translate(-50%, -50%) rotate(180deg);
            }

        .event-discovery-page.is-list-collapsed
        .event-discovery-list-spine-text {
            opacity: 1;
            visibility: visible;
            transform: translateX(-50%) rotate(180deg) translateY(0);
            transition: opacity 280ms ease 120ms, transform 440ms var(--event-animation-easing), visibility 0s linear 0s;
        }
}

/* ========================================
   TABLET AND MOBILE LIST BEHAVIOR
   ======================================== */

@media (max-width: 900px) {

    .event-discovery-list-content {
        width: 100%;
    }

    .event-discovery-list-spine {
        display: none;
    }
}

/* ========================================
   REDUCED MOTION ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {

    .event-discovery-page,
    .event-discovery-list-content,
    .event-discovery-list-spine,
    .event-discovery-list-spine i,
    .event-discovery-list-spine-text {
        transition: none !important;
    }
}

/* ========================================
   EVENT DISCOVERY — LOCATION BUTTON
   ======================================== */

.event-location-trigger {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #374151;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

    .event-location-trigger i {
        font-size: 19px;
    }

    .event-location-trigger:hover {
        background: #f5f3ff;
        color: #7c3aed;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
        transform: translateY(-1px);
    }

    .event-location-trigger:active {
        transform: scale(0.96);
    }

    .event-location-trigger:focus-visible {
        outline: 3px solid #a78bfa;
        outline-offset: 3px;
    }

@media (max-width: 900px) {
    .event-location-trigger {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .event-location-trigger {
        transition: none;
    }
}

/* ========================================
   EVENT DISCOVERY — LOCATION SELECTOR
   ======================================== */

body.event-location-dialog-open {
    overflow: hidden;
}

.event-location-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
}

    .event-location-overlay[hidden] {
        display: none !important;
    }

    .event-location-overlay.is-open {
        opacity: 1;
    }

/* ========================================
   DIALOG CONTAINER
   ======================================== */

.event-location-dialog {
    box-sizing: border-box;
    width: min(100%, 490px);
    max-height: min(92dvh, 850px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 26px;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    background: #FFFFFF;
    color: #111827;
    font-family: "Poppins", sans-serif;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(12px);
    transition: transform 0.25s ease;
    scrollbar-width: thin;
    scrollbar-color: #D1D5DB transparent;
}

.event-location-overlay.is-open .event-location-dialog {
    transform: translateY(0);
}

.event-location-dialog *,
.event-location-dialog *::before,
.event-location-dialog *::after {
    box-sizing: border-box;
}

/* ========================================
   HEADER
   ======================================== */

.event-location-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

    .event-location-dialog-header > div {
        min-width: 0;
        flex: 1;
    }

    .event-location-dialog-header h2 {
        margin: 0 0 5px;
        color: #111827;
        font-size: 19px;
        font-weight: 700;
        line-height: 1.4;
    }

    .event-location-dialog-header p {
        margin: 0;
        color: #6B7280;
        font-size: 12px;
        line-height: 1.65;
        overflow-wrap: anywhere;
    }

.event-location-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #F3F4F6;
    color: #374151;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .event-location-close:hover {
        background: #EDE9FE;
        color: #7C3AED;
    }

/* ========================================
   LOCATION STATUS
   ======================================== */

.event-location-gps-status {
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #F9FAFB;
    color: #374151;
    font-size: 12px;
    line-height: 1.6;
    min-width: 0;
    overflow-wrap: anywhere;
}

    .event-location-gps-status[hidden],
    .event-location-suggestions[hidden] {
        display: none !important;
    }

/* ========================================
   GPS BUTTON
   ======================================== */

.event-location-gps-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 11px 15px;
    border: 1px solid #DDD6FE;
    border-radius: 11px;
    background: #F5F3FF;
    color: #6D28D9;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

    .event-location-gps-button:hover:not(:disabled) {
        border-color: #A78BFA;
        background: #EDE9FE;
    }

    .event-location-gps-button:disabled {
        opacity: 0.65;
        cursor: wait;
    }

    .event-location-gps-button i {
        font-size: 15px;
    }

/* ========================================
   DIVIDER
   ======================================== */

.event-location-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 21px 0;
    color: #9CA3AF;
    font-size: 11px;
    font-weight: 500;
}

    .event-location-divider::before,
    .event-location-divider::after {
        content: "";
        height: 1px;
        flex: 1;
        background: #E5E7EB;
    }

/* ========================================
   LOCATION BROWSING
   ======================================== */

.event-location-browse {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.event-location-browse-title {
    margin: 0 0 2px;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

/* ========================================
   SHARED FIELD STYLES
   ======================================== */

.event-location-field {
    position: relative;
    width: 100%;
    min-width: 0;
}

    .event-location-field label {
        display: block;
        margin-bottom: 7px;
        color: #374151;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    .event-location-field input,
    .event-location-field select {
        display: block;
        width: 100%;
        min-width: 0;
        min-height: 45px;
        margin: 0;
        padding: 10px 13px;
        border: 1px solid #D1D5DB;
        border-radius: 10px;
        background: #FFFFFF;
        color: #111827;
        font-family: inherit;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.5;
        outline: none;
        transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    }

        .event-location-field input::placeholder {
            color: #9CA3AF;
            opacity: 1;
        }

        .event-location-field input:hover:not(:disabled),
        .event-location-field select:hover:not(:disabled) {
            border-color: #A78BFA;
        }

        .event-location-field input:focus,
        .event-location-field select:focus {
            border-color: #8B5CF6;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
        }

        .event-location-field input:disabled,
        .event-location-field select:disabled {
            border-color: #E5E7EB;
            background: #F9FAFB;
            color: #9CA3AF;
            cursor: not-allowed;
            opacity: 1;
        }

    /* ========================================
   DROPDOWN SELECTS
   ======================================== */

    .event-location-field select {
        appearance: none;
        -webkit-appearance: none;
        padding-right: 40px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 13px center;
        background-size: 16px;
        text-overflow: ellipsis;
        cursor: pointer;
    }

        .event-location-field select:disabled {
            cursor: not-allowed;
        }

    /* ========================================
   CITY QUICK SEARCH
   ======================================== */

    .event-location-field input[type="search"] {
        appearance: none;
        -webkit-appearance: none;
        padding-right: 36px;
    }

        .event-location-field input[type="search"]::-webkit-search-cancel-button {
            cursor: pointer;
        }

/* ========================================
   AUTOCOMPLETE SUGGESTIONS
   ======================================== */

.event-location-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 230px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
    border: 1px solid #E5E7EB;
    border-radius: 11px;
    background: #FFFFFF;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.14);
    scrollbar-width: thin;
}

.event-location-suggestion {
    display: block;
    width: 100%;
    min-height: 41px;
    padding: 10px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #374151;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

    .event-location-suggestion:hover,
    .event-location-suggestion.is-active,
    .event-location-suggestion[aria-selected="true"] {
        background: #F5F3FF;
        color: #6D28D9;
    }

    .event-location-suggestion:focus-visible {
        outline: 2px solid #8B5CF6;
        outline-offset: -2px;
    }

/* ========================================
   SEARCH RADIUS
   ======================================== */

.event-location-radius {
    min-width: 0;
    margin: 22px 0 12px;
    padding: 0;
    border: 0;
}

    .event-location-radius legend {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        padding: 0;
        color: #374151;
        font-size: 12px;
        font-weight: 600;
    }

.event-location-radius-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.event-location-radius-option {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}

    .event-location-radius-option input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

    .event-location-radius-option span {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 46px;
        padding: 8px 4px;
        border: 1px solid #E5E7EB;
        border-radius: 11px;
        background: #FFFFFF;
        color: #374151;
        font-size: 12px;
        font-weight: 500;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: center;
        transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    }

    .event-location-radius-option:hover input:not(:disabled) + span {
        border-color: #A78BFA;
        background: #FAF8FF;
    }

    .event-location-radius-option input:checked + span {
        border-color: #8B5CF6;
        background: #F5F3FF;
        color: #6D28D9;
        font-weight: 600;
    }

    .event-location-radius-option input:focus-visible + span {
        outline: 3px solid #A78BFA;
        outline-offset: 2px;
    }

/* ========================================
   HELP TEXT
   ======================================== */

.event-location-help {
    margin: 12px 0 0;
    color: #6B7280;
    font-size: 11px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* ========================================
   DIALOG ACTIONS
   ======================================== */

.event-location-dialog-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.event-location-cancel,
.event-location-confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 10px 17px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: center;
}

.event-location-cancel {
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #374151;
}

    .event-location-cancel:hover {
        border-color: #D1D5DB;
        background: #F9FAFB;
    }

.event-location-confirm {
    border: 1px solid #7C3AED;
    background: #7C3AED;
    color: #FFFFFF;
}

    .event-location-confirm:hover:not(:disabled) {
        border-color: #6D28D9;
        background: #6D28D9;
    }

    .event-location-confirm:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.event-location-dialog button:focus-visible {
    outline: 3px solid #A78BFA;
    outline-offset: 2px;
}

/* ========================================
   MOBILE BOTTOM SHEET
   ======================================== */

@media (max-width: 600px) {
    .event-location-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .event-location-dialog {
        width: 100%;
        max-width: none;
        max-height: 92dvh;
        padding: 22px 18px max( 22px, env(safe-area-inset-bottom) );
        border: 0;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .event-location-overlay.is-open .event-location-dialog {
        transform: translateY(0);
    }

    .event-location-dialog-header {
        margin-bottom: 18px;
    }

        .event-location-dialog-header h2 {
            font-size: 17px;
            overflow-wrap: anywhere;
        }

        .event-location-dialog-header p {
            font-size: 11px;
        }

    .event-location-browse {
        gap: 12px;
    }

    .event-location-field input,
    .event-location-field select {
        min-height: 46px;
        font-size: 12px;
    }

    .event-location-suggestions {
        max-height: 190px;
    }

    .event-location-radius-options {
        gap: 6px;
    }

    .event-location-radius-option span {
        min-height: 44px;
        font-size: 11px;
    }

    .event-location-dialog-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
        gap: 9px;
    }

    .event-location-cancel,
    .event-location-confirm {
        width: 100%;
        min-width: 0;
        padding: 10px 9px;
        font-size: 11px;
    }
}

/* ========================================
   SMALL SCREEN ADJUSTMENTS
   ======================================== */

@media (max-width: 360px) {
    .event-location-dialog {
        padding-left: 14px;
        padding-right: 14px;
    }

    .event-location-radius-options {
        gap: 5px;
    }

    .event-location-radius-option span {
        padding: 8px 2px;
        font-size: 10px;
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .event-location-overlay,
    .event-location-dialog,
    .event-location-close,
    .event-location-gps-button,
    .event-location-field input,
    .event-location-field select,
    .event-location-suggestion,
    .event-location-radius-option span,
    .event-location-cancel,
    .event-location-confirm {
        transition: none !important;
    }
}

/* ========================================
   HOME PAGE — FIXED APPLICATION LAYOUT
   ======================================== */

.landing-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

    .landing-page > .main-header,
    .landing-page > .event-category-bar {
        flex: 0 0 auto;
    }

    .landing-page > .event-discovery-page {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        min-width: 0;
    }

    .landing-page .event-discovery-list {
        min-height: 0;
        max-height: 100%;
        overflow-y: auto;
    }

    .landing-page .event-discovery-map {
        min-height: 0;
        height: 100%;
    }

@media (max-width: 800px) {
    .landing-page > .event-discovery-mobile-toggle {
        flex: 0 0 auto;
    }
}

/* Native Event Location Selector */

dialog#eventLocationOverlay {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 20px;
    border: 0;
    border-radius: 0;
    overflow: auto;
    background: transparent;
    color: inherit;
}

    dialog#eventLocationOverlay[open] {
        display: flex;
    }

    dialog#eventLocationOverlay::backdrop {
        background: rgba(15, 23, 42, 0.55);
    }

@media (max-width: 600px) {
    dialog#eventLocationOverlay {
        align-items: flex-end;
        padding: 0;
    }
}

/* Compact mobile map popup */
@media (max-width: 768px) {
    .event-map-popup .leaflet-popup-content {
        width: min(240px, calc(100vw - 48px)) !important;
    }

    .event-map-popup .leaflet-popup-content-wrapper {
        border-radius: 14px;
    }

    .event-map-popup-cover {
        aspect-ratio: 16 / 7;
    }

    .event-map-popup-content {
        padding: 10px;
    }

    .event-map-popup-categories {
        margin-bottom: 5px;
    }

    .event-map-popup-title {
        font-size: 13px;
        margin-bottom: 7px;
    }

    .event-map-popup-meta {
        gap: 5px;
        margin-bottom: 9px;
    }

    .event-map-popup-details {
        min-height: 36px;
        border-radius: 8px;
    }

    .event-map-popup-status {
        top: 7px;
        left: 7px;
        padding: 4px 8px;
    }
}

/* Compact mobile navigation */
@media (max-width: 768px) {
    .event-category-bar {
        padding: 5px 10px;
        gap: 5px;
    }

    .event-category-form {
        gap: 5px;
    }

    .event-category-chip {
        min-height: 28px;
        padding: 4px 10px;
        font-size: 10px;
    }

    .event-category-scroll-button {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

    .event-discovery-mobile-toggle {
        padding: 5px 10px;
        gap: 4px;
    }

        .event-discovery-mobile-toggle button {
            min-height: 34px;
            font-size: 11px;
            gap: 5px;
        }
}

/* Compact mobile event cards */
@media (max-width: 768px) {
    .event-list-panel {
        padding: 12px 10px 24px;
    }

    .event-list-panel-results {
        gap: 12px;
    }

    .event-list-card {
        border-radius: 10px;
    }

    .event-list-card-cover {
        aspect-ratio: 16 / 8;
    }

    .event-list-card-content {
        padding: 12px;
    }

    .event-list-card-status {
        top: 8px;
        left: 8px;
        padding: 4px 8px;
        font-size: 10px;
    }

    .event-list-card-categories {
        gap: 5px;
        margin-bottom: 7px;
    }

        .event-list-card-categories span {
            padding: 4px 7px;
            font-size: 9px;
        }

    .event-list-card-title {
        font-size: 15px;
        margin-bottom: 5px;
    }

    .event-list-card-description {
        font-size: 11px;
        margin-bottom: 9px;
        -webkit-line-clamp: 2;
    }

    .event-list-card-meta {
        gap: 8px;
        margin-bottom: 10px;
    }

    .event-list-card-time {
        padding: 9px;
    }

    .event-list-card-time-header {
        margin-bottom: 5px;
    }
}

/* Mobile bookmarked toast position */
@media (max-width: 600px) {
    .bookmarked-status-toast {
        top: 150px;
        width: calc(100% - 24px);
        max-width: 360px;
        box-sizing: border-box;
    }
}
