/* --- Global Reset & Base Styles (Copied from waitTimes.css) --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #222;
}

/* --- Header & Navigation (Copied from waitTimes.css) --- */
header {
    background-color: #007bff;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1010;
}

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

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

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

.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);
}

/* Hamburger Menu */
.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;
}

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

/* Mobile Nav */
.mobile-nav {
    display: flex;
    flex-direction: column;
    background: #0056b3;
    height: 100%;
    padding: 2rem;
    position: fixed;
    top: 0;
    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.5);
}

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

.mobile-user-info {
    padding-bottom: 1rem;
    text-align: center;
    color: white;
}

.mobile-user-info span {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.mobile-nav-link {
    font-size: 1.2rem;
    padding: 1rem 0.5rem;
    font-weight: bold;
    color: #FFF;
    text-decoration: none;
    transition: color 0.3s linear;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-link:hover {
    color: #00c040;
}

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

/* --- Challenges Layout & Components --- */
.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Page Header */
.page-header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.page-title h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #111;
    font-weight: 800;
}

.page-title p {
    margin: 5px 0 0;
    color: #444;
    font-weight: 500;
}

/* Dashboard Tabs */
.dashboard-tabs {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.tab-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.tab-btn.inactive {
    background: #6c757d;
}

/* Intro Section */
#active-section {
    text-align: center;
}

#intro-message {
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
}

#intro-message h2 {
    font-size: 2rem;
    color: #111;
    margin-bottom: 10px;
}

#intro-message p {
    font-size: 1.1rem;
    color: #333;
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.5;
}

/* Buttons */
.hero-btn {
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.hero-btn:hover {
    background-color: #003d80;
    transform: translateY(-2px);
}

.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    color: #0056b3;
    font-weight: 700;
    font-size: 1rem;
    padding: 5px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link-muted {
    color: #444;
}

/* Selection Grid */
#selection-section {
    display: none;
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.challenge-option-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
    border: 2px solid #ddd;
    display: flex;
    flex-direction: column;
}

.challenge-option-card:hover {
    transform: translateY(-5px);
    border-color: #0056b3;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.challenge-option-header {
    background: #f1f3f5;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.challenge-option-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #0056b3;
    font-weight: 800;
}

.challenge-option-body {
    padding: 20px;
    color: #333;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-weight: 500;
}

/* Setup Section */
.setup-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
    display: none;
    border: 1px solid #ddd;
}

.setup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.setup-header h2 {
    color: #111;
    margin: 0;
}

.setup-description {
    margin-bottom: 15px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

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

.setup-form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #222;
}

.setup-form-group select,
.setup-form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    color: #111;
}

.setup-form-group input:focus {
    border-color: #0056b3;
    outline: none;
}

/* Challenge Card */
.challenge-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: 25px;
    border-top: 6px solid #0056b3;
}

.challenge-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.challenge-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #111;
    font-weight: 800;
}

.challenge-controls {
    display: flex;
    gap: 10px;
}

.header-control-btn {
    background: white;
    border: 2px solid #ccc;
    color: #444;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.header-control-btn:hover {
    background: #e9ecef;
    border-color: #bbb;
    color: #111;
}

.challenge-body {
    padding: 20px;
}

.goals-section {
    background: #eef2f7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #d1d9e6;
}

.goals-title {
    font-weight: 800;
    margin-bottom: 10px;
    display: block;
    color: #111;
    font-size: 1.1rem;
}

.goals-hint {
    font-size: 0.95rem;
    color: #444;
    margin: 5px 0 15px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #333;
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #0056b3;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.park-progress-card {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.park-progress-card.visited {
    background: #e3f9e5;
    border-color: #28a745;
}

.park-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.park-name {
    font-weight: 800;
    color: #111;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.status-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.status-badge {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
    background: #e9ecef;
    color: #555;
    display: none;
    font-weight: 600;
    border: 1px solid #ccc;
}

.status-badge.completed {
    background: #28a745;
    color: white;
    border-color: #218838;
}

.card-actions {
    margin-top: auto;
    display: flex;
    width: 100%;
    justify-content: center;
}

.log-action-btn {
    width: 100%;
    background-color: #0056b3;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.log-action-btn:hover {
    background-color: #003d80;
}

.overall-progress {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: #ddd;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: #28a745;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.start-btn-container {
    text-align: right;
    margin-top: 20px;
}

.start-challenge-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.start-challenge-btn:hover {
    background-color: #218838;
}

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

.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    overflow: hidden;
    overscroll-behavior: contain;
}

.modal-content {
    color: #111;
    border: 1px solid #888;
    background-color: #fefefe;
    position: absolute;
    top: 4vh;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-content h2 {
    color: #111;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    margin-top: 0;
    flex-shrink: 0;
}

.modal-content p.modal-intro {
    color: #333;
    font-size: 1.05rem;
    flex-shrink: 0;
    margin-bottom: 15px;
}

.close-btn {
    flex-shrink: 0;
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
    font-size: 2rem;
    color: #111;
    z-index: 10;
}

.picker-search {
    border: 2px solid #999;
    padding: 12px;
    font-size: 1rem;
    color: #000;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    margin-bottom: 10px;
}

#picker-list,
.item-list-container,
#selection-options,
#selection-custom-form,
#log-visit-form,
.scrollable-content {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 5px;
    border-top: 1px solid transparent;
}

.item-list-container {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.modal-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.modal-buttons button {
    flex: 1;
}

.form-grid {
    display: grid;
    gap: 15px;
}

.form-grid label {
    color: #222;
    font-weight: 700;
    margin-bottom: 5px;
    display: block;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
#log-visit-form textarea,
input[type="datetime-local"],
input[type="number"],
input[type="text"],
.picker-search {
    border: 2px solid #ccc !important;
    color: #222 !important;
    background-color: #f9f9f9 !important;
    padding: 12px 15px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#log-visit-form textarea,
.form-grid textarea {
    min-height: 80px;
    resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
#log-visit-form textarea:focus,
.picker-search:focus {
    border-color: #0056b3 !important;
    background-color: #fff !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px 0;
}

.selection-btn {
    background: #f8f9fa;
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #111 !important;
    font-weight: 800 !important;
    font-size: 1rem;
}

.selection-btn:hover {
    background: #e9ecef;
    border-color: #0056b3;
    color: #0056b3 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.selection-btn .btn-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    color: #111 !important;
}

.selection-btn:hover .btn-icon {
    color: #0056b3 !important;
}

.selection-btn.full-width {
    grid-column: span 2;
    background-color: #e3f2fd;
    border-color: #90caf9;
}

.picker-option {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    color: #222;
    font-weight: 500;
}

.picker-option:hover {
    background-color: #f0f8ff;
    color: #0056b3;
}

.picker-option.selected {
    background-color: #cce5ff;
    border-left: 6px solid #0056b3;
    font-weight: bold;
}

.modal-action-btn {
    background-color: #0056b3;
    color: white;
    font-weight: 800;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
}

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

.modal-secondary-btn {
    background-color: #6c757d;
    color: white;
    font-weight: 700;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

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

.text-center {
    text-align: center;
}

.text-primary {
    color: #0056b3;
}

.text-muted {
    color: #444;
}

.text-small {
    font-size: 0.9rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 5px;
}

.mt-3 {
    margin-top: 15px;
}

.mt-4 {
    margin-top: 20px;
}

.p-large {
    padding: 40px;
}

#history-section {
    display: none;
}

.history-list {
    margin-top: 20px;
}

.history-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-left: 6px solid #aaa;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.history-item.completed {
    border-left-color: #ffc107;
    background: #fffdf5;
}

/* --- Visit History Panel (Synchronized with waitTimes.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: 2000;
    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;
}

/* NEW: Bingo Styles */
.bingo-items-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.bingo-item-pill {
    background: #007bff;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.bingo-item-pill:hover {
    background: #dc3545;
    /* Red on hover to indicate remove */
}

.bingo-item-pill::after {
    content: "×";
    font-weight: bold;
}

.bingo-board-wrapper {
    margin-top: 20px;
    display: grid;
    gap: 10px;
    justify-content: center;
}

.bingo-tile {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    transition: all 0.2s ease;
    user-select: none;
}

.bingo-tile:hover {
    background: #f1f3f5;
    transform: scale(1.02);
}

.bingo-tile.completed {
    background: #c3e6cb;
    border-color: #28a745;
    color: #155724;
    position: relative;
}

.bingo-tile.completed::after {
    content: '✔️';
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.2rem;
    opacity: 0.6;
}

.bingo-tile.bingo-free-space {
    background: #ffeb3b;
    border-color: #fbc02d;
    color: #000;
}

.bingo-win-banner {
    background: #28a745;
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .log-history-panel {
        max-width: 100%;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .header-right {
        display: none;
    }

    .park-progress-card {
        padding: 12px;
    }

    .log-action-btn {
        padding: 12px;
        font-size: 1.1rem;
    }

    .hamburger-menu {
        display: flex;
    }

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

    .modal-content {
        position: fixed !important;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100% !important;
        max-height: 100dvh !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch;
    }
}


/* ==========================================================================
   PARK COMPANION V2.0 - CHALLENGES & SHARED THEME ENHANCEMENTS
   ========================================================================== */

: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;
}

[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;
}

[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;
}

body {
    font-family: var(--pc-font-sans);
    background-color: var(--pc-bg);
    color: var(--pc-text);
}

h1,
h2,
h3 {
    font-family: var(--pc-font-display);
}

[data-theme="dark"] header,
[data-theme="dark"] .challenge-card,
[data-theme="dark"] .challenge-option-card,
[data-theme="dark"] .setup-card,
[data-theme="dark"] .history-item,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .bingo-tile,
[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"] .park-progress-card {
    background-color: var(--pc-surface-alt) !important;
    color: var(--pc-text) !important;
    border-color: var(--pc-border) !important;
}

[data-theme="dark"] .bingo-tile.completed {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: #10b981 !important;
    color: #a7f3d0 !important;
}

/* Sunlight High-Contrast Overrides for Challenges */
[data-theme="sunlight"] header,
[data-theme="sunlight"] .page-header,
[data-theme="sunlight"] #intro-message,
[data-theme="sunlight"] .challenge-card,
[data-theme="sunlight"] .challenge-header,
[data-theme="sunlight"] .challenge-option-card,
[data-theme="sunlight"] .challenge-option-header,
[data-theme="sunlight"] .setup-card,
[data-theme="sunlight"] .goals-section,
[data-theme="sunlight"] .park-progress-card,
[data-theme="sunlight"] .history-item,
[data-theme="sunlight"] .modal-content,
[data-theme="sunlight"] .bingo-tile,
[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"] .challenge-header h2,
[data-theme="sunlight"] .challenge-option-header h3,
[data-theme="sunlight"] .challenge-option-body,
[data-theme="sunlight"] .park-name,
[data-theme="sunlight"] .mobile-nav-link,
[data-theme="sunlight"] .mobile-user-info,
[data-theme="sunlight"] .close-nav-btn,
[data-theme="sunlight"] .close-btn {
    color: #000000 !important;
    font-weight: 800 !important;
}

[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;
}

[data-theme="sunlight"] .header-btn,
[data-theme="sunlight"] .pc-theme-btn,
[data-theme="sunlight"] .header-control-btn,
[data-theme="sunlight"] .btn-link,
[data-theme="sunlight"] .tab-btn.inactive,
[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;
    box-shadow: 2px 2px 0px #000000 !important;
}

[data-theme="sunlight"] .tab-btn:not(.inactive),
[data-theme="sunlight"] .hero-btn,
[data-theme="sunlight"] .log-action-btn,
[data-theme="sunlight"] .start-challenge-btn,
[data-theme="sunlight"] .modal-action-btn,
[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;
}

[data-theme="sunlight"] .park-progress-card.visited,
[data-theme="sunlight"] .bingo-tile.completed,
[data-theme="sunlight"] .status-badge.completed {
    background-color: #86efac !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    font-weight: 900 !important;
}

[data-theme="sunlight"] .status-badge:not(.completed) {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1.5px solid #000000 !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;
}

.challenge-live-timer {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(0, 119, 182, 0.12);
    color: var(--pc-primary);
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.challenge-route-banner {
    background: linear-gradient(90deg, rgba(0, 119, 182, 0.1), rgba(16, 185, 129, 0.1));
    border-left: 4px solid var(--pc-primary);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.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-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 8px;
}

.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-bottom-nav {
    display: none;
}

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

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

    .pc-theme-btn .theme-label {
        display: none;
    }

    .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;
    }

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

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

    .sheet-drag-handle {
        display: block;
        width: 42px;
        height: 5px;
        background: rgba(148, 163, 184, 0.5);
        border-radius: 999px;
        margin: 0 auto 12px;
    }
}