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

/* --- Disable native pull-to-refresh & allow conditional scroll locking --- */
html,
body {
    overscroll-behavior-y: contain;
}

/* When map is active, lock the body scroll to prevent double scrollbars */
body.map-view-active {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    overflow-x: hidden;
}

/* --- Pull to Refresh Indicator Styles --- */
#pull-to-refresh-indicator {
    position: fixed;
    top: -50px;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 1080;
    transition: top 0.2s ease-out;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: #333;
    font-weight: bold;
}

.ptr-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #ced4da;
    border-top-color: #007bff;
    border-radius: 50%;
    transition: transform 0.3s;
}

#pull-to-refresh-indicator.refreshing .ptr-spinner {
    animation: spin 1s linear infinite;
}

header {
    background-color: rgba(24, 23, 38, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(26, 115, 232, 0.2);
    color: #f0f0f5;
    padding: 10px 15px;
    min-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1010;
    flex-shrink: 0;
    /* Don't shrink header in map view */
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.desktop-user-nav .user-info {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info .header-link {
    color: #fff;
    text-decoration: underline;
}

.header-btn {
    background-color: transparent;
    border: 1px solid white;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: none;
}

.header-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.notification-area {
    position: relative;
    display: inline-block;
}

.notification-btn {
    position: relative;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid white;
}

.notification-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: white;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 350px;
    z-index: 1020;
    overflow: hidden;
}

.notification-panel.open {
    display: block;
}

.notification-panel-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.notification-actions button {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 10px;
    padding: 0;
}

.notification-actions button:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s;
}

.notification-item.unread {
    background-color: #f8f9fa;
    cursor: pointer;
}

.notification-item.unread:hover {
    background-color: #e9ecef;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item-title {
    font-weight: bold;
    margin-bottom: 5px;
    pointer-events: none;
}

.notification-item-body {
    margin-bottom: 8px;
    color: #555;
    font-size: 0.95rem;
    pointer-events: none;
}

.notification-item-time {
    font-size: 0.8rem;
    color: #888;
    align-self: flex-end;
    pointer-events: none;
}

.notification-list .no-notifications {
    padding: 2rem;
    text-align: center;
    color: #777;
}

/* Mobile Notification Styles */
.mobile-close-btn {
    display: none;
    /* Hidden by default on desktop */
}

@media (max-width: 600px) {
    .notification-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        margin-top: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        z-index: 2000;
        /* Ensure it covers everything */
        flex-direction: column;
        display: none;
        /* Hidden by default */
    }

    .notification-panel.open {
        display: flex;
        /* Override to flex for full screen layout */
    }

    .notification-list {
        flex-grow: 1;
        max-height: none;
    }

    .notification-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding-right: 50px;
        /* Space for the close button */
        position: relative;
    }

    .notification-actions {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: 20px;
    }

    .notification-actions button {
        margin-left: 0;
        font-size: 0.9rem;
    }

    .mobile-close-btn {
        display: block;
        position: absolute;
        top: 10px;
        right: 15px;
        background: transparent;
        border: none;
        font-size: 2.5rem;
        line-height: 0.8;
        color: #333;
        cursor: pointer;
        padding: 5px;
        z-index: 2001;
    }
}

.controls-bar {
    padding: 1rem;
    background-color: #f8f9fa;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
    /* Don't shrink bar in map view */
}

/* Map View Controls Toggle (Global) */
body.map-view-active .controls-bar {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 1002;
    background: #f0f2f5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #ddd;
    transform: translateY(-200%);
    transition: transform 0.3s ease-in-out;
}

body.map-view-active .controls-bar.open {
    transform: translateY(0);
}

.view-toggle button,
.desktop-filters-btn,
#toggle-filters-btn-mobile,
.refresh-data-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.view-toggle button:hover,
.desktop-filters-btn:hover,
#toggle-filters-btn-mobile:hover,
.refresh-data-btn:hover {
    background-color: #5a6268;
}

.view-toggle button.active,
.desktop-filters-btn.active,
#toggle-filters-btn-mobile.active {
    background-color: #007bff;
    font-weight: bold;
}

.filter-modal {
    display: none;
    position: fixed;
    z-index: 1070;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.filter-modal.open {
    display: flex;
}

.filter-panel {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.filter-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

#close-filters-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    line-height: 1;
}

.filter-content {
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

.filter-section {
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.filter-section:not(:last-child) {
    border-bottom: 1px solid #eee;
}

.filter-section>label {
    font-weight: bold;
    color: #333;
    padding-left: 5px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    width: 100%;
}

.filter-btn {
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 20px;
    background-color: #808080;
    color: #e6e6e6;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    font-size: 0.95em;
}

.filter-btn:hover {
    background-color: #707070;
}

.filter-btn.selected {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.filter-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    text-align: right;
    flex-shrink: 0;
    background-color: #f8f9fa;
}

#apply-filters-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
}

#apply-filters-btn:hover {
    background-color: #0056b3;
}

/* --- Map Container Styles (REQUIRED for Leaflet) --- */
#map-view-container {
    width: 100%;
    /* Default height is needed for Leaflet initialization even if hidden initially */
    height: calc(100vh - 140px);
    display: none;
    z-index: 1;
    background-color: #e9ecef;
    /* Placeholder color */
}

/* When map is active, allow it to fill the flex container defined on body */
body.map-view-active #map-view-container {
    display: block;
    flex-grow: 1;
    height: auto;
    min-height: 0;
}

/* Ensure no trailing space in map view */
body.map-view-active main,
body.map-view-active footer {
    display: none;
}

main {
    padding: 0 20px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.loader-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 50px;
    color: #555;
    font-size: 1.2em;
}

.loader-spinner {
    border: 8px solid #e0e0e0;
    border-top: 8px solid #007bff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.park-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
    padding: 20px;
}

.park-section h2,
.park-table-section h2 {
    color: #0056b3;
    margin-top: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    position: relative;
    user-select: none;
    padding-right: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.park-header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
}

.park-header-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.park-hours {
    font-size: 0.75rem;
    font-weight: 500;
    color: #495047;
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 10px;
    margin-left: 10px;
    white-space: nowrap;
}

.park-extra-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 0.9rem;
}

.park-info-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.75em;
    white-space: nowrap;
}

.park-info-badge.early-entry {
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.park-info-badge.ticketed-event {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.park-section h2::after,
.park-table-section h2::after {
    content: '▲';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    transition: transform 0.2s ease-in-out;
}

.park-section.collapsed h2::after,
.park-table-section.collapsed h2::after {
    transform: translateY(-50%) rotate(180deg);
}

.park-section.collapsed .rides-grid,
.park-table-section.collapsed>table {
    display: none;
}

.rides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.ride-item {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
    overflow: hidden;
}

.ride-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.ride-item-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.ride-item-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--pc-border, #eee);
}

.ride-item-details p.status {
    margin: 0 auto 0 0;
    font-size: 0.85em;
    font-weight: 600;
}

.ride-title {
    margin: 0;
    font-size: 1.12em;
    font-weight: 700;
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
    text-align: left;
}

.ride-wait-time {
    font-weight: bold;
    font-size: 1.05em;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.ride-card-badges-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-top: 8px;
    padding-left: 28px;
    box-sizing: border-box;
}

.ride-card-metrics-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.ride-card-metrics-strip .pc-insight-badges-wrap {
    justify-content: flex-start;
    margin-top: 0;
}

.ride-wait-time .distance-info {
    font-size: 0.8em;
    font-weight: normal;
    color: #555;
    margin-top: 2px;
}

.low-wait .ride-wait-time {
    background-color: #d4edda;
    color: #155724;
}

.medium-wait .ride-wait-time {
    background-color: #fff3cd;
    color: #856404;
}

.high-wait .ride-wait-time {
    background-color: #f8d7da;
    color: #721c24;
}

.no-wait-info .ride-wait-time {
    background-color: #e2e3e5;
    color: #383d41;
}

.closed .ride-wait-time,
.down .ride-wait-time,
.refurbishment .ride-wait-time {
    background-color: transparent;
    color: inherit;
}

.show-times .ride-wait-time {
    background-color: #d1ecf1;
    color: #0c5460;
    font-size: 0.9em;
    white-space: normal;
    text-align: right;
    line-height: 1.4;
    flex-shrink: 1;
    flex-direction: row;
    flex-wrap: wrap;
}

.ride-item.operating {
    border-left: 5px solid #28a745;
}

.ride-item.closed {
    border-left: 5px solid #dc3545;
    background-color: #ffebeb;
}

.ride-item.down {
    border-left: 5px solid #ffc107;
    background-color: #fff8e1;
}

.ride-item.refurbishment {
    border-left: 5px solid #6c757d;
    background-color: #e9ecef;
}

.set-alert-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    margin-left: 10px;
}

.set-alert-btn:hover {
    background-color: #0056b3;
}

.set-alert-btn.alert-is-set {
    background-color: #ffc107;
    color: #333;
}

.set-alert-btn.alert-is-set:hover {
    background-color: #e0a800;
}

.log-visit-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background-color: #17a2b8;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    margin-left: 10px;
}

.log-visit-btn:hover {
    background-color: #138496;
}

.log-visit-btn-table {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #17a2b8;
    background-color: white;
    color: #17a2b8;
    cursor: pointer;
    margin-left: 5px;
}

.log-visit-btn-table:hover {
    background-color: #e2f4f7;
}

/* --- Added History Button Styles --- */
.history-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background-color: #6c757d;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    margin-left: 10px;
}

.history-btn:hover {
    background-color: #5a6268;
}

.details-btn {
    background-color: #6f42c1;
    color: white;
}

.details-btn:hover {
    background-color: #5a32a3;
}

/* Card main Info button styling */
.ride-item-main .details-btn {
    font-size: 0.75em;
    padding: 3px 8px;
    margin-left: 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Table specific override for history button */
.park-table-section .history-btn {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #6c757d;
    background-color: white;
    color: #6c757d;
    margin-left: 5px;
}

.park-table-section .history-btn:hover {
    background-color: #e2e6ea;
}

/* --- Ride Logo Styles --- */

/* Shared inline logo - sits beside the ride title text */
.ride-logo-inline {
    height: 24px;
    width: auto;
    max-width: 72px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 3px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
    flex-shrink: 0;
    display: inline-block;
}

/* Map popup: slightly taller since the popup h4 is larger */
.ride-logo-popup {
    height: 28px;
    max-width: 80px;
}

/* Table view: same inline class, slight tweak for table context */
.ride-logo-table {
    height: 30px;
    width: auto;
    max-width: 72px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
    border-radius: 3px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
    flex-shrink: 0;
}

/* Make the table name cell a flex container so logo + text line up */
td[data-label="Attraction"] {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

td[data-label="Attraction"] span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Mobile: shrink logos slightly */
@media (max-width: 600px) {
    .ride-logo-inline {
        height: 20px;
        max-width: 60px;
    }

    td[data-label="Attraction"] {
        flex-wrap: wrap;
        gap: 4px;
    }

    .ride-logo-table {
        height: 24px;
        max-width: 56px;
    }
}


.park-summary-marker {
    background: none !important;
    border: none !important;
}

.park-marker-pill {
    background-color: #007bff;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    width: max-content;
    max-width: 220px;
    transform: translate(-50%, -50%);
}

.park-marker-pill:hover {
    transform: translate(-50%, -50%) scale(1.05);
    background-color: #0056b3;
}

.park-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.park-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: bold;
    font-family: sans-serif;
    font-size: 13px;
}

.park-section h2 .log-park-visit-btn,
.park-table-section h2 .log-park-visit-btn {
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    background-color: #17a2b8;
    padding: 4px 10px;
    border-radius: 10px;
    margin-left: 10px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.park-section h2 .log-park-visit-btn:hover,
.park-table-section h2 .log-park-visit-btn:hover {
    background-color: #138496;
}

html.pc-modal-open,
body.pc-modal-open {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1090;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    overscroll-behavior: contain;
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    margin: 4vh auto;
    padding: 20px 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    border-radius: 10px;
    text-align: center;
    position: relative;
}

#log-visit-form {
    text-align: left;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#log-visit-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

#log-visit-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #555;
    font-size: 0.9em;
}

#log-visit-form input,
#log-visit-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

#log-visit-form .status-message {
    text-align: center;
    margin-top: 0.5rem;
    font-weight: bold;
    min-height: 1.2em;
}

#pwa-install-modal .modal-content {
    text-align: left;
    padding: 30px;
}

#pwa-install-modal h2 {
    text-align: center;
    margin-top: 0;
}

#pwa-install-modal p {
    line-height: 1.6;
    margin-bottom: 20px;
}

#install-instructions {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
}

#install-instructions p {
    margin: 0 0 10px 0;
}

#install-instructions strong {
    color: #0056b3;
}

.close-btn {
    color: #6c757d;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
}

.wait-time-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.wait-time-btn {
    padding: 10px 14px;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    background-color: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.wait-time-btn:hover {
    background-color: #cbd5e1;
    color: #0f172a;
    border-color: #64748b;
}

.wait-time-btn:disabled {
    background-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    text-decoration: line-through;
}

.wait-time-btn.selected {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
    font-weight: bold;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.modal-buttons button,
.modal-content form button[type="submit"],
.danger-btn,
.modal-action-btn {
    padding: 12px 25px;
    font-size: 1.05em;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-weight: 600;
}

.modal-content form button[type="submit"] {
    background-color: #28a745;
}

.modal-content form button[type="submit"]:disabled {
    background-color: #999;
    cursor: not-allowed;
}

.danger-btn {
    background-color: #dc3545;
}

.danger-btn:hover {
    background-color: #c82333;
}

.modal-action-btn {
    background-color: #007bff;
}

.modal-action-btn:hover {
    background-color: #0056b3;
}

.filter-action-btn {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-action-btn:hover {
    background-color: #dee2e6;
    border-color: #adb5bd;
}

.filter-action-btn.reset-btn {
    background-color: #6c757d;
    color: white;
}

.filter-action-btn.reset-btn:hover {
    background-color: #5a6268;
}

.modal-divider {
    border: 0;
    border-top: 1px solid var(--pc-border, #eee);
    margin: 25px 0;
}

.alert-option-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--pc-text, #333);
}

#table-parks-container {
    max-width: 1200px;
    margin: 0 auto 20px;
}

.park-table-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
    padding: 20px;
    overflow-x: auto;
}

.park-table-section table {
    width: 100%;
    border-collapse: collapse;
}

.park-table-section th,
.park-table-section td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.park-table-section th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
    cursor: pointer;
    position: relative;
}

.park-table-section th:hover {
    background-color: #0056b3;
}

.park-table-section th .sort-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
}

.park-table-section tbody tr:nth-child(even) {
    background-color: #f8f8f8;
}

.park-table-section tbody tr:hover {
    background-color: #eef;
}

.set-alert-btn-table {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #007bff;
    background-color: white;
    color: #007bff;
    cursor: pointer;
}

.set-alert-btn-table.alert-is-set {
    background-color: #ffc107;
    border-color: #e0a800;
    color: #333;
}

.table-actions-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

#all-alerts-list {
    margin-top: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.alert-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.alert-list-item.global-alert-item {
    background-color: #f8f9fa;
    border-left: 4px solid #17a2b8;
}

.alert-list-item:last-child {
    border-bottom: none;
}

.alert-item-name {
    font-weight: bold;
}

.alert-item-condition {
    color: #555;
}

.alert-item-controls button {
    margin-left: 8px;
    padding: 4px 8px;
    font-size: 0.9em;
    border-radius: 4px;
    cursor: pointer;
}

.alert-item-controls .edit-btn {
    border: 1px solid #007bff;
    background: #fff;
    color: #007bff;
}

.alert-item-controls .delete-btn {
    border: 1px solid #dc3545;
    background: #fff;
    color: #dc3545;
}

#settings-content {
    margin-top: 20px;
    text-align: left;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-size: 1.1em;
    color: #333;
}

.setting-item input[type="checkbox"] {
    transform: scale(1.5);
    cursor: pointer;
}

.setting-item-child {
    padding-left: 25px;
    padding-top: 15px;
}

.setting-item-child>label {
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

footer {
    text-align: center;
    color: #777;
    font-size: 0.9em;
}

.refresh-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.last-updated-display {
    font-size: 0.85em;
    color: #6c757d;
    text-align: center;
    line-height: 1.2;
}

.refresh-data-btn svg {
    transition: transform 0.3s ease;
}

.refresh-data-btn.refreshing svg {
    animation: spin 1s linear infinite;
}

#manual-refresh-btn-mobile,
#manual-refresh-btn-desktop {
    width: 38px;
    height: 38px;
    padding: 8px;
    margin: 0;
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

.auth-form {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
    text-align: center;
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
}

.auth-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.auth-form button[type="submit"]:hover {
    background-color: #0056b3;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
}

.form-footer a {
    color: #007bff;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.message-area {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.message-area.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-area.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.session-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #007bff;
    border-radius: 5px;
    background-color: white;
    color: #007bff;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.session-btn:hover {
    background-color: #f0f8ff;
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.auth-divider span {
    background-color: white;
    padding: 0 10px;
    position: relative;
    z-index: 1;
    color: #6c757d;
    font-weight: bold;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #dee2e6;
    z-index: 0;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    padding: 10px;
    border: 1px solid #dadce0;
    border-radius: 5px;
    background-color: #fff;
    color: #3c4043;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
    font-family: 'Roboto', sans-serif;
}

.google-login-btn:hover {
    background-color: #f8f9fa;
    border-color: #c6c9ce;
}

.google-login-btn svg {
    flex-shrink: 0;
}

.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    margin: 0;
    flex-shrink: 0;
}

.hamburger-menu span {
    display: block;
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s linear;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    background: #181726;
    /* Match modern theme card bg */
    height: calc(100vh - 65px);
    padding: 2rem 1rem;
    position: fixed;
    top: 65px;
    left: 0;
    z-index: 1050;
    transition: transform 0.3s ease-in-out;
    transform: translateX(-100%);
    width: 80%;
    max-width: 300px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.7);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.mobile-nav::-webkit-scrollbar {
    width: 6px;
}

.mobile-nav::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-nav::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.mobile-nav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-user-info {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.user-email-mobile {
    display: block;
    margin-bottom: 1rem;
    font-weight: bold;
    color: #fff;
    word-wrap: break-word;
    font-size: 0.9rem;
}

.mobile-nav-link {
    font-size: 1.1rem;
    padding: 0.75rem 0.5rem;
    font-weight: 500;
    color: #FFF;
    text-decoration: none;
    transition: background-color 0.2s linear;
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #FFF;
    border-radius: 4px;
}

.mobile-nav-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 10px 0;
}

#mobile-install-link {
    display: none;
}

.close-nav-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.mobile-sort-controls {
    display: none;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.mobile-sort-controls .sort-label {
    font-size: 0.9em;
    color: #555;
    font-weight: bold;
    margin-right: 5px;
}

.mobile-sort-controls .sort-btn,
.desktop-controls .sort-btn {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.mobile-sort-controls .sort-btn.active,
.desktop-controls .sort-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.mobile-sort-controls .sort-direction-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    line-height: 1;
}

.mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.mobile-bottom-bar {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 10px;
    align-items: center;
}

#toggle-filters-btn-mobile {
    flex-grow: 1;
    max-width: 170px;
}

.mobile-bottom-bar .refresh-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.mobile-bottom-bar #toggle-filters-btn-mobile {
    flex: 1;
}

.refresh-location-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1;
}

.refresh-location-btn:hover {
    background-color: #0056b3;
}

.sort-btn .refresh-icon {
    display: none;
    width: 14px;
    height: 14px;
    margin-left: 6px;
}

.sort-btn.active[data-sort="nearest"] .refresh-icon {
    display: inline-block;
}

.sort-btn.locating .refresh-icon {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.mobile-controls-wrapper {
    display: none;
    align-items: center;
    flex-direction: column;
    width: 100%;
    gap: 10px;
}

.desktop-controls {
    display: none;
    align-items: center;
    gap: 10px;
}

@media (max-width: 600px) {
    main {
        padding-left: 0;
        padding-right: 0;
    }

    .park-section {
        border-radius: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .park-section h2,
    .park-table-section h2 {
        padding-left: 15px;
        padding-right: 30px;
    }

    /* Full-screen filter modal on mobile */
    .filter-modal {
        background-color: white;
        /* No overlay, just full screen */
    }

    .filter-panel {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .filter-content {
        padding: 1.5rem;
    }

    #apply-filters-btn {
        width: 100%;
    }

    .rides-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .ride-item {
        padding: 12px;
    }

    .ride-title {
        font-size: 1.05em;
    }

    .ride-wait-time {
        font-size: 1.05em;
    }

    .ride-item .ride-item-details {
        display: none;
    }

    .ride-item.expanded .ride-title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .ride-item.expanded .ride-item-details {
        display: flex;
    }

    .modal {
        overflow-y: auto !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

    .modal-content {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        display: block !important;
        text-align: left !important;
        box-sizing: border-box !important;
        padding: 2rem !important;
        overflow-y: visible !important;
        padding: 1.5rem 1.25rem 3rem !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 820px) {
    .hamburger-menu {
        display: flex;
    }

    .desktop-user-nav {
        display: none;
    }

    /* Only hide desktop-specific controls, allow view-toggle to show */
    .desktop-controls {
        display: none;
    }

    /* Style view toggle for mobile */
    .view-toggle {
        display: flex;
        width: 100%;
        justify-content: center;
        gap: 5px;
        margin-bottom: 5px;
    }

    #table-view-btn {
        display: none;
    }

    .view-toggle button {
        flex: 1;
        padding: 8px 0;
        /* optimize padding for small screens */
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .mobile-controls-wrapper {
        display: flex;
    }

    .mobile-sort-controls {
        display: flex;
    }

    .controls-bar {
        padding: 0.75rem 1rem;
        gap: 1rem;
        justify-content: space-between;
    }

    header {
        padding: 0 1rem;
    }

    .header-left {
        flex-grow: 1;
        min-width: 0;
    }

    .header-content-wrapper {
        flex-grow: 1;
        text-align: center;
    }

    header h1 {
        font-size: 1.2rem;
        white-space: normal;
        display: inline-block;
    }

    .park-table-section {
        overflow-x: hidden;
    }

    .park-table-section thead {
        display: none;
    }

    .park-table-section tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 4px;
    }

    .park-table-section td {
        display: block;
        text-align: right;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
    }

    .park-table-section td:last-child {
        border-bottom: 0;
    }

    .park-table-section td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: bold;
        text-align: left;
    }

    .park-table-section td .table-actions-wrapper {
        justify-content: flex-end;
        flex-wrap: wrap;
    }


    body.map-view-active #map-view-container {
        height: calc(100vh - 60px) !important;
        margin-top: 0;
    }

    body.map-view-active #mobile-sort-controls {
        display: none;
    }

    .map-controls-toggle {
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.5);
        color: white;
        font-size: 0.85rem;
        padding: 6px 12px;
        margin-left: 8px;
        border-radius: 4px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .map-controls-toggle:hover {
        background: rgba(255, 255, 255, 0.3);
    }
}

@media (min-width: 821px) {
    .hamburger-menu {
        display: flex;
    }

    .mobile-controls-wrapper {
        display: none !important;
    }

    .desktop-controls {
        display: flex;
    }

    .desktop-controls .sort-btn {
        padding: 10px 20px;
    }

    /* Removed desktop popup overrides for .mobile-nav so it functions as a slide-out on all screens */
}

/* --- Visit History Panel (Synchronized with challenges.css) --- */
.log-history-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 480px;
    height: 100%;
    background-color: #f0f2f5;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 1060;
    transition: right 0.4s ease-in-out;
    display: flex;
    flex-direction: column;
}

.log-history-panel.open {
    right: 0;
}

.log-panel-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    /* Prevent header from shrinking */
}

.log-panel-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #111;
}

.log-panel-header button {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #444;
}

/* === MODIFIED: Log Filters with consistent sizing === */
.log-filters {
    display: flex;
    overflow-x: auto;
    padding: 10px 15px;
    background-color: #e2e8f0;
    gap: 8px;
    scrollbar-width: none;
    flex-shrink: 0;
    /* Critical: prevents filters from being crushed */
    align-items: center;
    -webkit-overflow-scrolling: touch;
}

.log-filters::-webkit-scrollbar {
    display: none;
}

.log-filters button {
    flex: 0 0 auto;
    /* Prevent growing/shrinking */
    white-space: nowrap;
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    /* Consistent weight */
    border-radius: 20px;
    border: 1px solid #ccc;
    background-color: white;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.log-filters button.active {
    background-color: #0056b3;
    color: white;
    border-color: #0056b3;
    font-weight: 600;
    /* Keep weight consistent */
}

/* === ADDED: Date Filter Styles === */
.log-date-filters {
    padding: 10px 15px;
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    flex-shrink: 0;
    /* Prevent date filters from shrinking */
}

.log-date-filters input[type="date"] {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #f9f9f9;
    color: #333;
    max-width: 130px;
}

.log-date-filters button {
    padding: 6px 10px;
    font-size: 0.8rem;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    color: #555;
    font-weight: 600;
}

.log-date-filters button:hover {
    background-color: #dde2e6;
}

.log-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
    /* Important for flex scrolling */
}

.log-date-group h4 {
    margin: 20px 0 10px;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.log-entry-item {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
}

.log-icon {
    font-size: 2rem;
    width: 45px;
    height: 45px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.log-details {
    flex: 1;
    min-width: 200px;
}

.log-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: #111;
    margin-bottom: 2px;
}

.log-meta {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 8px;
}

.log-notes {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #444;
    background: #f1f3f5;
    padding: 10px;
    border-radius: 6px;
    border-left: 4px solid #adb5bd;
    font-style: italic;
}

.log-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    opacity: 0.6;
}

.log-actions button:hover {
    opacity: 1;
}

.edit-form-container {
    width: 100%;
    margin-top: 15px;
}

.inline-edit-form {
    background: #fff;
    padding: 1.5rem;
    border: 2px solid #007bff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inline-edit-form label {
    font-weight: 700;
    font-size: 0.85rem;
    color: #555;
}

.inline-edit-form input,
.inline-edit-form textarea,
.inline-edit-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.inline-actions button {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    border: none;
}

.inline-actions .save-btn {
    background: #28a745;
    color: white;
}

.inline-actions button[type="button"] {
    background: #6c757d;
    color: white;
}

/* Map Popup Content Styles */
.map-popup-content h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: #333;
}

.map-popup-content p {
    margin: 4px 0;
    font-size: 0.9em;
    color: #555;
    line-height: 1.4;
}

.popup-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.popup-actions button {
    padding: 6px 12px;
    font-size: 0.8em;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
}

.log-visit-btn-map {
    background-color: #17a2b8;
}

.set-alert-btn-map {
    background-color: #28a745;
}

.view-history-btn-map {
    background-color: #6c757d;
}

.view-details-btn-map {
    background-color: #6f42c1;
}

/* Trend Arrow Styles */
.trend-arrow {
    display: inline-block;
    margin-right: 4px;
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1;
    vertical-align: text-bottom;
    /* Better alignment for arrows next to text */
    position: relative;
    top: -1px;
}

.trend-up {
    color: #dc3545;
}

.trend-down {
    color: #28a745;
}

/* Radar Control Styles */
.radar-control-container {
    background-color: white;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.radar-control-container:hover {
    background-color: #f4f4f4;
}

.radar-toggle-label {
    margin: 0;
    font-weight: bold;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- User Map Events Styles --- */

.leaflet-user-event-marker {
    background: none !important;
    border: none !important;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8), 0 0 8px rgba(0, 0, 0, 0.6);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0), 0 0 8px rgba(0, 0, 0, 0.6);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 0 8px rgba(0, 0, 0, 0.6);
    }
}

.event-popup {
    padding: 5px;
    font-family: sans-serif;
    min-width: 180px;
}

.event-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
    margin-bottom: 8px;
    gap: 10px;
}

.event-type-badge {
    font-size: 0.65rem;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 4px;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
}

.event-type-badge.character {
    background-color: #7b2cbf;
}

.event-type-badge.show {
    background-color: #d81159;
}

.event-type-badge.interaction {
    background-color: #0077b6;
}

.event-type-badge.issue {
    background-color: #c0392b;
}

.event-type-badge.crowd_level {
    background-color: #2b2d42;
}

.event-time-remaining {
    font-size: 0.75rem;
    color: #dc3545;
    font-weight: 600;
    white-space: nowrap;
}

.event-popup-body {
    margin-bottom: 10px;
}

.event-name {
    font-size: 0.95rem;
    font-weight: bold;
    margin: 0 0 4px 0;
    color: #2c3e50;
    line-height: 1.3;
}

.event-meta {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin: 0;
}

.event-popup-actions {
    display: flex;
    gap: 8px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.event-vote-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fcfcfc;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    color: #333;
    line-height: 1;
}

.event-vote-btn:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

.event-vote-btn.vote-up-btn.voted {
    background-color: rgba(40, 167, 69, 0.15);
    border-color: #28a745;
    color: #28a745;
    font-weight: bold;
}

.event-vote-btn.vote-down-btn.voted {
    background-color: rgba(220, 53, 69, 0.15);
    border-color: #dc3545;
    color: #dc3545;
    font-weight: bold;
}

.event-vote-btn .count {
    font-weight: bold;
}

/* --- Event Modal Selection Pills --- */

.type-pill-btn,
.crowd-pill-btn {
    padding: 8px 16px !important;
    border: 2px solid #333333 !important;
    border-radius: 20px !important;
    background-color: transparent !important;
    color: #000000 !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 0.9em !important;
    font-family: inherit !important;
}

.type-pill-btn:hover,
.crowd-pill-btn:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    border-color: #000000 !important;
}

/* Event Type Pills Colors when Selected */
.type-pill-btn.selected[data-type="character"] {
    background-color: #7b2cbf !important;
    border-color: #5a189a !important;
    color: white !important;
    font-weight: bold !important;
}

.type-pill-btn.selected[data-type="show"] {
    background-color: #d81159 !important;
    border-color: #ad0e47 !important;
    color: white !important;
    font-weight: bold !important;
}

.type-pill-btn.selected[data-type="interaction"] {
    background-color: #0077b6 !important;
    border-color: #005f9e !important;
    color: white !important;
    font-weight: bold !important;
}

.type-pill-btn.selected[data-type="issue"] {
    background-color: #c0392b !important;
    border-color: #962d22 !important;
    color: white !important;
    font-weight: bold !important;
}

.type-pill-btn.selected[data-type="crowd_level"] {
    background-color: #2b2d42 !important;
    border-color: #1d1e2c !important;
    color: white !important;
    font-weight: bold !important;
}

/* Crowd Level Pills Colors when Selected */
.crowd-pill-btn.selected.packed {
    background-color: #c0392b !important;
    border-color: #962d22 !important;
    color: white !important;
    font-weight: bold !important;
}

.crowd-pill-btn.selected.high {
    background-color: #fd7e14 !important;
    border-color: #e06d03 !important;
    color: white !important;
    font-weight: bold !important;
}

.crowd-pill-btn.selected.medium {
    background-color: #ffb703 !important;
    border-color: #fb8500 !important;
    color: black !important;
    font-weight: bold !important;
}

.crowd-pill-btn.selected.low {
    background-color: #28a745 !important;
    border-color: #1e7e34 !important;
    color: white !important;
    font-weight: bold !important;
}

/* Crowd Level Popup Badges overrides */
.event-type-badge.crowd_level.packed {
    background-color: #c0392b;
}

.event-type-badge.crowd_level.high {
    background-color: #fd7e14;
}

.event-type-badge.crowd_level.medium {
    background-color: #ffb703;
    color: #000;
}

.event-type-badge.crowd_level.low {
    background-color: #28a745;
}


/* ==========================================================================
   PARK COMPANION V2.0 - UNIFIED DESIGN SYSTEM, THEMES & MODERN UX
   ========================================================================== */

:root {
    --pc-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --pc-font-display: 'Fredoka', 'Inter', sans-serif;

    --pc-bg: #f4f7f6;
    --pc-surface: #ffffff;
    --pc-surface-alt: #f8fafc;
    --pc-text: #1e293b;
    --pc-text-muted: #64748b;
    --pc-border: #e2e8f0;
    --pc-primary: #0077b6;
    --pc-primary-hover: #023e8a;
    --pc-accent: #f59e0b;
    --pc-success: #10b981;
    --pc-danger: #ef4444;
    --pc-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    --pc-radius: 14px;
}

[data-theme="dark"] {
    --pc-bg: #0b0f19;
    --pc-surface: #111827;
    --pc-surface-alt: #1e293b;
    --pc-text: #f8fafc;
    --pc-text-muted: #94a3b8;
    --pc-border: #334155;
    --pc-primary: #38bdf8;
    --pc-primary-hover: #0ea5e9;
    --pc-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

[data-theme="sunlight"] {
    --pc-bg: #ffffff;
    --pc-surface: #ffffff;
    --pc-surface-alt: #fef9c3;
    --pc-text: #000000;
    --pc-text-muted: #111111;
    --pc-border: #000000;
    --pc-primary: #003566;
    --pc-primary-hover: #001d3d;
    --pc-shadow: none;
}

body {
    font-family: var(--pc-font-sans);
    background-color: var(--pc-bg);
    color: var(--pc-text);
    transition: background-color 0.2s ease, color 0.2s ease;
}

h1,
h2,
.park-section h2,
.park-table-section h2 {
    font-family: var(--pc-font-display);
    letter-spacing: -0.01em;
}

/* Theme Surface Overrides */
[data-theme="dark"] header,
[data-theme="dark"] .controls-bar,
[data-theme="dark"] body.map-view-active .controls-bar,
[data-theme="dark"] .park-section,
[data-theme="dark"] .park-table-section,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .filter-panel,
[data-theme="dark"] .filter-footer,
[data-theme="dark"] .ride-card,
[data-theme="dark"] .filter-controls,
[data-theme="dark"] .log-history-panel,
[data-theme="dark"] .log-panel-header,
[data-theme="dark"] .log-date-filters,
[data-theme="dark"] .mobile-nav {
    background-color: var(--pc-surface) !important;
    color: var(--pc-text) !important;
    border-color: var(--pc-border) !important;
}

[data-theme="dark"] .ride-item,
[data-theme="dark"] .ride-card,
[data-theme="dark"] .log-entry-item {
    background-color: var(--pc-surface-alt) !important;
    color: var(--pc-text) !important;
    border-color: var(--pc-border) !important;
}

[data-theme="dark"] .ride-item-details {
    border-top-color: var(--pc-border) !important;
}

[data-theme="dark"] .ride-title,
[data-theme="dark"] .ride-card h3,
[data-theme="dark"] .park-section h2,
[data-theme="dark"] .park-table-section h2,
[data-theme="dark"] .modal-content h2,
[data-theme="dark"] .modal-content h3,
[data-theme="dark"] .modal-content label,
[data-theme="dark"] .filter-section>label,
[data-theme="dark"] .setting-item label,
[data-theme="dark"] .log-title {
    color: var(--pc-text) !important;
}

[data-theme="dark"] .park-table-section tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .park-table-section tbody tr:hover {
    background-color: rgba(56, 189, 248, 0.1) !important;
}

[data-theme="dark"] .park-table-section td {
    border-bottom-color: var(--pc-border) !important;
    color: var(--pc-text) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--pc-surface-alt) !important;
    color: var(--pc-text) !important;
    border-color: var(--pc-border) !important;
}

/* Sunlight High-Contrast Overrides (Direct Florida Sun Mode) */
[data-theme="sunlight"] header,
[data-theme="sunlight"] .controls-bar,
[data-theme="sunlight"] body.map-view-active .controls-bar,
[data-theme="sunlight"] .park-section,
[data-theme="sunlight"] .park-table-section,
[data-theme="sunlight"] .ride-item,
[data-theme="sunlight"] .ride-card,
[data-theme="sunlight"] .modal-content,
[data-theme="sunlight"] .filter-panel,
[data-theme="sunlight"] .filter-footer,
[data-theme="sunlight"] .notification-panel,
[data-theme="sunlight"] .log-history-panel,
[data-theme="sunlight"] .log-panel-header,
[data-theme="sunlight"] .log-date-filters,
[data-theme="sunlight"] .log-entry-item,
[data-theme="sunlight"] .mobile-nav {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: none !important;
}

[data-theme="sunlight"] header {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 3px solid #000000 !important;
}

[data-theme="sunlight"] header h1,
[data-theme="sunlight"] header .user-info,
[data-theme="sunlight"] header .user-info span,
[data-theme="sunlight"] .park-section h2,
[data-theme="sunlight"] .park-table-section h2,
[data-theme="sunlight"] .ride-title,
[data-theme="sunlight"] .last-updated-display,
[data-theme="sunlight"] .mobile-sort-controls .sort-label,
[data-theme="sunlight"] .filter-section>label,
[data-theme="sunlight"] .modal-content h2,
[data-theme="sunlight"] .modal-content h3,
[data-theme="sunlight"] .modal-content p,
[data-theme="sunlight"] .modal-content label,
[data-theme="sunlight"] .setting-item label,
[data-theme="sunlight"] .close-btn,
[data-theme="sunlight"] #close-filters-btn,
[data-theme="sunlight"] .close-nav-btn,
[data-theme="sunlight"] .mobile-nav-link,
[data-theme="sunlight"] .user-email-mobile {
    color: #000000 !important;
    font-weight: 800 !important;
}

[data-theme="sunlight"] .user-info .header-link,
[data-theme="sunlight"] .header-link {
    color: #002855 !important;
    font-weight: 900 !important;
    text-decoration: underline !important;
}

[data-theme="sunlight"] .hamburger-menu {
    background-color: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 6px !important;
    padding: 4px 5px !important;
    width: 36px !important;
    height: 30px !important;
}

[data-theme="sunlight"] .hamburger-menu span {
    background-color: #000000 !important;
    width: 100% !important;
    height: 3px !important;
}

/* All Header, Filter, Sort, View Toggle & Chip Buttons in Sunlight Mode */
[data-theme="sunlight"] .header-btn,
[data-theme="sunlight"] .map-controls-toggle,
[data-theme="sunlight"] .pc-theme-btn,
[data-theme="sunlight"] .notification-btn,
[data-theme="sunlight"] .view-toggle button,
[data-theme="sunlight"] .desktop-filters-btn,
[data-theme="sunlight"] #toggle-filters-btn-mobile,
[data-theme="sunlight"] .refresh-data-btn,
[data-theme="sunlight"] .mobile-sort-controls .sort-btn,
[data-theme="sunlight"] .desktop-controls .sort-btn,
[data-theme="sunlight"] .mobile-sort-controls .sort-direction-btn,
[data-theme="sunlight"] .quick-chip,
[data-theme="sunlight"] .filter-btn,
[data-theme="sunlight"] .filter-action-btn,
[data-theme="sunlight"] .wait-time-btn,
[data-theme="sunlight"] .log-filters button,
[data-theme="sunlight"] .log-date-filters button {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: 800 !important;
    opacity: 1 !important;
    box-shadow: 2px 2px 0px #000000 !important;
}

[data-theme="sunlight"] .header-btn:hover,
[data-theme="sunlight"] .map-controls-toggle:hover,
[data-theme="sunlight"] .pc-theme-btn:hover,
[data-theme="sunlight"] .view-toggle button:hover,
[data-theme="sunlight"] .desktop-filters-btn:hover,
[data-theme="sunlight"] #toggle-filters-btn-mobile:hover,
[data-theme="sunlight"] .refresh-data-btn:hover,
[data-theme="sunlight"] .quick-chip:hover {
    background-color: #fef08a !important;
    color: #000000 !important;
}

/* Active / Selected Buttons in Sunlight Mode */
[data-theme="sunlight"] .view-toggle button.active,
[data-theme="sunlight"] .desktop-filters-btn.active,
[data-theme="sunlight"] #toggle-filters-btn-mobile.active,
[data-theme="sunlight"] .mobile-sort-controls .sort-btn.active,
[data-theme="sunlight"] .desktop-controls .sort-btn.active,
[data-theme="sunlight"] .quick-chip.active,
[data-theme="sunlight"] .filter-btn.selected,
[data-theme="sunlight"] .wait-time-btn.selected,
[data-theme="sunlight"] .log-filters button.active {
    background-color: #002855 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
    font-weight: 900 !important;
    box-shadow: 2px 2px 0px #000000 !important;
}

/* Card & Table Action Buttons in Sunlight Mode */
[data-theme="sunlight"] .set-alert-btn,
[data-theme="sunlight"] .set-alert-btn-table,
[data-theme="sunlight"] .set-alert-btn-map,
[data-theme="sunlight"] #apply-filters-btn,
[data-theme="sunlight"] .modal-action-btn {
    background-color: #002855 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
    font-weight: 800 !important;
    box-shadow: 2px 2px 0px #000000 !important;
}

[data-theme="sunlight"] .set-alert-btn.alert-is-set,
[data-theme="sunlight"] .set-alert-btn-table.alert-is-set {
    background-color: #ffbe0b !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: 900 !important;
}

[data-theme="sunlight"] .log-visit-btn,
[data-theme="sunlight"] .log-visit-btn-table,
[data-theme="sunlight"] .log-visit-btn-map,
[data-theme="sunlight"] .park-section h2 .log-park-visit-btn,
[data-theme="sunlight"] .park-table-section h2 .log-park-visit-btn {
    background-color: #004b23 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
    font-weight: 800 !important;
    box-shadow: 2px 2px 0px #000000 !important;
}

[data-theme="sunlight"] .history-btn,
[data-theme="sunlight"] .park-table-section .history-btn,
[data-theme="sunlight"] .view-history-btn-map {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: 800 !important;
    box-shadow: 2px 2px 0px #000000 !important;
}

[data-theme="sunlight"] .details-btn,
[data-theme="sunlight"] .view-details-btn-map {
    background-color: #3c096c !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
    font-weight: 800 !important;
    box-shadow: 2px 2px 0px #000000 !important;
}

[data-theme="sunlight"] .fav-ride-btn {
    color: #000000 !important;
    font-weight: 900 !important;
}

[data-theme="sunlight"] .fav-ride-btn.is-fav {
    color: #d97706 !important;
    filter: drop-shadow(0 0 1px #000000);
}

/* Wait Times, Badges & Tables in Sunlight Mode */
[data-theme="sunlight"] .ride-wait-time,
[data-theme="sunlight"] .wait-time {
    font-weight: 900 !important;
    border: 2px solid #000000 !important;
    color: #000000 !important;
}

[data-theme="sunlight"] .low-wait .ride-wait-time {
    background-color: #86efac !important;
    color: #000000 !important;
}

[data-theme="sunlight"] .medium-wait .ride-wait-time {
    background-color: #fde047 !important;
    color: #000000 !important;
}

[data-theme="sunlight"] .high-wait .ride-wait-time {
    background-color: #fca5a5 !important;
    color: #000000 !important;
}

[data-theme="sunlight"] .park-table-section th {
    background-color: #002855 !important;
    color: #ffffff !important;
    border-bottom: 2px solid #000000 !important;
}

[data-theme="sunlight"] .park-table-section td {
    border-bottom: 1.5px solid #000000 !important;
    color: #000000 !important;
    font-weight: 700 !important;
}

[data-theme="sunlight"] .pc-feat-badge,
[data-theme="sunlight"] .pc-insight-badge,
[data-theme="sunlight"] .park-hours,
[data-theme="sunlight"] .park-info-badge {
    border: 1.5px solid #000000 !important;
    color: #000000 !important;
    background-color: #fef9c3 !important;
    font-weight: 800 !important;
}

[data-theme="sunlight"] .pc-bottom-nav {
    background-color: #ffffff !important;
    border-top: 3px solid #000000 !important;
}

[data-theme="sunlight"] .pc-bottom-nav-item {
    color: #000000 !important;
    font-weight: 800 !important;
}

[data-theme="sunlight"] .pc-bottom-nav-item.active {
    background-color: #fde047 !important;
    color: #000000 !important;
    font-weight: 900 !important;
}

/* Theme Switcher Button */
.pc-theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--pc-border);
    background: var(--pc-surface-alt);
    color: var(--pc-text);
    font-family: var(--pc-font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.pc-theme-btn:hover {
    border-color: var(--pc-primary);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .pc-theme-btn .theme-label {
        display: none;
    }

    .pc-theme-btn {
        padding: 6px 9px;
        margin-right: 4px;
    }
}

/* Offline Mode Banner */
.pc-offline-banner {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    max-width: 1200px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Quick-Search & Instant Filter Chip Bar */
.quick-discovery-bar,
.quick-search-bar {
    max-width: 1200px;
    margin: 12px auto 16px;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-search-wrapper,
.quick-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--pc-surface);
    border: 1.5px solid var(--pc-border);
    border-radius: 12px;
    padding: 4px 12px;
    box-shadow: var(--pc-shadow);
    transition: border-color 0.2s ease;
}

[data-theme="sunlight"] .quick-search-wrapper,
[data-theme="sunlight"] .quick-search-input-wrap {
    border: 2px solid #000000 !important;
    background: #ffffff !important;
    box-shadow: 2px 2px 0px #000000 !important;
}

.quick-search-wrapper:focus-within,
.quick-search-input-wrap:focus-within {
    border-color: var(--pc-primary);
}

.quick-search-icon {
    font-size: 1rem;
    margin-right: 8px;
    opacity: 0.7;
}

#quick-ride-search {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 8px 4px;
    font-size: 0.95rem;
    color: var(--pc-text);
    outline: none;
}

.clear-search-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--pc-text-muted);
    cursor: pointer;
    padding: 0 6px;
    line-height: 1;
}

.quick-filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.quick-filter-chips::-webkit-scrollbar {
    display: none;
}

.quick-chip {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--pc-border);
    background: var(--pc-surface);
    color: var(--pc-text);
    font-family: var(--pc-font-sans);
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.quick-chip:hover {
    border-color: var(--pc-primary);
}

.quick-chip.active {
    background: var(--pc-primary);
    color: #ffffff;
    border-color: var(--pc-primary);
    box-shadow: 0 2px 8px rgba(0, 119, 182, 0.28);
}

/* Watchlist Pinned Section & Favorite Star Button */
.watchlist-section {
    border: 2px solid rgba(245, 158, 11, 0.45) !important;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.06) 0%, var(--pc-surface) 100%) !important;
}

.fav-ride-btn {
    background: none;
    border: none;
    padding: 2px 5px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
    transition: transform 0.18s ease, color 0.18s ease;
    flex-shrink: 0;
}

.fav-ride-btn:hover {
    transform: scale(1.2);
}

.fav-ride-btn.is-fav {
    color: #f59e0b;
    text-shadow: 0 1px 4px rgba(245, 158, 11, 0.35);
}

/* Inline Sparklines, Predictive Insights & Feature Badges */
.pc-wait-cluster {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.pc-wait-top-line {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pc-sparkline-svg {
    width: 68px;
    height: 22px;
    overflow: visible;
    flex-shrink: 0;
}

.pc-insight-badges-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 2px;
}

.pc-insight-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    white-space: nowrap;
}

.pc-insight-low,
.insight-lowest,
.pc-insight-hist-low {
    background: rgba(16, 185, 129, 0.16);
    color: #059669;
}

.pc-insight-drop,
.insight-dropping {
    background: rgba(14, 165, 233, 0.16);
    color: #0284c7;
}

.pc-insight-peak,
.insight-peak,
.pc-insight-hist-high {
    background: rgba(239, 68, 68, 0.14);
    color: #dc2626;
}

.pc-insight-hist-normal {
    background: rgba(100, 116, 139, 0.12);
    color: var(--pc-text-muted);
}

[data-theme="dark"] .pc-insight-low,
[data-theme="dark"] .insight-lowest,
[data-theme="dark"] .pc-insight-hist-low {
    color: #34d399;
}

[data-theme="dark"] .pc-insight-drop,
[data-theme="dark"] .insight-dropping {
    color: #38bdf8;
}

[data-theme="dark"] .pc-insight-peak,
[data-theme="dark"] .insight-peak,
[data-theme="dark"] .pc-insight-hist-high {
    color: #f87171;
}

[data-theme="dark"] .pc-insight-hist-normal {
    color: #94a3b8;
}

[data-theme="sunlight"] .pc-insight-badge {
    border: 1.5px solid #000000 !important;
    font-weight: 900 !important;
    color: #000000 !important;
}

[data-theme="sunlight"] .pc-insight-low,
[data-theme="sunlight"] .insight-lowest,
[data-theme="sunlight"] .pc-insight-hist-low {
    background: #a7f3d0 !important;
}

[data-theme="sunlight"] .pc-insight-peak,
[data-theme="sunlight"] .insight-peak,
[data-theme="sunlight"] .pc-insight-hist-high {
    background: #fecaca !important;
}

[data-theme="sunlight"] .pc-insight-hist-normal {
    background: #f1f5f9 !important;
}

/* Historical Comparison Panel in Ride History Modal */
.pc-hist-summary-panel {
    background: var(--pc-surface-alt, #f8fafc);
    border: 1px solid var(--pc-border, #e2e8f0);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
    text-align: left;
}

.pc-hist-verdict-banner {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.84rem;
    margin-bottom: 10px;
    line-height: 1.35;
}

.pc-hist-verdict-banner.hist-verdict-low {
    background: rgba(16, 185, 129, 0.14);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.pc-hist-verdict-banner.hist-verdict-high {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.pc-hist-verdict-banner.hist-verdict-normal {
    background: rgba(14, 165, 233, 0.12);
    color: #075985;
    border: 1px solid rgba(14, 165, 233, 0.3);
}

[data-theme="dark"] .pc-hist-verdict-banner.hist-verdict-low {
    color: #6ee7b7;
}

[data-theme="dark"] .pc-hist-verdict-banner.hist-verdict-high {
    color: #fca5a5;
}

[data-theme="dark"] .pc-hist-verdict-banner.hist-verdict-normal {
    color: #7dd3fc;
}

.pc-hist-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

@media (max-width: 540px) {
    .pc-hist-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pc-hist-stat-box {
    background: var(--pc-surface, #ffffff);
    border: 1px solid var(--pc-border, #e2e8f0);
    border-radius: 8px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pc-hist-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--pc-text-muted, #64748b);
    margin-bottom: 2px;
}

.pc-hist-stat-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--pc-text, #0f172a);
}

.pc-hist-stat-sub {
    font-size: 0.68rem;
    color: var(--pc-text-muted, #64748b);
    margin-top: 2px;
}

.pc-hist-recent-days {
    border-top: 1px solid var(--pc-border, #e2e8f0);
    padding-top: 10px;
}

.pc-hist-recent-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pc-text-muted, #64748b);
    margin-bottom: 8px;
}

.pc-hist-days-count {
    font-weight: 600;
    background: rgba(14, 165, 233, 0.12);
    color: var(--pc-primary, #0284c7);
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
}

.pc-hist-days-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    height: 105px;
    padding-top: 14px;
}

.pc-hist-day-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.pc-hist-day-val {
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--pc-text, #0f172a);
    margin-bottom: 3px;
}

.pc-hist-day-bar-wrap {
    position: relative;
    width: 100%;
    max-width: 24px;
    height: 72px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pc-hist-day-bar-p90 {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(14, 165, 233, 0.22);
    border-radius: 4px 4px 0 0;
}

.pc-hist-day-bar-mean {
    position: relative;
    z-index: 1;
    width: 100%;
    background: var(--pc-primary, #0284c7);
    border-radius: 4px 4px 0 0;
}

.pc-hist-day-label {
    font-size: 0.65rem;
    color: var(--pc-text-muted, #64748b);
    margin-top: 4px;
    white-space: nowrap;
}

[data-theme="sunlight"] .pc-hist-summary-panel,
[data-theme="sunlight"] .pc-hist-stat-box,
[data-theme="sunlight"] .pc-hist-verdict-banner {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

[data-theme="sunlight"] .pc-hist-day-bar-mean {
    background: #002855 !important;
}

[data-theme="sunlight"] .pc-hist-day-bar-p90 {
    background: #94a3b8 !important;
}

.pc-feature-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.pc-feat-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.12);
    color: var(--pc-text-muted);
    white-space: nowrap;
}

.pc-feat-ll {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

[data-theme="dark"] .pc-feat-ll {
    color: #fbbf24;
}

.pc-feat-sr {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

[data-theme="dark"] .pc-feat-sr {
    color: #60a5fa;
}

.pc-feat-vq {
    background: rgba(168, 85, 247, 0.15);
    color: #7e22ce;
}

[data-theme="dark"] .pc-feat-vq {
    color: #c084fc;
}

/* Leaflet Marker Cluster Pill */
.pc-map-cluster-icon {
    background: none !important;
    border: none !important;
}

.pc-map-cluster-pill {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

/* Skeleton Shimmer Loader */
.pc-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.pc-skeleton-card {
    height: 110px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.12) 25%, rgba(148, 163, 184, 0.25) 50%, rgba(148, 163, 184, 0.12) 75%);
    background-size: 200% 100%;
    animation: pcShimmer 1.4s infinite;
}

@keyframes pcShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Toast Notifications */
.pc-toast-container {
    position: fixed;
    bottom: 84px;
    right: 16px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.pc-toast {
    background: #1e293b;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s ease;
}

.pc-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.pc-toast-success {
    border-left: 4px solid #10b981;
}

/* Sticky Mobile Bottom Navigation Bar */
.pc-bottom-nav {
    display: none;
}

.sheet-drag-handle {
    display: none;
}

@media (max-width: 768px) {
    body.has-pc-bottom-nav {
        padding-bottom: 82px !important;
    }

    .pc-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--pc-surface);
        border-top: 1px solid var(--pc-border);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
        z-index: 1080;
        justify-content: space-around;
        align-items: center;
    }

    .pc-bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        text-decoration: none;
        color: var(--pc-text-muted);
        font-size: 0.7rem;
        font-weight: 600;
        padding: 6px 0;
        transition: color 0.15s ease;
    }

    .pc-bottom-nav-item .nav-icon {
        font-size: 1.2rem;
        line-height: 1.1;
    }

    .pc-bottom-nav-item.active {
        color: var(--pc-primary);
    }

    /* Native Mobile Bottom Sheet Modals */
    /* Full-Screen Mobile Modals */
    .sheet-drag-handle {
        display: block;
        width: 42px;
        height: 5px;
        background: rgba(148, 163, 184, 0.5);
        border-radius: 999px;
        margin: 0 auto 12px;
        display: none !important;
    }

    .modal .modal-content {
        position: fixed !important;
        bottom: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 88vh !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
        border-radius: 20px 20px 0 0 !important;
        padding: 14px 20px 28px !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 0 !important;
        border: none !important;
        padding: 20px 18px 36px !important;
        box-sizing: border-box !important;
        animation: pcSlideUpSheet 0.22s ease-out;
    }

    @keyframes pcSlideUpSheet {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }
}

/* ============================================================================
   SMART TOURING HUB, NEXT RIDE RECOMMENDATION, DAY PLAN, PARTY WATCH & OVERLAYS
   ============================================================================ */

.smart-touring-hub {
    max-width: 1200px;
    margin: 0 auto 12px;
    padding: 0 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.map-view-active .smart-touring-hub {
    display: none;
}

.pc-touring-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pc-tour-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--pc-border, #e2e8f0);
    background: var(--pc-surface, #ffffff);
    color: var(--pc-text, #0f172a);
    font-size: 0.82rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.pc-tour-action-pill:hover {
    border-color: var(--pc-primary, #0284c7);
    transform: translateY(-1px);
}

.pc-tour-action-pill.active-party {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.pc-tour-action-pill.active-geofence {
    border-color: #0284c7;
    background: rgba(2, 132, 199, 0.1);
}

.pc-pill-badge {
    background: var(--pc-primary, #0284c7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
}

/* Just Reopened Alert Banner & Badge */
.pc-reopened-alert-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(16, 185, 129, 0.14) 100%);
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.pc-reopened-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #b45309;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

[data-theme="dark"] .pc-reopened-label {
    color: #fbbf24;
}

.pc-reopened-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pc-reopened-pill {
    background: var(--pc-surface, #fff);
    color: var(--pc-text, #0f172a);
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    cursor: pointer;
}

.pc-insight-reopened {
    background: rgba(245, 158, 11, 0.2);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.45);
}

[data-theme="dark"] .pc-insight-reopened {
    color: #fde68a;
}

/* "What Should I Ride Next?" Recommendation Card */
.pc-next-ride-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.09) 0%, rgba(16, 185, 129, 0.07) 100%);
    border: 1px solid rgba(2, 132, 199, 0.3);
    box-shadow: 0 3px 12px rgba(2, 132, 199, 0.07);
}

@media (max-width: 680px) {
    .pc-next-ride-card {
        flex-direction: column;
        align-items: stretch;
    }
}

.pc-next-ride-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--pc-primary, #0284c7);
    margin-bottom: 4px;
}

.pc-next-park-tag {
    background: rgba(2, 132, 199, 0.14);
    padding: 1px 7px;
    border-radius: 999px;
}

.pc-next-ride-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--pc-text, #0f172a);
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.pc-next-ride-wait {
    font-size: 0.82rem;
    font-weight: 800;
    background: #10b981;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
}

.pc-next-ride-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pc-reason-chip {
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--pc-surface, #fff);
    color: var(--pc-text-muted, #475569);
    border: 1px solid var(--pc-border, #e2e8f0);
    padding: 2px 8px;
    border-radius: 999px;
}

.pc-next-ride-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.pc-next-btn {
    padding: 7px 11px;
    border-radius: 9px;
    border: 1px solid var(--pc-border, #cbd5e1);
    background: var(--pc-surface, #fff);
    color: var(--pc-text, #0f172a);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.pc-next-btn.primary {
    background: var(--pc-primary, #0284c7);
    color: #fff;
    border-color: var(--pc-primary, #0284c7);
}

.pc-next-btn.in-plan,
.day-plan-btn.in-plan,
.day-plan-btn-table.in-plan {
    background: #059669 !important;
    color: #fff !important;
    border-color: #059669 !important;
}

.day-plan-btn,
.day-plan-btn-table {
    background: #0f766e;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

/* Hourly Crowd Heatmap & Best Time to Ride Panel */
.pc-hourly-forecast-panel {
    border-top: 1px solid var(--pc-border, #e2e8f0);
    padding-top: 10px;
    margin-bottom: 12px;
}

.pc-hourly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.pc-hourly-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--pc-text, #0f172a);
}

.pc-hourly-tag {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--pc-text-muted, #64748b);
    background: rgba(100, 116, 139, 0.12);
    padding: 2px 7px;
    border-radius: 999px;
}

.pc-hourly-callouts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.pc-hr-callout {
    font-size: 0.74rem;
    padding: 4px 8px;
    border-radius: 7px;
}

.pc-hr-callout.callout-best {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
}

[data-theme="dark"] .pc-hr-callout.callout-best {
    color: #6ee7b7;
}

.pc-hr-callout.callout-peak {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

[data-theme="dark"] .pc-hr-callout.callout-peak {
    color: #fca5a5;
}

.pc-hourly-bars-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3px;
    height: 92px;
    padding-top: 12px;
}

.pc-hr-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.pc-hr-col.is-now-hr .pc-hr-lbl {
    color: var(--pc-primary, #0284c7);
    font-weight: 900;
    text-decoration: underline;
}

.pc-hr-val {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--pc-text-muted, #64748b);
    margin-bottom: 2px;
}

.pc-hr-bar-track {
    width: 100%;
    max-width: 18px;
    height: 64px;
    display: flex;
    align-items: flex-end;
}

.pc-hr-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
}

.pc-hr-bar.hr-bar-low {
    background: #10b981;
}

.pc-hr-bar.hr-bar-mid {
    background: #0284c7;
}

.pc-hr-bar.hr-bar-high {
    background: #ef4444;
}

.pc-hr-lbl {
    font-size: 0.58rem;
    color: var(--pc-text-muted, #64748b);
    margin-top: 3px;
}

/* Community Wait Accuracy Pulse */
.pc-insight-pulse-fast {
    background: rgba(16, 185, 129, 0.16);
    color: #059669;
}

.pc-insight-pulse-slow {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.pc-insight-pulse-ok {
    background: rgba(14, 165, 233, 0.14);
    color: #0284c7;
}

[data-theme="dark"] .pc-insight-pulse-fast {
    color: #34d399;
}

[data-theme="dark"] .pc-insight-pulse-slow {
    color: #fbbf24;
}

[data-theme="dark"] .pc-insight-pulse-ok {
    color: #38bdf8;
}

.pc-community-pulse-card {
    background: var(--pc-surface-alt, #f8fafc);
    border: 1px solid var(--pc-border, #e2e8f0);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 12px 0;
}

.pc-pulse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.pc-pulse-count {
    font-size: 0.7rem;
    color: var(--pc-text-muted, #64748b);
    font-weight: 600;
}

.pc-pulse-verdict {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.pc-pulse-btn-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pc-pulse-vote-btn {
    flex: 1;
    padding: 7px 8px;
    border-radius: 8px;
    border: 1px solid var(--pc-border, #cbd5e1);
    background: var(--pc-surface, #fff);
    color: var(--pc-text, #0f172a);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.pc-pulse-vote-btn:hover {
    border-color: var(--pc-primary, #0284c7);
}

/* Feature Badge Additions (Dining & Best Time) */
.pc-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    color: var(--pc-text, #334155);
}

.badge-dining {
    background: rgba(236, 72, 153, 0.14);
    color: #be185d;
}

[data-theme="dark"] .badge-dining {
    color: #f472b6;
}

.badge-best-time {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

[data-theme="dark"] .badge-best-time {
    color: #6ee7b7;
}

/* My Day Plan Modal */
.pc-plan-quick-add-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: stretch;
}

.pc-plan-add-select {
    flex: 1;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--pc-border, #94a3b8);
    background-color: var(--pc-surface, #ffffff);
    color: var(--pc-text, #0f172a);
    font-size: 0.84rem;
    font-weight: 600;
}

.pc-plan-add-submit-btn {
    padding: 9px 14px;
    border-radius: 8px;
    border: 1.5px solid #0284c7;
    background-color: #0284c7;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.pc-plan-add-submit-btn:hover {
    background-color: #0369a1;
}

.pc-plan-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.pc-plan-stat-pill {
    font-size: 0.78rem;
    background: var(--pc-surface-alt, #f1f5f9);
    color: var(--pc-text, #0f172a);
    border: 1px solid var(--pc-border, #cbd5e1);
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.pc-plan-optimizer-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.pc-opt-btn {
    flex: 1;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1.5px solid var(--pc-primary, #0284c7);
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
}

.pc-opt-btn:hover {
    background: #bae6fd;
}

.pc-day-plan-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pc-plan-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: var(--pc-surface-alt, #f8fafc);
    color: var(--pc-text, #0f172a);
    border: 1px solid var(--pc-border, #cbd5e1);
}

.pc-plan-item.is-completed {
    opacity: 0.65;
}

.pc-plan-item.is-completed .pc-plan-item-title {
    text-decoration: line-through;
}

.pc-plan-check-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid var(--pc-primary, #0284c7);
    background: var(--pc-surface, #ffffff);
    color: var(--pc-primary, #0284c7);
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pc-plan-item-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.pc-plan-item-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--pc-text, #0f172a);
}

.pc-plan-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
    font-size: 0.74rem;
}

.pc-plan-wait-pill {
    font-weight: 700;
    color: #059669;
}

.pc-plan-wait-pill.down {
    color: #dc2626;
}

.pc-plan-best-time {
    color: var(--pc-text-muted, #64748b);
}

.pc-plan-item-actions {
    display: flex;
    gap: 4px;
}

.pc-plan-icon-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--pc-border, #94a3b8);
    background: var(--pc-surface, #ffffff);
    color: var(--pc-text, #0f172a);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pc-plan-icon-btn:hover {
    border-color: var(--pc-primary, #0284c7);
}

.pc-plan-icon-btn.remove {
    color: #dc2626;
    border-color: #fca5a5;
}

.pc-empty-plan-state {
    text-align: center;
    padding: 20px 12px;
    color: var(--pc-text, #0f172a);
    background: var(--pc-surface-alt, #f8fafc);
    border: 1px dashed var(--pc-border, #cbd5e1);
    border-radius: 12px;
}

.pc-empty-plan-state h4 {
    margin: 0 0 6px;
    color: var(--pc-text, #0f172a);
    font-size: 1rem;
}

.pc-empty-plan-state p {
    margin: 0 0 12px;
    color: var(--pc-text-muted, #475569);
    font-size: 0.84rem;
    line-height: 1.45;
}

.pc-empty-quick-picks {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--pc-border, #e2e8f0);
    text-align: left;
}

.pc-empty-picks-label {
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--pc-text, #0f172a);
    margin-bottom: 8px;
}

.pc-empty-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 6px;
}

.pc-empty-pick-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--pc-primary, #0284c7);
    background: var(--pc-surface, #ffffff);
    color: var(--pc-text, #0f172a);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.pc-empty-pick-btn:hover {
    background: rgba(2, 132, 199, 0.08);
}

.pc-empty-pick-wait {
    background: #10b981;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    flex-shrink: 0;
}

/* Party Watch Modal & Map Pins */
.pc-party-field {
    margin-bottom: 12px;
}

.pc-party-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--pc-text, #0f172a);
}

.pc-party-field input,
.pc-party-join-row input {
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid var(--pc-border, #cbd5e1);
    background: var(--pc-surface, #ffffff);
    color: var(--pc-text, #0f172a);
    box-sizing: border-box;
}

.pc-party-divider {
    text-align: center;
    margin: 14px 0;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--pc-text-muted, #64748b);
}

.pc-party-join-row {
    display: flex;
    gap: 8px;
}

.pc-party-code-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(2, 132, 199, 0.1);
    border: 1px solid rgba(2, 132, 199, 0.35);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
    color: var(--pc-text, #0f172a);
}

.pc-party-code-lbl {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--pc-primary, #0284c7);
}

.pc-party-code-val {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: var(--pc-text, #0f172a);
}

.pc-party-members-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    margin-bottom: 12px;
    color: var(--pc-text, #0f172a);
}

.pc-member-chip {
    background: var(--pc-surface-alt, #e2e8f0);
    color: var(--pc-text, #0f172a);
    border: 1px solid var(--pc-border, #cbd5e1);
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.76rem;
}

.pc-party-pin-btns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.pc-party-pin-btn {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--pc-border, #94a3b8);
    background: var(--pc-surface, #ffffff);
    color: var(--pc-text, #0f172a);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.pc-party-feed-box {
    background: var(--pc-surface-alt, #f8fafc);
    color: var(--pc-text, #0f172a);
    border: 1px solid var(--pc-border, #e2e8f0);
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    font-size: 0.8rem;
}

.pc-party-feed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--pc-border, #e2e8f0);
    color: var(--pc-text, #0f172a);
    font-size: 0.78rem;
}

.pc-party-feed-item:last-child {
    border-bottom: none;
}

.pc-party-pin-bubble {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 2.5px solid #0284c7;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* History Modal Table Styling */
#history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.86rem;
}

#history-table th {
    background-color: var(--pc-primary, #0077b6);
    color: #ffffff;
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
}

#history-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--pc-border, #e2e8f0);
    color: var(--pc-text, #0f172a);
    text-align: left;
}

#history-table tbody tr:nth-child(even) {
    background-color: var(--pc-surface-alt, #f8fafc);
}

/* Custom Map Overlays & Nearest Restroom/Hydration Bar */
.pc-map-utility-bar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 950;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 94vw;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(8px);
    padding: 7px 10px;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.pc-map-util-pill {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.pc-map-util-pill.active {
    background: #0284c7;
    border-color: #38bdf8;
}

.pc-map-nearest-callout {
    width: 100%;
    text-align: center;
    font-size: 0.76rem;
    color: #f8fafc;
    padding-top: 4px;
}

/* ============================================================================
   COMPREHENSIVE MODAL & BUTTON CONTRAST GUARANTEES (DARK & SUNLIGHT THEMES)
   ============================================================================ */

/* Dark Mode Modal & Control Contrast Overrides */
[data-theme="dark"] .modal-content p,
[data-theme="dark"] .modal-content h4,
[data-theme="dark"] .modal-content strong,
[data-theme="dark"] .modal-content li,
[data-theme="dark"] #log-visit-form label,
[data-theme="dark"] .alert-option-section h4,
[data-theme="dark"] .alert-item-name,
[data-theme="dark"] .alert-item-condition,
[data-theme="dark"] .filter-header h2,
[data-theme="dark"] .log-panel-header h3 {
    color: var(--pc-text, #f8fafc) !important;
}

[data-theme="dark"] .close-btn,
[data-theme="dark"] #close-filters-btn,
[data-theme="dark"] .log-panel-header button {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .close-btn:hover,
[data-theme="dark"] #close-filters-btn:hover {
    color: #ffffff !important;
}

[data-theme="dark"] .pc-opt-btn {
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
}

[data-theme="dark"] .pc-plan-stat-pill,
[data-theme="dark"] .pc-plan-item,
[data-theme="dark"] .pc-empty-plan-state,
[data-theme="dark"] .pc-community-pulse-card,
[data-theme="dark"] .pc-party-feed-box,
[data-theme="dark"] .alert-list-item.global-alert-item,
[data-theme="dark"] #install-instructions {
    background-color: var(--pc-surface-alt, #1e293b) !important;
    color: var(--pc-text, #f8fafc) !important;
    border-color: var(--pc-border, #334155) !important;
}

[data-theme="dark"] .pc-plan-check-btn {
    background-color: #0f172a !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
}

[data-theme="dark"] .pc-plan-icon-btn,
[data-theme="dark"] .pc-pulse-vote-btn,
[data-theme="dark"] .pc-party-pin-btn,
[data-theme="dark"] .pc-empty-pick-btn,
[data-theme="dark"] .wait-time-btn,
[data-theme="dark"] .filter-action-btn:not(.danger-btn):not(.reset-btn) {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #475569 !important;
}

[data-theme="dark"] .pc-plan-icon-btn.remove {
    color: #f87171 !important;
    border-color: #ef4444 !important;
}

[data-theme="dark"] .wait-time-btn.selected {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
}

[data-theme="dark"] .alert-item-controls .edit-btn {
    background-color: #0f172a !important;
    color: #38bdf8 !important;
    border: 1px solid #38bdf8 !important;
}

[data-theme="dark"] .alert-item-controls .delete-btn {
    background-color: #0f172a !important;
    color: #f87171 !important;
    border: 1px solid #ef4444 !important;
}

[data-theme="dark"] .set-alert-btn-table {
    background-color: #0f172a !important;
    color: #38bdf8 !important;
    border-color: #38bdf8 !important;
}

[data-theme="dark"] .log-visit-btn-table {
    background-color: #0f172a !important;
    color: #2dd4bf !important;
    border-color: #14b8a6 !important;
}

[data-theme="dark"] .park-table-section .history-btn {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #64748b !important;
}

[data-theme="dark"] .type-pill-btn:not(.selected),
[data-theme="dark"] .crowd-pill-btn:not(.selected) {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border: 2px solid #94a3b8 !important;
}

[data-theme="dark"] .custom-dropdown-item:hover {
    background-color: rgba(56, 189, 248, 0.12) !important;
}

/* Sunlight Mode High-Contrast Support for All Modals & Touring Elements */
[data-theme="sunlight"] .pc-tour-action-pill,
[data-theme="sunlight"] .pc-next-ride-card,
[data-theme="sunlight"] .pc-reopened-alert-bar,
[data-theme="sunlight"] .pc-next-btn,
[data-theme="sunlight"] .day-plan-btn,
[data-theme="sunlight"] .day-plan-btn-table,
[data-theme="sunlight"] .pc-opt-btn,
[data-theme="sunlight"] .pc-pulse-vote-btn,
[data-theme="sunlight"] .pc-party-pin-btn,
[data-theme="sunlight"] .pc-plan-icon-btn,
[data-theme="sunlight"] .pc-empty-pick-btn,
[data-theme="sunlight"] .alert-item-controls .edit-btn,
[data-theme="sunlight"] .alert-item-controls .delete-btn,
[data-theme="sunlight"] .custom-dropdown-trigger {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: 800 !important;
    box-shadow: 2px 2px 0px #000000 !important;
}

[data-theme="sunlight"] .pc-plan-check-btn,
[data-theme="sunlight"] .pc-plan-stat-pill,
[data-theme="sunlight"] .pc-member-chip,
[data-theme="sunlight"] .pc-reason-chip,
[data-theme="sunlight"] .alert-list-item.global-alert-item {
    background: #fef9c3 !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: 800 !important;
}

[data-theme="sunlight"] .pc-plan-item,
[data-theme="sunlight"] .pc-empty-plan-state,
[data-theme="sunlight"] .pc-community-pulse-card,
[data-theme="sunlight"] .pc-party-feed-box,
[data-theme="sunlight"] .pc-party-code-banner,
[data-theme="sunlight"] .pc-hourly-forecast-panel,
[data-theme="sunlight"] .custom-dropdown-menu {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

[data-theme="sunlight"] .pc-plan-add-select,
[data-theme="sunlight"] .modal-content input,
[data-theme="sunlight"] .modal-content select,
[data-theme="sunlight"] .modal-content textarea {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: 700 !important;
}

[data-theme="sunlight"] .pc-next-btn.primary,
[data-theme="sunlight"] .pc-plan-add-submit-btn,
[data-theme="sunlight"] .day-plan-btn.in-plan,
[data-theme="sunlight"] .day-plan-btn-table.in-plan {
    background: #002855 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
    box-shadow: 2px 2px 0px #000000 !important;
}

[data-theme="sunlight"] #history-table th {
    background-color: #002855 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
}

[data-theme="sunlight"] #history-table td {
    color: #000000 !important;
    border-bottom: 1.5px solid #000000 !important;
    font-weight: 700 !important;
}

[data-theme="sunlight"] .modal-content h4,
[data-theme="sunlight"] .modal-content strong,
[data-theme="sunlight"] .modal-content li,
[data-theme="sunlight"] .pc-plan-item-title,
[data-theme="sunlight"] .pc-party-code-val,
[data-theme="sunlight"] .pc-hourly-title {
    color: #000000 !important;
    font-weight: 800 !important;
}