/* Base styles */
:root {
    --primary-color: #1a73e8;
    --secondary-color: #f1f3f4;
    --accent-color: #34a853;
    --danger-color: #ea4335;
    --text-color: #121212;
    --light-text: #424242;
    --border-color: #9e9e9e;
    --input-bg: #ffffff;
    --body-bg: #f0f0f0;
    --container-bg: #ffffff;
    --container-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    --nav-button-bg: #2c2c2c;
    --nav-button-border: #444444;
    --nav-button-hover-bg: #3a3a3a;
    --nav-button-hover-border: #555555;
}

/* Dark mode variables */
[data-theme="dark"] {
    --primary-color: #5499ff;
    --secondary-color: #283142;
    --text-color: #e0e0e0;
    --light-text: #b0b0b0;
    --border-color: #6c6c6c;
    --input-bg: #2c2c2c;
    --body-bg: #121212;
    --container-bg: #1e1e1e;
    --container-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    --nav-button-bg: #2c2c2c;
    --nav-button-border: #444444;
    --nav-button-hover-bg: #3a3a3a;
    --nav-button-hover-border: #555555;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

html {
    /* The page color must live on the root element: if it sat on <body>,
       any root background (e.g. dark mode) would stop the body background
       from propagating to the canvas and the body would paint its own box
       OVER the fixed body::before photo layer. */
    background-color: var(--body-bg);
}

body,
body.bg-gray-100 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: transparent;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
}

/* Subtle pond photo behind every page: a fixed, faded layer always
   covering the full viewport (uniform top to bottom, works on iOS). */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('/assets/images/pond-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.25;
    pointer-events: none;
}

/* Dark mode: the dark page color eats most of the photo's brightness,
   so it needs a higher opacity to stay visible at all. */
[data-theme="dark"] body::before {
    opacity: 0.35;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--container-bg);
    border-radius: 8px;
    box-shadow: var(--container-shadow);
    padding: 20px;
    transition: background-color 0.3s, box-shadow 0.3s, color 0.3s;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

h2 {
    color: var(--text-color);
    margin-bottom: 15px;
}

h3 {
    color: var(--light-text);
    margin-bottom: 10px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* Enhanced date input styling */
.date-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input-container input[type="date"] {
    padding-right: 44px; /* Make space for the icon */
}

.date-input-container::after {
    content: "📅";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    pointer-events: none;
    opacity: 0.7;
}

/* Fix calendar icon color in webkit browsers */
input[type="date"]::-webkit-calendar-picker-indicator {
    background-color: transparent;
    color: var(--text-color);
    opacity: 0;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.3);
}

/* Dark mode specific styles for date picker */
[data-theme="dark"] .date-input-container::after {
    opacity: 0.9; /* Make icon more visible in dark mode */
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    min-height: 44px;
}

button:hover {
    background-color: #0d62c9;
}

/* Export button styling - override default button styles */
button.export-btn, #archiveExportBtn {
    background-color: #e5e7eb; /* bg-gray-200 */
    color: #374151; /* text-gray-700 */
    font-weight: 500;
}

button.export-btn:hover, #archiveExportBtn:hover {
    background-color: #d1d5db; /* bg-gray-300 */
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--secondary-color);
    font-weight: 600;
}

.data-table tfoot td {
    font-weight: 600;
}

/* Admin specific styles */
.admin-dashboard section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
}

.section-header h2 {
    margin-bottom: 0;
    flex: 1;
}

.section-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.section-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--text-color);
}

/* Responsive styling for mobile devices */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    button {
        width: 100%;
    }
    
    /* Remove collapsible sections on mobile */
    .section-toggle {
        display: none !important;
    }
    
    .section-header {
        cursor: default;
    }
    
    .section-content {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .section-content.collapsed {
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Smaller toggle for mobile */
    .theme-toggle {
        width: 28px;
        height: 28px;
        margin-left: 8px;
    }
    
    .theme-toggle svg {
        width: 16px;
        height: 16px;
    }
}

.section-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.section-content.collapsed {
    max-height: 0;
}

.section-header .section-toggle.collapsed {
    transform: rotate(-90deg);
}

.danger-btn {
    background-color: var(--danger-color);
}

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

/* Custom styles that complement Tailwind CSS */

/* Success and error messages */
.message {
    padding: 1rem;
    margin-top: 1.25rem;
    border-radius: 0.375rem;
    display: none;
}

.message:not(:empty) {
    display: block;
}

.success {
    background-color: #e6f4ea;
    border: 1px solid #34a853;
    color: #137333;
}

.error {
    background-color: #fce8e6;
    border: 1px solid #ea4335;
    color: #c5221f;
}

/* Utility classes */
.hidden {
    display: none;
}

/* Firebase emulator indicator - already styled inline */

/* Media queries for responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
    }
    
    button {
        width: 100%;
    }
    
    /* Smaller toggle for mobile */
    .theme-toggle {
        width: 28px;
        height: 28px;
        margin-left: 8px;
    }
    
    .theme-toggle svg {
        width: 16px;
        height: 16px;
    }
}

/* Theme toggle styles */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s;
    margin-left: 12px;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* Navigation in dark mode - ensuring proper text color */
[data-theme="dark"] a.bg-primary {
    background-color: var(--primary-color) !important;
    color: white !important;
}

[data-theme="dark"] a.bg-primary:hover {
    background-color: #0d62c9 !important;
}

/* Dark mode specific styles */
[data-theme="dark"] .container,
[data-theme="dark"] .bg-white,
[data-theme="dark"] nav .container,
[data-theme="dark"] #mobileMenu .container {
    background-color: var(--container-bg);
    color: var(--text-color);
}

/* Fix form labels in dark mode */
[data-theme="dark"] label,
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-700 {
    color: var(--text-color) !important;
}

[data-theme="dark"] .text-gray-600 {
    color: var(--light-text) !important;
}

/* Fix info panels in dark mode */
[data-theme="dark"] .bg-blue-50 {
    background-color: rgba(26, 115, 232, 0.15);
}

[data-theme="dark"] .bg-green-50 {
    background-color: rgba(52, 168, 83, 0.15);
}

[data-theme="dark"] .bg-gray-50 {
    background-color: var(--nav-button-bg);
}

[data-theme="dark"] nav .bg-gray-50,
[data-theme="dark"] .bg-gray-50 {
    background-color: var(--nav-button-bg);
    border-color: var(--nav-button-border);
}

[data-theme="dark"] nav a.hover\:bg-gray-100:hover,
[data-theme="dark"] .hover\:bg-gray-100:hover {
    background-color: var(--nav-button-hover-bg);
    border-color: var(--nav-button-hover-border);
}

[data-theme="dark"] .message.success {
    background-color: #0f3822;
    border: 1px solid #34a853;
    color: #8fe8aa;
}

[data-theme="dark"] .message.error {
    background-color: #5f1414;
    border: 1px solid #ea4335;
    color: #f5b4b4;
}

[data-theme="dark"] a {
    color: var(--primary-color);
}

[data-theme="dark"] .bg-gray-100 {
    background-color: var(--body-bg);
}

/* ...but never the <body> itself: it must stay transparent so the fixed
   body::before pond-photo layer shows through (html carries the page color). */
[data-theme="dark"] body.bg-gray-100 {
    background-color: transparent;
}

/* Fix admin tables in dark mode */
[data-theme="dark"] table,
[data-theme="dark"] .bg-white {
    background-color: var(--container-bg) !important;
}

[data-theme="dark"] thead.bg-secondary {
    background-color: var(--secondary-color) !important;
}

[data-theme="dark"] th {
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] td {
    border-color: var(--border-color);
}

/* Add subtle hover effect for table rows in dark mode */
[data-theme="dark"] tr:hover td {
    background-color: rgba(255, 255, 255, 0.05) !important;
    transition: background-color 0.2s;
}

/* More specific selectors to override Tailwind hover effects */
[data-theme="dark"] .data-table tr:hover td,
[data-theme="dark"] table tr:hover td,
[data-theme="dark"] tbody tr:hover td,
[data-theme="dark"] tr.hover\:bg-gray-100:hover td,
[data-theme="dark"] tr.hover\:bg-gray-50:hover td,
[data-theme="dark"] tr:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    transition: background-color 0.2s;
}

[data-theme="dark"] .divide-y.divide-gray-300 > * {
    border-color: var(--border-color) !important;
}

/* Fix modal in dark mode */
[data-theme="dark"] #resetConfirmation .bg-white,
[data-theme="dark"] #exportModal .bg-white {
    background-color: var(--container-bg);
    color: var(--text-color);
}

/* Export modal styles */
#exportModal .flex button {
    min-width: 110px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 4px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    /* Stack buttons vertically on very small screens */
    #exportModal .flex {
        flex-direction: column;
        gap: 10px;
    }
    
    #exportModal .flex > * {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

#exportModal h3 {
    text-align: center;
}

#exportModal p {
    text-align: center;
}

/* Dark mode export modal fixes */
[data-theme="dark"] #exportModal p {
    color: var(--text-color);
}

[data-theme="dark"] #exportModal h3 {
    color: var(--primary-color);
}

[data-theme="dark"] #exportModal button {
    border-color: var(--border-color);
}

[data-theme="dark"] button.export-btn, 
[data-theme="dark"] #archiveExportBtn {
    background-color: #374151; /* dark gray */
    color: #e5e7eb; /* light gray text */
}

[data-theme="dark"] button.export-btn:hover, 
[data-theme="dark"] #archiveExportBtn:hover {
    background-color: #4b5563; /* slightly lighter gray on hover */
}

[data-theme="dark"] #exportModal #cancelExport {
    background-color: var(--nav-button-bg);
    color: var(--text-color);
}

[data-theme="dark"] #exportModal #cancelExport:hover {
    background-color: var(--nav-button-hover-bg);
}

/* Fix archive data section in dark mode */
[data-theme="dark"] #archiveData.bg-gray-50 {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Archive section styles */
.archives-section {
    position: relative;
}

#archiveExportBtn {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
}

#archiveExportBtn:before {
    content: "📊";
    margin-right: 6px;
}

/* Dark mode export modal fixes */
[data-theme="dark"] #exportModal p {
    color: var(--text-color);
}

[data-theme="dark"] #exportModal h3 {
    color: var(--primary-color);
}

[data-theme="dark"] #exportModal button {
    border-color: var(--border-color);
}

[data-theme="dark"] button.export-btn, 
[data-theme="dark"] #archiveExportBtn {
    background-color: #374151; /* dark gray */
    color: #e5e7eb; /* light gray text */
}

[data-theme="dark"] button.export-btn:hover, 
[data-theme="dark"] #archiveExportBtn:hover {
    background-color: #4b5563; /* slightly lighter gray on hover */
}

[data-theme="dark"] #exportModal #cancelExport {
    background-color: var(--nav-button-bg);
    color: var(--text-color);
}

/* Override Tailwind hover classes in dark mode */
[data-theme="dark"] .hover\:bg-gray-100:hover,
[data-theme="dark"] .hover\:bg-gray-200:hover,
[data-theme="dark"] .hover\:bg-gray-50:hover,
[data-theme="dark"] .hover\:bg-blue-50:hover,
[data-theme="dark"] .hover\:bg-gray-300:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Mobile Menu Styles */
#mobileMenu {
    width: 100%;
    transition: all 0.3s ease;
}

#mobileMenu a {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, color 0.2s;
    text-align: center;
    display: inline-block;
    width: 60%;
    margin: 0 auto;
}

/* Dark mode specific separator for mobile menu */
[data-theme="dark"] #mobileMenu a {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mobileMenu a:hover, 
#mobileMenu a:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

#mobileMenu a:last-child {
    border-bottom: none;
}

/* Fix for desktop navigation buttons - prevent text wrapping */
@media (min-width: 768px) {
    nav .hidden.md\:flex.items-center.space-x-3 a,
    nav .hidden.lg\:flex.items-center.space-x-3 a {
        white-space: nowrap;
        min-width: fit-content;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    nav .w-full.bg-primary, 
    nav .w-full.bg-secondary,
    nav .bg-primary,
    nav .bg-secondary {
        width: auto !important;
    }
}

/* Navigation button styles */
.nav-button {
    white-space: nowrap;
    width: auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 1rem;
    padding-right: 1rem;
    min-width: max-content;
}

/* Help page content styling */
.prose {
    color: var(--text-color);
    max-width: 100%;
    font-size: 1.05rem;
}

.prose h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1.25rem;
    color: var(--primary-color);
}

.prose h3 {
    font-size: 1.35rem;
    margin-top: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.prose ol,
.prose ul {
    margin-left: 1rem;
    margin-bottom: 1.5rem;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 2rem;
}

.prose ul {
    list-style-type: disc;
    padding-left: 2rem;
}

.prose li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    line-height: 1.6;
}

.prose li:last-child {
    margin-bottom: 0;
}

.prose li > ul,
.prose li > ol {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.prose .bg-blue-50,
.prose .bg-green-50 {
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.prose .bg-blue-50 p,
.prose .bg-green-50 p {
    margin-bottom: 0.75rem;
}

.prose .bg-blue-50 ul,
.prose .bg-green-50 ul {
    margin-bottom: 0.5rem;
}

.prose section {
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
}

.prose p {
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.prose hr {
    margin: 2rem 0;
    border-color: var(--border-color);
}

.prose .italic {
    font-style: italic;
    color: var(--light-text);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Dark mode adjustments for prose content */
[data-theme="dark"] .prose .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .prose .bg-green-50 {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Admin Dashboard Collapsible Tables */
.toggle-skier-row {
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.toggle-skier-row .toggle-icon {
    transition: transform 0.3s ease;
    stroke-width: 2px;
    width: 16px;
    height: 16px;
    display: inline-block;
}

.detail-row {
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.02);
}

.detail-row:last-of-type {
    border-bottom: 2px solid var(--border-color);
}

.detail-row.hidden {
    display: none;
}

/* Dark Mode Styles for Admin Collapsible Table */
[data-theme="dark"] .toggle-skier-row {
    background-color: var(--container-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .toggle-skier-row:hover {
    background-color: var(--nav-button-bg);
}

[data-theme="dark"] .detail-row {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: var(--border-color);
}

/* Receipt modal styles */
#receiptModal {
    z-index: 9999;
}

#receiptModal .max-w-4xl {
    width: 95vw;
    max-width: 90vw;
    max-height: 90vh;
}

#receiptModal .max-h-96 {
    max-height: 60vh;
    min-height: 200px;
}

#receiptModal img {
    max-width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
}

/* Mobile optimizations for receipt modal */
@media (max-width: 768px) {
    #receiptModal .max-w-4xl {
        width: 98vw;
        max-width: 98vw;
        max-height: 95vh;
        margin: 1vh auto;
    }
    
    #receiptModal .max-h-96 {
        max-height: 70vh;
    }
    
    #receiptModal img {
        max-height: 70vh;
    }
    
    #receiptModal .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #receiptModal .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    #receiptModal .space-x-3 > * + * {
        margin-left: 0.5rem;
    }
    
    #receiptModal button,
    #receiptModal a {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* File input styling for mobile */
input[type="file"] {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
}

/* Receipt preview styles */
.receipt-upload-container {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: border-color 0.3s ease;
}

.receipt-upload-container:hover {
    border-color: var(--primary-color);
}

.receipt-upload-container input[type="file"] {
    border: none;
    background: transparent;
    padding: 8px 0;
}

/* Receipt upload buttons */
#selectFileBtn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#selectFileBtn:hover {
    border-color: var(--primary-color) !important;
    background-color: rgba(26, 115, 232, 0.05);
}

/* Receipt upload button */
#addPhotoBtn {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Remove receipt button - override default button styles */
#removeReceipt {
    background-color: transparent !important;
    color: #dc2626 !important; /* text-red-600 */
    border: none !important;
    border-radius: 50% !important;
    padding: 0.25rem !important; /* p-1 */
    font-size: 16px !important;
    font-weight: normal !important;
    min-height: auto !important;
    width: auto !important;
    margin-left: 1rem !important; /* ml-4 */
}

#removeReceipt:hover {
    color: #991b1b !important; /* text-red-800 */
    background-color: #fef2f2 !important; /* bg-red-50 */
}

#receiptPreview {
    background-color: var(--secondary-color);
    border-radius: 6px;
    padding: 12px;
}

#receiptPreviewImage {
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Dark mode receipt styles */
[data-theme="dark"] .receipt-upload-container {
    border-color: #6c6c6c;
}

[data-theme="dark"] .receipt-upload-container:hover {
    border-color: var(--primary-color);
}

[data-theme="dark"] #receiptPreview {
    background-color: rgba(44, 44, 44, 0.3);
}

[data-theme="dark"] #receiptPreviewImage {
    border-color: #6c6c6c;
}

[data-theme="dark"] #receiptModal .bg-white {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

[data-theme="dark"] #receiptModal .bg-gray-50 {
    background-color: #2c2c2c;
    color: #e0e0e0;
}

[data-theme="dark"] #receiptModal .border-gray-200 {
    border-color: #444444;
}

[data-theme="dark"] #receiptModal .text-gray-900 {
    color: #e0e0e0;
}

[data-theme="dark"] #receiptModal .text-gray-600 {
    color: #b0b0b0;
}

[data-theme="dark"] #receiptModal .text-gray-400 {
    color: #888888;
}

/* Dark mode receipt button styles */
[data-theme="dark"] #selectFileBtn {
    background-color: rgba(44, 44, 44, 0.8);
    color: #e0e0e0;
    border-color: #6c6c6c;
}

[data-theme="dark"] #selectFileBtn:hover {
    background-color: rgba(26, 115, 232, 0.1);
    border-color: var(--primary-color);
}

[data-theme="dark"] #addPhotoBtn {
    background-color: rgba(44, 44, 44, 0.8);
    color: #e0e0e0;
    border-color: #6c6c6c;
}

[data-theme="dark"] #addPhotoBtn:hover {
    background-color: rgba(26, 115, 232, 0.1);
    border-color: var(--primary-color);
}

 
/* ============================================
   Site navigation: Gas Tracker dropdown (desktop)
   and submenu accordion (mobile menu)
   ============================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    min-width: 13rem;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0;
    z-index: 50;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    text-decoration: none;
}

.nav-dropdown-menu a:hover {
    background-color: var(--secondary-color);
}

.nav-dropdown-toggle .nav-caret {
    transition: transform 0.2s ease;
}

.nav-dropdown-toggle[aria-expanded="true"] .nav-caret {
    transform: rotate(180deg);
}

/* Mobile accordion submenu links are indented under their toggle */
.mobile-submenu a {
    padding-left: 3rem !important;
    font-size: 1.05rem !important;
}

/* Nav toggle buttons should not stretch full-width on mobile
   (dubes.css sets button { width: 100% } below 768px) */
nav button.nav-dropdown-toggle,
nav #mobileMenuButton {
    width: auto !important;
}

/* Mobile menu accordion toggle mirrors the menu link styling */
#mobileMenu .mobile-submenu-toggle {
    width: 100% !important;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ============================================
   Home page: hero, quick-link cards, photo grid
   ============================================ */
.home-hero {
    position: relative;
    max-width: 64rem;
    /* extra bottom space (on top of the content card's mt-8) so the hero
       floats clear of the welcome block */
    margin: 0 auto 2rem;
}

.home-hero-img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    /* favor the treeline/skier band of the 4:3 source photo */
    object-position: center 42%;
    border-radius: 8px;
    display: block;
}

.home-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    padding: 1rem;
}

.home-hero-overlay h1 {
    color: #ffffff;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.home-hero-overlay p {
    color: #f0f0f0;
    font-size: 1.15rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.home-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.home-card {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-card:hover {
    text-decoration: none;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.home-card h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.home-card p {
    color: var(--light-text);
    font-size: 0.95rem;
}

.home-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.home-card-body {
    padding: 1.25rem;
}

@media (max-width: 767px) {
    .home-hero-img,
    .home-hero-overlay {
        height: 220px;
    }

    .home-hero-overlay h1 {
        font-size: 1.6rem;
    }

    .home-cards {
        grid-template-columns: 1fr;
    }

    .home-card-img {
        height: 180px;
    }
}

/* ============================================
   Waiver page
   ============================================ */
.waiver-text {
    max-height: 24rem;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--input-bg);
}

.waiver-text ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.waiver-text li {
    margin-bottom: 0.75rem;
}

.waiver-text p {
    margin-bottom: 0.75rem;
}

.waiver-signature {
    font-family: 'Snell Roundhand', 'Segoe Script', 'Brush Script MT', cursive;
    font-size: 1.25rem;
}

.waiver-checkbox {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}

/* ============================================
   Quiet text-link navigation (v2 redesign)
   ============================================ */
.nav-links {
    gap: 1.25rem;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    min-height: auto;
}

.nav-link:hover {
    color: var(--primary-color);
    text-decoration: none;
    background: none;
}

/* Sliding underline: on hover and on the current page */
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.nav-link:hover::after,
.nav-link.nav-link-active::after {
    transform: scaleX(1);
}

.nav-link.nav-link-active {
    color: var(--primary-color);
}

/* Admin gear icon */
.nav-icon-link {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem;
    color: var(--light-text);
}

.nav-icon-link:hover,
.nav-icon-link.nav-link-active {
    color: var(--primary-color);
    text-decoration: none;
}

/* The dropdown toggle is a <button>; neutralize global button styling */
nav button.nav-link {
    width: auto !important;
    font-family: inherit;
}

/* Waiver expiry status badges (admin dashboard) */
.waiver-status {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.waiver-status-active {
    background-color: #e6f4ea;
    color: #137333;
}

.waiver-status-expiring {
    background-color: #fef7e0;
    color: #b06000;
}

.waiver-status-expired {
    background-color: #fce8e6;
    color: #c5221f;
}

[data-theme="dark"] .waiver-status-active {
    background-color: #0f3822;
    color: #8fe8aa;
}

[data-theme="dark"] .waiver-status-expiring {
    background-color: #3d2e00;
    color: #fdd663;
}

[data-theme="dark"] .waiver-status-expired {
    background-color: #5f1414;
    color: #ff8a80;
}

/* Waiver reminder/alert inside the ski-set confirmation modal */
.waiver-notice {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.waiver-notice a {
    color: inherit;
}

.waiver-notice-warn {
    background-color: #fef7e0;
    color: #b06000;
    border: 1px solid #f9ab00;
}

.waiver-notice-alert {
    background-color: #fce8e6;
    color: #c5221f;
    border: 1px solid #ea4335;
}

[data-theme="dark"] .waiver-notice-warn {
    background-color: #3d2e00;
    color: #fdd663;
    border-color: #b06000;
}

[data-theme="dark"] .waiver-notice-alert {
    background-color: #5f1414;
    color: #ff8a80;
    border-color: #c5221f;
}

/* Dark mode paints all <a> links primary blue; the mobile Gas Tracker
   accordion toggle is a <button>, so it needs the same color explicitly. */
[data-theme="dark"] #mobileMenu .mobile-submenu-toggle {
    color: var(--primary-color);
}

/* ============================================
   Admin dashboard tabs
   ============================================ */
.admin-tabs {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.admin-tab {
    background: none !important;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 0.25rem;
    min-height: auto;
    width: auto !important;
    cursor: pointer;
    white-space: nowrap;
}

.admin-tab:hover {
    color: var(--primary-color);
    background: none !important;
}

.admin-tab-active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* ============================================
   Payment status pills (running Payments tally)
   Real action buttons: unpaid = red, paid = green
   ============================================ */
.payment-pill {
    width: auto !important;
    min-height: auto;
    padding: 0.25rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.payment-pill-unpaid {
    background-color: var(--danger-color) !important;
}

.payment-pill-unpaid:hover {
    background-color: #c5221f !important;
}

.payment-pill-paid {
    background-color: var(--accent-color) !important;
}

.payment-pill-paid:hover {
    background-color: #2d8e47 !important;
}

/* Payments tally: member group rows + per-bill resend */
.payment-member-row {
    cursor: pointer;
    background-color: var(--secondary-color);
}

.payment-member-row:hover td {
    background-color: rgba(26, 115, 232, 0.08);
}

.payment-group-toggle {
    display: inline-block;
    width: 1.1rem;
    color: var(--primary-color);
}

.payment-resend-btn {
    width: auto !important;
    min-height: auto;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: var(--nav-button-bg) !important;
    color: white;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.payment-resend-btn:hover {
    background-color: var(--nav-button-hover-bg) !important;
}

/* Settle-up: mark all of a member's unpaid bills paid at once */
.payment-payall-btn {
    width: auto !important;
    min-height: auto;
    padding: 0.25rem 0.75rem;
    margin-left: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: var(--accent-color) !important;
    color: white;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.payment-payall-btn:hover {
    background-color: #2d8e47 !important;
}
