/* assets/css/main.css */

/* ---------------------------------------------------------------
   CSS Custom Properties
--------------------------------------------------------------- */
:root {
    --bg:            #f4f4f4;
    --surface:       #ffffff;
    --surface-alt:   #f0f0f0;
    --text:          #1a1a2e;
    --text-muted:    #666;
    --border:        #ccc;
    --primary:       #0057b8;
    --primary-hover: #003d82;
    --nav-bg:        #1a1a2e;
    --nav-text:      #e8e8f0;
    --nav-active:    #ffffff;
    --nav-height:    52px;
    --radius:        6px;
    --shadow:        0 2px 8px rgba(0,0,0,0.10);

    /* Crowd score colors */
    --crowd-1: #1a9e5c; --crowd-2: #2ecc71;
    --crowd-3: #8bc34a; --crowd-4: #cddc39;
    --crowd-5: #ffc107; --crowd-6: #ff9800;
    --crowd-7: #ff5722; --crowd-8: #f44336;
    --crowd-9: #d32f2f; --crowd-10: #880e0e;

    /* Wait time badge colors */
    --badge-green:  #28a745;
    --badge-yellow: #ffc107;
    --badge-red:    #dc3545;
    --badge-gray:   #808080;
}

[data-theme="dark"] {
    --bg:          #0d1117;
    --surface:     #161b22;
    --surface-alt: #21262d;
    --text:        #e6edf3;
    --text-muted:  #8b949e;
    --border:      #30363d;
    --nav-bg:      #010409;
}

/* ---------------------------------------------------------------
   Base
--------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    transition: background 0.2s, color 0.2s;
}

/* Legacy dark-mode class support (dashboard.php) */
body.dark-mode { background: #121212; color: #eee; }

.page-content { padding: 1rem; }

/* ---------------------------------------------------------------
   Navigation Bar
--------------------------------------------------------------- */
.main-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--nav-bg);
    height: var(--nav-height);
    padding: 0 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--nav-active);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    margin-right: 1.5rem;
}
.nav-brand-icon { font-size: 1.3rem; }

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    flex: 1;
}
.nav-links li a {
    display: block;
    padding: 0 14px;
    height: var(--nav-height);
    line-height: var(--nav-height);
    color: var(--nav-text);
    text-decoration: none;
    font-size: 0.88rem;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.nav-links li a:hover  { color: var(--nav-active); }
.nav-links li a.active { color: var(--nav-active); border-bottom-color: #4da6ff; font-weight: 600; }

.nav-dark-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    color: var(--nav-text);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 10px;
    margin-left: auto;
    transition: background 0.15s;
}
.nav-dark-toggle:hover { background: rgba(255,255,255,0.1); }

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--nav-text);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--nav-bg); flex-direction: column; padding: 0.5rem 0; box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
    .nav-links.open { display: flex; }
    .nav-links li a { height: auto; line-height: 1; padding: 12px 1.5rem; border-bottom: none; border-left: 3px solid transparent; }
    .nav-links li a.active { border-left-color: #4da6ff; border-bottom: none; }
    .nav-hamburger { display: block; }
    .nav-dark-toggle { margin-left: 0; }
}

/* ---------------------------------------------------------------
   Crowd Score Colors (shared utility classes)
--------------------------------------------------------------- */
.score-1  { background: var(--crowd-1);  color: #fff; }
.score-2  { background: var(--crowd-2);  color: #fff; }
.score-3  { background: var(--crowd-3);  color: #333; }
.score-4  { background: var(--crowd-4);  color: #333; }
.score-5  { background: var(--crowd-5);  color: #333; }
.score-6  { background: var(--crowd-6);  color: #fff; }
.score-7  { background: var(--crowd-7);  color: #fff; }
.score-8  { background: var(--crowd-8);  color: #fff; }
.score-9  { background: var(--crowd-9);  color: #fff; }
.score-10 { background: var(--crowd-10); color: #fff; }

/* Percentile rating badges */
.rating-quiet     { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.rating-average   { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.rating-busy      { background: #ffe0b2; color: #7f3000; border: 1px solid #ffcc80; }
.rating-very-busy { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
[data-theme="dark"] .rating-quiet     { background: #1a3a22; color: #80e090; border-color: #2a5a32; }
[data-theme="dark"] .rating-average   { background: #3a3000; color: #ffd060; border-color: #5a4800; }
[data-theme="dark"] .rating-busy      { background: #3a1e00; color: #ffaa60; border-color: #5a2e00; }
[data-theme="dark"] .rating-very-busy { background: #3a0e12; color: #ff8090; border-color: #5a1e22; }

.rating-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 12px;
    white-space: nowrap;
}

/* ---------------------------------------------------------------
   Shared card / stat components
--------------------------------------------------------------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 1rem 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.stat-card .stat-sub   { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.crowd-score-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    margin: 1rem 0;
}
.crowd-score-card .score-bubble {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 800;
    flex-shrink: 0;
}
.crowd-score-card .score-info .score-title  { font-weight: 700; font-size: 1rem; }
.crowd-score-card .score-info .score-desc   { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }
.crowd-score-card .score-info .score-context{ font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; font-style: italic; }

/* ---------------------------------------------------------------
   Chart containers
--------------------------------------------------------------- */
.chart-wrap {
    position: relative;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 1rem 0;
    box-shadow: var(--shadow);
}
.chart-wrap canvas { display: block; }
.chart-wrap h3 { margin: 0 0 12px; font-size: 0.95rem; color: var(--text-muted); }

/* ---------------------------------------------------------------
   Existing dashboard styles (preserved)
--------------------------------------------------------------- */
h1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
h1 button { margin-left: 10px; padding: 8px 12px; cursor: pointer; border: 1px solid #ccc; background: #fff; border-radius: 4px; }
body.dark-mode h1 button { background: #1e1e1e; border-color: #444; color: #eee; }
h2 { margin: 0.5em 0; }
h2 span.snapshot-time { font-weight: normal; font-size: 0.8em; margin-left: 10px; color: #666; }
body.dark-mode h2 span.snapshot-time { color: #aaa; }
.badge { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.badge-green { background: green; } .badge-yellow { background: gold; } .badge-red { background: red; } .badge-gray { background: gray; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; background: #fff; }
body.dark-mode table { background: #1e1e1e; }
.rides, .shows, .favorites, .search-results, .park-hours, .trends { table-layout: fixed; }
th, td { border: 1px solid #ccc; padding: 6px 10px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.dark-mode th, body.dark-mode td { border-color: #444; }
th { cursor: pointer; background: #f0f0f0; }
body.dark-mode th { background: #2a2a2a; }
.rides th:nth-child(1), .rides td:nth-child(1) { width: 25%; }
.rides th:nth-child(2), .rides td:nth-child(2) { width: 15%; }
.rides th:nth-child(3), .rides td:nth-child(3) { width: 20%; } /* Land */
.rides th:nth-child(4), .rides td:nth-child(4) { width: 15%; } /* Last Updated */
.rides th:nth-child(5), .rides td:nth-child(5) { width: 10%; } /* Today */
.rides th:nth-child(6), .rides td:nth-child(6) { width: 10%; } /* 7-day */
.rides th:nth-child(7), .rides td:nth-child(7) { width: 10%; } /* 30-day */
.shows th:nth-child(1), .shows td:nth-child(1) { width: 35%; }
.shows th:nth-child(2), .shows td:nth-child(2) { width: 40%; }
.shows th:nth-child(3), .shows td:nth-child(3) { width: 25%; } /* Land */
.shows .show-name-col, .favorites .show-name-col, .search-results .show-name-col { white-space: normal; word-break: break-word; overflow: visible; text-overflow: unset; }
.shows .times-col, .favorites .times-col, .search-results .times-col { white-space: normal; word-break: break-word; overflow: visible; text-overflow: unset; }
.park-hours th:nth-child(1), .park-hours td:nth-child(1), .park-hours th:nth-child(2), .park-hours td:nth-child(2), .park-hours th:nth-child(3), .park-hours td:nth-child(3) { width: 33.33%; }
.trends th:nth-child(1), .trends td:nth-child(1), .trends th:nth-child(2), .trends td:nth-child(2) { width: 50%; }
#searchBoxContainer { position: sticky; top: 0; background: #f4f4f4; z-index: 1000; padding: 0.5em 0; margin: 1em 0; transition: background 0.3s; }
body.dark-mode #searchBoxContainer { background: #121212; }
#searchBox { width: 100%; padding: 0.5em; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; }
.toggle-btns { margin: 1em 0; display: flex; flex-wrap: wrap; gap: 10px; }
.toggle-btns button, .toggle-btns label { padding: 6px 12px; cursor: pointer; border: 1px solid #ccc; background: #fff; border-radius: 4px; }
body.dark-mode .toggle-btns button, body.dark-mode .toggle-btns label { background: #1e1e1e; border-color: #444; color: #eee; }
.toggle-btns button.active { background: #ddd; font-weight: bold; }
body.dark-mode .toggle-btns button.active { background: #444; }
.column-selector { margin: 1em 0; display: flex; flex-wrap: wrap; gap: 10px; }
.column-selector label { margin-right: 10px; display: flex; align-items: center; }
#settingsPanel { padding: 1em; border: 1px solid #ccc; margin: 1em 0; background: #fff; border-radius: 4px; transition: background 0.3s; }
body.dark-mode #settingsPanel { background: #1e1e1e; border-color: #444; }
.error { background: #fee; border: 1px solid #900; padding: 1em; margin: 1em 0; border-radius: 4px; }
body.dark-mode .error { background: #3a1c1c; border-color: #c44; }
.section { margin-bottom: 2rem; }
.calendar-section { margin: 1em 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.calendar-section label { margin-right: 10px; }
.chart-container { width: 100%; max-width: 800px; height: 300px; margin: 1em auto 2rem auto; position: relative; }
.chart-container canvas { width: 100%; height: 100%; }
/* Collapse chart container when canvas is hidden (no data) */
.chart-container:has(canvas[style*="display: none"]) { height: auto; min-height: 0; }
.chart-container:has(canvas[style*="display: none"]) .chart-title { margin-bottom: 0; }
.chart-title { text-align: center; font-size: 1.2em; margin: 0.5em 0; }
.chart-hidden { display: none !important; }
#favorites, #searchResults { margin-bottom: 1.5rem; }
.favorites-header, .search-header { display: flex; align-items: center; margin-bottom: 0.5em; }
.favorites-header h2, .search-header h2 { margin: 0; }
.clear-search-btn { background: #ddd; border: none; padding: 6px 12px; cursor: pointer; font-size: 0.9em; margin-left: 10px; border-radius: 4px; }
.clear-search-btn:hover { background: #ccc; }
body.dark-mode .clear-search-btn { background: #444; color: #eee; }
body.dark-mode .clear-search-btn:hover { background: #555; }
.favorite-star { cursor: pointer; margin-right: 5px; user-select: none; }
.favorite-star.favorited::before { content: '★'; color: gold; }
.favorite-star:not(.favorited)::before { content: '☆'; color: #ccc; }
body.dark-mode .favorite-star:not(.favorited)::before { color: #888; }
.ride-name { cursor: pointer; text-decoration: underline; color: #007bff; }
.ride-name:hover { color: #0056b3; }
body.dark-mode .ride-name { color: #4da8ff; }
body.dark-mode .ride-name:hover { color: #2b8cff; }
.chart-date-selector { margin: 0.5rem 0; font-size: 0.9em; }
.chart-date-selector label { display: inline-block; margin-right: 1rem; }
.chart-date-selector input[type="checkbox"] { margin-right: 0.3rem; }
p.no-data { text-align: center; color: #777; margin-top: 20px; }
body.dark-mode p.no-data { color: #aaa; }

/* Modal Styles */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #fff; padding: 20px; border-radius: 5px; width: 90%; max-width: 800px; max-height: 90vh; overflow-y: auto; position: relative; }
body.dark-mode .modal-content { background: #1e1e1e; color: #eee; }
.modal-close { position: absolute; top: 10px; right: 10px; background: none; border: none; font-size: 1.5em; cursor: pointer; }
body.dark-mode .modal-close { color: #eee; }
.modal table { margin-top: 1em; }
.modal table th, .modal table td { width: 50%; }
.modal canvas { margin-top: 1em; }

@media (max-width: 768px) {
    .toggle-btns { flex-direction: column; align-items: flex-start; }
    .calendar-section { flex-direction: column; align-items: flex-start; }
    table th, table td { font-size: 0.9em; padding: 4px; }
    .rides th:nth-child(1), .rides td:nth-child(1) { width: 35%; }
    .rides th:nth-child(2), .rides td:nth-child(2) { width: 25%; }
    .rides th:nth-child(3), .rides td:nth-child(3), .rides th:nth-child(4), .rides td:nth-child(4), .rides th:nth-child(5), .rides td:nth-child(5), .rides th:nth-child(6), .rides td:nth-child(6), .rides th:nth-child(7), .rides td:nth-child(7) { display: none; }
    .shows th:nth-child(1), .shows td:nth-child(1) { width: 45%; }
    .shows th:nth-child(2), .shows td:nth-child(2) { width: 55%; }
    .shows th:nth-child(3), .shows td:nth-child(3) { display:none; }
    .optional-col { display: none !important; }
}
/* Spacing for Ride Details Modal Chart */
#rideDetailsChartContainer {
    margin-bottom: 20px;
}

/* Styling for Ride Details Modal "Longest Wait Recorded" Section */
#longestWaitSection {
    margin-top: 20px;
    padding-top: 15px;
}

#longestWaitSection h4 {
    margin-top: 0;
    margin-bottom: 5px;
}

/* ---------------------------------------------------------------
   Dashboard: Controls Bar
--------------------------------------------------------------- */
.dash-controls-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

.dash-controls-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.dash-controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-ctrl-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.dash-date-input {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.88rem;
    padding: 5px 9px;
    width: 120px;
    cursor: pointer;
}
.dash-date-input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.dash-snapshot-select {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.88rem;
    padding: 5px 9px;
    cursor: pointer;
}

.dash-btn {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    padding: 5px 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.dash-btn:hover { background: var(--border); }

.dash-search-input {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.88rem;
    padding: 5px 10px;
    width: 220px;
    transition: border-color 0.15s;
}
.dash-search-input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.dash-search-input::placeholder { color: var(--text-muted); }

/* ---------------------------------------------------------------
   Dashboard: Settings Panel
--------------------------------------------------------------- */
.dash-settings {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

.dash-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px 24px;
}

.dash-settings-grid strong {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.dash-settings-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-bottom: 4px;
}

/* ---------------------------------------------------------------
   Dashboard: Park / View Tabs
--------------------------------------------------------------- */
.dash-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 6px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }

.dash-tab {
    background: none;
    border: 1px solid transparent;
    border-radius: calc(var(--radius) - 2px);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.83rem;
    padding: 5px 12px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.dash-tab:hover  { background: var(--surface-alt); color: var(--text); }
.dash-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }

.dash-tab-spacer { flex: 1; min-width: 8px; }

.dash-tab-check {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.83rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.dash-tab-check input { cursor: pointer; }

/* ---------------------------------------------------------------
   Dashboard: Park Hours Strip
--------------------------------------------------------------- */
.dash-hours-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 14px;
    margin-bottom: 10px;
    font-size: 0.82rem;
    box-shadow: var(--shadow);
}

.dash-hours-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-hours-park {
    font-weight: 600;
    color: var(--text);
}

.dash-hours-time {
    color: var(--text-muted);
}

/* ---------------------------------------------------------------
   Dashboard: Park Block
--------------------------------------------------------------- */
.park-block {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ---------------------------------------------------------------
   Dashboard: Park Header
--------------------------------------------------------------- */
.park-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px 8px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}

.park-header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.park-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
}

.park-hours-inline {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.park-hours-inline::before { content: '🕘 '; }

.park-snapshot-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
}

.park-crowd-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    min-height: 52px;
    border-radius: var(--radius);
    padding: 4px 6px;
    flex-shrink: 0;
    text-align: center;
}

.pcb-num {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.pcb-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    opacity: 0.9;
}

/* ---------------------------------------------------------------
   Dashboard: Quick Stat Strip
--------------------------------------------------------------- */
.dash-stat-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.dash-stat-card {
    padding: 10px 14px;
    text-align: center;
    border-right: 1px solid var(--border);
}
.dash-stat-card:last-child { border-right: none; }

.dsc-val {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
}

.dsc-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.3;
}
.dsc-lbl small { font-size: 0.68rem; opacity: 0.8; }

/* ---------------------------------------------------------------
   Dashboard: Rides Table (inside park-block)
--------------------------------------------------------------- */
.park-block table {
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.park-block table th,
.park-block table td {
    border-color: var(--border);
}
.park-block table th {
    background: var(--surface-alt);
    font-size: 0.8rem;
    font-weight: 600;
}
.park-block table td {
    font-size: 0.85rem;
    color: var(--text);
}

/* ---------------------------------------------------------------
   Dashboard: Shows & Chart collapsible sections
--------------------------------------------------------------- */
.dash-shows-section,
.dash-chart-section {
    border-top: 1px solid var(--border);
}

.dash-shows-section > summary,
.dash-chart-section > summary {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    background: var(--surface-alt);
    transition: background 0.15s, color 0.15s;
}
.dash-shows-section > summary::before { content: '▶'; font-size: 0.7rem; transition: transform 0.15s; }
.dash-chart-section  > summary::before { content: '▶'; font-size: 0.7rem; transition: transform 0.15s; }

.dash-shows-section[open] > summary::before,
.dash-chart-section[open]  > summary::before { transform: rotate(90deg); }

.dash-shows-section > summary:hover,
.dash-chart-section > summary:hover { background: var(--border); color: var(--text); }

.dash-shows-section > summary::-webkit-details-marker,
.dash-chart-section > summary::-webkit-details-marker { display: none; }

.dash-chart-section .chart-container {
    margin: 0;
    padding: 12px 16px 16px;
    max-width: 100%;
    height: 260px;
    border: none;
    background: var(--surface);
}

/* ---------------------------------------------------------------
   Dashboard: Closed ride rows (hidden by default, shown via toggle)
--------------------------------------------------------------- */
.ride-row[data-wait="Closed"] td {
    color: var(--text-muted);
    font-style: italic;
}
.ride-row[data-wait="Closed"] .ride-name {
    color: var(--text-muted);
    text-decoration: none;
    cursor: default;
}

/* ---------------------------------------------------------------
   Data quality warning banner (best-time, planning pages)
--------------------------------------------------------------- */
.dq-warning {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    color: #7a5800;
    font-size: 0.85rem;
    padding: 10px 14px;
    margin: 8px 0 12px;
    line-height: 1.5;
}
[data-theme="dark"] .dq-warning {
    background: #2a1f00;
    border-color: #5a3e00;
    color: #ffd060;
}

/* ---------------------------------------------------------------
   Dashboard: Responsive
--------------------------------------------------------------- */
@media (max-width: 768px) {
    .dash-controls-bar { padding: 6px 10px; }
    .dash-search-input { width: 160px; }
    .dash-stat-strip { grid-template-columns: repeat(2, 1fr); }
    .dash-stat-card:nth-child(2) { border-right: none; }
    .park-crowd-badge { width: 54px; min-height: 44px; }
    .pcb-num { font-size: 1.3rem; }
    .dash-tabs { gap: 1px; }
    .dash-tab { padding: 5px 9px; font-size: 0.78rem; }
}
