/* ================================
   CSS Variables & Reset
   ================================ */
:root {
    /* Colors */
    --primary-color: #2d5a3d;
    --primary-dark: #1e3d2a;
    --primary-light: #4a8c62;
    --secondary-color: #7d6b52;
    --accent-color: #c9a06c;
    --accent-warm: #e8d4b8;
    --text-color: #2d3436;
    --text-light: #636e72;
    --background-color: #f8f6f3;
    --white: #fff;
    --error-color: #c53030;
    --success-color: #2d5a3d;

    /* Typography */
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

    /* Layout */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 20px;
    --border-radius: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.12);

    /* Touch targets */
    --min-touch-target: 44px;
}

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

/* Prevent horizontal scroll on the entire page */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* ================================
   Typography
   ================================ */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

h2 {
    font-size: 1.375rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h3 {
    font-size: 1.125rem;
}

/* ================================
   Buttons
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: var(--min-touch-target);
}

.btn:active {
    transform: scale(0.98);
}

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

.btn-primary:hover {
    background-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.25);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-icon {
    padding: 0.5rem 1rem;
    background-color: var(--white);
    border: 1px solid #ddd;
}

.btn-icon:hover {
    background-color: #f0f0f0;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

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

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

.btn-full {
    width: 100%;
    margin-top: 1rem;
}

.btn-google {
    background-color: var(--white);
    color: var(--text-color);
    border: 1px solid #ddd;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    gap: 0.75rem;
    width: 100%;
}

.btn-google:hover {
    background-color: #f8f8f8;
    border-color: #ccc;
}

.btn-google:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.google-icon {
    flex-shrink: 0;
}

.login-note {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 1rem;
}

/* ================================
   Forms
   ================================ */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ================================
   Messages
   ================================ */
.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.success-message {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.hidden {
    display: none !important;
}

/* ================================
   Loading Overlay
   ================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #ddd;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================
   Login Page
   ================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #2c5530 0%, #1a3a1d 100%);
    background-image:
        linear-gradient(135deg, rgba(44, 85, 48, 0.3) 0%, rgba(26, 58, 29, 0.4) 100%),
        url('../images/hero.jpg');
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-container .subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

.login-form .btn {
    width: 100%;
    margin-top: 1rem;
}

.btn-loading {
    display: none;
}

.btn .btn-text.hidden {
    display: none;
}

.btn .btn-loading:not(.hidden) {
    display: inline;
}

/* ================================
   Schedule Page
   ================================ */
.schedule-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.hero-header {
    background: linear-gradient(135deg, rgba(44, 85, 48, 0.6) 0%, rgba(26, 58, 29, 0.7) 100%),
        url('../images/banner2.jpg');
    background-size: cover;
    background-position: center 90%;
    padding: 1.5rem 2rem;
    color: var(--white);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.75rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    opacity: 0.9;
}

.schedule-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Reservation Form */
.reservation-form-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.tub-selection {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.tub-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tub-checkbox input {
    width: auto;
    margin-right: 0.5rem;
}

.tub-label {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.tub-checkbox input:checked + .tub-label {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: var(--white);
}

/* Calendar View */
.calendar-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 0.5rem;
    min-height: 100px;
}

.calendar-day-header {
    font-weight: 600;
    font-size: 0.875rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.calendar-day.today {
    border-color: var(--primary-color);
    background-color: #f0f7f0;
}

.calendar-day.past {
    opacity: 0.6;
}

.calendar-reservation {
    background-color: var(--accent-color);
    color: var(--text-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    cursor: pointer;
}

.calendar-reservation:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Reservations List */
.reservations-list-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.reservations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reservation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    background-color: #fafafa;
}

.reservation-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.reservation-info p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.reservation-tubs {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.tub-badge {
    background-color: var(--primary-light);
    color: var(--white);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.reservation-actions {
    display: flex;
    gap: 0.5rem;
}

.guest-count {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.875rem;
}

.no-reservations {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

/* ================================
   Settings Section
   ================================ */
.settings-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.current-gate-code {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.current-gate-code .gate-label {
    font-size: 1rem;
}

.current-gate-code .gate-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.2rem;
}

.gate-code-edit {
    display: flex;
    gap: 0.5rem;
    max-width: 300px;
}

.gate-code-edit input {
    flex: 1;
    padding: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
}

.gate-code-edit input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ================================
   Admin Section
   ================================ */
.admin-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 2rem;
    border-left: 4px solid var(--accent-color);
}

.admin-note {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.allowed-emails-list {
    margin-bottom: 1.5rem;
}

.email-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f8f8;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.email-address {
    font-family: monospace;
    font-size: 0.95rem;
}

.email-add-row {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
}

.email-add-row input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
}

.email-add-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.no-emails {
    color: var(--text-light);
    font-style: italic;
}

/* ================================
   Modal
   ================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-close:hover {
    color: var(--text-color);
}

/* Quick View Modal */
.quick-view-content {
    max-width: 320px;
    text-align: center;
    padding: 1.5rem;
}

.quick-view-content h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.quick-view-content p {
    color: var(--text-light);
    margin-bottom: 1.25rem;
}

.quick-view-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
    opacity: 0.7;
}

.form-scheduled-by {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.quick-view-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.quick-view-buttons .btn {
    flex: 1;
    padding: 0.75rem 1rem;
}

.share-link-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.share-link-container input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.native-share-btn {
    width: 100%;
    margin-top: 1rem;
    gap: 0.5rem;
}

.native-share-btn svg {
    flex-shrink: 0;
}

#share-guest-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ================================
   Guest Page
   ================================ */
/* Force light mode on guest page */
.guest-page {
    min-height: 100vh;
    background-color: var(--background-color);
    color-scheme: light;
    --background-color: #f8f6f3;
    --white: #fff;
    --text-color: #2d3436;
    --text-light: #636e72;
    --primary-color: #2d5a3d;
    --primary-dark: #1e3d2a;
    --primary-light: #4a8c62;
    --accent-color: #c9a06c;
    --accent-warm: #e8d4b8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.12);
    color: var(--text-color);
}

.error-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.error-content {
    text-align: center;
    max-width: 400px;
}

.error-content h1 {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.agreement-container {
    min-height: 100vh;
    background-color: var(--background-color);
    padding: 2rem 1rem;
}

.agreement-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.agreement-content h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.5rem;
}

.agreement-content h2 {
    text-align: center;
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.agreement-content h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.agreement-text {
    max-height: 50vh;
    overflow-y: auto;
    padding: 1rem;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

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

.agreement-text ul {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.agreement-text li {
    margin-bottom: 0.25rem;
}

.agreement-consent {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.agreement-consent p {
    margin-bottom: 1rem;
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.125rem;
}

.guest-content {
    min-height: 100vh;
    overflow-x: hidden;
}

.guest-header {
    background: linear-gradient(135deg, rgba(45, 90, 61, 0.6) 0%, rgba(30, 61, 42, 0.75) 100%),
        url('../images/banner2.jpg');
    background-size: cover;
    background-position: center 90%;
    background-attachment: fixed;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
}

/* Disable parallax on mobile for better performance */
@media (max-width: 768px) {
    .guest-header {
        background-attachment: scroll;
    }
}

.header-overlay {
    padding: 2.5rem 2rem;
}

.guest-header h1 {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.guest-location {
    font-size: 1rem;
    opacity: 0.8;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.guest-welcome {
    font-size: 1.25rem;
    opacity: 0.9;
}

.guest-main {
    max-width: 600px;
    margin: -60px auto 0;
    padding: 0 1rem 2rem;
    position: relative;
    z-index: 1;
}

.info-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: var(--text-light);
}

.detail-value {
    font-weight: 600;
}

.gate-code-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a3a1d 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
}

.gate-code-section h2 {
    color: var(--white);
}

.gate-code {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    margin: 1rem 0;
    backdrop-filter: blur(4px);
}

.code-value-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gate-code-hint {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.15rem;
}

.code-label {
    font-size: 1rem;
    opacity: 0.9;
}

.code-value {
    font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.code-note {
    font-size: 0.875rem;
    opacity: 0.8;
}

.rules-content {
    white-space: pre-line;
    line-height: 1.8;
}

/* Sacred Springs Section */
.sacred-section {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8f0f4 100%);
    border-left: 4px solid var(--primary-color);
}

.sacred-content p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.sacred-content p:last-child {
    margin-bottom: 0;
    font-style: italic;
}

/* Temperature Instructions */
.temperature-section {
    background: linear-gradient(135deg, #f8f4e8 0%, #fff8e8 100%);
    border-left: 4px solid var(--accent-color);
}

.temperature-instructions p {
    margin-bottom: 0.75rem;
}

.temperature-instructions ul {
    margin: 0.75rem 0 0.75rem 1.25rem;
}

.temperature-instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.temperature-instructions .temp-note {
    font-weight: 600;
    color: var(--error-color);
    margin-bottom: 0;
}

.guest-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-style: italic;
}

.guest-footer .terms-link {
    margin-top: 1rem;
    font-style: normal;
    font-size: 0.875rem;
}

.guest-footer .terms-link a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Weather Section */
.weather-section {
    background: linear-gradient(135deg, #e8f4ea 0%, #d4e8d7 100%);
}

.weather-forecast {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weather-icon {
    font-size: 3rem;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

/* Animated Weather SVG Icons */
.weather-svg {
    width: 100%;
    height: 100%;
}

/* Sunny - rotating rays */
.weather-svg.sunny .sun-rays {
    animation: sunPulse 3s ease-in-out infinite;
    transform-origin: center;
}

@keyframes sunPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Cloudy - gentle float */
.weather-svg.cloudy .cloud {
    animation: cloudFloat 4s ease-in-out infinite;
}

@keyframes cloudFloat {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

/* Foggy - drifting lines */
.weather-svg.foggy .fog1 { animation: fogDrift 3s ease-in-out infinite; }
.weather-svg.foggy .fog2 { animation: fogDrift 3s ease-in-out infinite 0.5s; }
.weather-svg.foggy .fog3 { animation: fogDrift 3s ease-in-out infinite 1s; }

@keyframes fogDrift {
    0%, 100% { transform: translateX(0); opacity: 0.6; }
    50% { transform: translateX(4px); opacity: 1; }
}

/* Rainy - falling drops */
.weather-svg.rainy .drop1 { animation: rainFall 1s ease-in infinite; }
.weather-svg.rainy .drop2 { animation: rainFall 1s ease-in infinite 0.3s; }
.weather-svg.rainy .drop3 { animation: rainFall 1s ease-in infinite 0.6s; }

@keyframes rainFall {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(12px); opacity: 0; }
}

/* Snowy - floating flakes */
.weather-svg.snowy .flake1 { animation: snowFall 2s ease-in-out infinite; }
.weather-svg.snowy .flake2 { animation: snowFall 2s ease-in-out infinite 0.5s; }
.weather-svg.snowy .flake3 { animation: snowFall 2s ease-in-out infinite 1s; }

@keyframes snowFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(10px) rotate(180deg); opacity: 0.3; }
}

/* Stormy - lightning flash */
.weather-svg.stormy .lightning {
    animation: lightningFlash 2s ease-in-out infinite;
}

@keyframes lightningFlash {
    0%, 90%, 100% { opacity: 0.3; }
    92%, 94% { opacity: 1; }
}

.weather-details {
    flex: 1;
}

.weather-temp {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.temp-high {
    color: #c44;
}

.temp-low {
    color: #66a;
}

.temp-separator {
    color: var(--text-light);
    margin: 0 0.25rem;
}

.weather-desc {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-top: 0.25rem;
}

.weather-precip {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.weather-note {
    margin-top: 1rem;
    font-style: italic;
    color: var(--primary-color);
}

.weather-loading {
    color: var(--text-light);
    font-style: italic;
}

/* Photo Gallery */
.photo-gallery {
    margin: -0.5rem;
}

.gallery-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.gallery-img {
    width: 250px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    scroll-snap-align: start;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Directions Section */
.directions-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.address {
    font-size: 1.1rem;
    line-height: 1.5;
}

.directions-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.map-container {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Donation Section */
.donation-section {
    text-align: center;
    border: 1px solid #e0e8e0;
    background: linear-gradient(135deg, #f8faf8 0%, #f0f5f0 100%);
}

.donation-section p {
    color: var(--text-light);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.btn-venmo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #008CFF;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-venmo:hover {
    background: #0070cc;
    color: white;
}

.btn-venmo svg {
    flex-shrink: 0;
}

.cancel-section {
    text-align: center;
    border: 1px solid #f0e0e0;
    background: #fefafa;
}

.cancel-section h2 {
    color: var(--text-color);
}

.cancel-section p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.cancel-section .btn {
    margin-top: 0.5rem;
}

.cancelled-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--background-color);
}

.cancelled-content {
    text-align: center;
    max-width: 400px;
}

.cancelled-content h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.cancelled-content p {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .calendar-view {
        grid-template-columns: repeat(1, 1fr);
    }

    .calendar-day {
        min-height: auto;
        padding: 1rem;
    }

    .calendar-day-header {
        font-size: 1rem;
    }

    .reservation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .reservation-actions {
        width: 100%;
    }

    .reservation-actions .btn {
        flex: 1;
    }

    .guest-header h1 {
        font-size: 2rem;
    }

    .code-value {
        font-size: 1.5rem;
    }

    .login-container {
        padding: 2rem;
    }

    .schedule-main {
        padding: 1rem;
    }

    .reservation-form-section,
    .calendar-section,
    .reservations-list-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .tub-selection {
        flex-direction: column;
    }

    .share-link-container {
        flex-direction: column;
    }
}

/* ================================
   NEW Schedule Page - iOS Calendar Style
   ================================ */

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: var(--white);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 500;
    /* iOS safe area padding */
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

.header-left,
.header-right {
    width: 80px;
}

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

.header-center h1 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.header-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem;
}

.header-btn:hover {
    opacity: 0.8;
}

.header-right {
    text-align: right;
}

/* Main Content Area */
.app-main {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: calc(56px + env(safe-area-inset-top)); /* Space for fixed header */
    padding-bottom: 120px; /* Space for settings panel */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Views */
.view {
    display: none;
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.view.active {
    display: block;
}

/* Quick Book Card */
.quick-book-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(45, 90, 61, 0.3);
}

.quick-book-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quick-book-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.quick-book-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.quick-book-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.quick-book-desc {
    font-size: 0.8rem;
    opacity: 0.85;
}

.quick-book-card .btn {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.quick-book-card .btn:hover {
    background: var(--accent-warm);
}

.quick-book-card .btn:active {
    transform: scale(0.96);
}

.quick-book-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.quick-book-card.success {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .quick-book-card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .quick-book-card .btn {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* ================================
   View 1: List View
   ================================ */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.reservation-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

.reservations-list-new {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-day-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.75rem 0 0.25rem;
    border-bottom: 1px solid #eee;
    margin-top: 0.5rem;
}

.list-day-header:first-child {
    margin-top: 0;
}

/* Swipeable list item wrapper */
.swipeable-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.swipe-actions {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
}

.swipe-actions-left {
    left: 0;
    background: var(--primary-color);
    padding-left: 1.25rem;
    padding-right: 0.5rem;
}

.swipe-actions-right {
    right: 0;
    background: var(--error-color);
    padding-right: 1.25rem;
    padding-left: 0.5rem;
}

.swipe-action {
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.9;
}

.swipe-action svg {
    width: 20px;
    height: 20px;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 1.125rem 1.25rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    gap: 0.875rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.15s ease;
    min-height: var(--min-touch-target);
    position: relative;
    z-index: 1;
}

.swipeable-item .list-item {
    margin-bottom: 0;
    border-radius: 0;
}

.list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    background-color: var(--white);
}

.list-item:active {
    transform: translateY(0);
    background-color: #f8f8f8;
}

.list-item.swiping {
    transition: none;
}

.list-item.swiping:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.list-item-time {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    width: 75px;
    flex-shrink: 0;
    line-height: 1.4;
}

.list-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.list-item-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.list-tub-indicators {
    display: flex;
    gap: 4px;
}

.list-tub-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: transparent;
}

.list-tub-dot.filled {
    background: var(--primary-color);
}

.list-tub-square {
    width: 10px;
    height: 10px;
    border: 2px solid #c53030;
    background: transparent;
}

.list-tub-square.filled {
    background: #c53030;
}

.list-item.cabin-item {
    border-left: 4px solid #6b5b95;
}

.list-item-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.list-item-actions .btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    border-radius: 4px;
}

.list-item-actions .btn-icon:hover {
    background: #f0f0f0;
    color: var(--text-color);
}

.show-more-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.show-more-btn:hover {
    background: var(--bg-light);
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

/* ================================
   Bottom Tab Bar (iOS-style)
   ================================ */
.bottom-tab-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    display: flex !important;
    justify-content: space-around;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    z-index: 500;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0 6px;
    min-height: 50px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    color: var(--text-light);
    transition: color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.tab-item:active {
    transform: scale(0.92);
}

.tab-item.active {
    color: var(--primary-color);
}

.tab-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    stroke-width: 1.8;
}

.tab-item.active .tab-icon {
    stroke-width: 2.2;
}

.tab-label {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Active tab indicator dot */
.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* Special "New" tab styling - muted when not active */
.tab-item-new {
    position: relative;
}

.tab-item-new .tab-icon {
    width: 28px;
    height: 28px;
    background: #9cb8a5;
    border-radius: 50%;
    padding: 5px;
    stroke: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* New tab vibrant when active */
.tab-item-new.active .tab-icon {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    box-shadow: 0 3px 12px rgba(45, 90, 61, 0.4);
}

.tab-item-new:hover .tab-icon {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    box-shadow: 0 2px 8px rgba(45, 90, 61, 0.3);
}

/* Hide the dot on the New tab since it has special styling */
.tab-item-new.active::after {
    display: none;
}

/* Hide old settings panel */
.settings-panel-hidden {
    display: none;
}

/* Adjust main content to account for tab bar */
.app-main {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

/* Settings view styling */
#settings-view {
    padding: 1rem;
    box-sizing: border-box;
    width: 100%;
    min-height: 100%;
}

#settings-view .settings-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.settings-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    #settings-view {
        padding: 0.75rem;
    }

    #settings-view .settings-content {
        max-width: 100%;
    }

    .settings-card {
        border-radius: var(--radius-sm);
    }
}

.settings-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.settings-card-desc {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Expandable list (details/summary) */
.expandable-list {
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.expandable-list summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8f8f8;
    cursor: pointer;
    font-weight: 500;
    list-style: none;
}

.expandable-list summary::-webkit-details-marker {
    display: none;
}

.expandable-list summary::before {
    content: '▶';
    font-size: 0.7rem;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
}

.expandable-list[open] summary::before {
    transform: rotate(90deg);
}

.expandable-title {
    flex: 1;
}

.expandable-count {
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.expandable-list .allowed-emails-list {
    padding: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.expandable-list .email-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
}

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

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .expandable-list {
        border-color: #404040;
    }

    .expandable-list summary {
        background: #2a2d2e;
    }

    .email-item {
        background: #2a2d2e;
    }

    .expandable-list .email-item {
        border-bottom-color: #404040;
    }

    .email-add-row input {
        border-color: #404040;
    }
}

#settings-view .current-gate-code {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    color: white;
}

#settings-view .gate-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

#settings-view .gate-value {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.3rem;
}

#settings-view .gate-code-edit {
    display: flex;
    gap: 0.5rem;
}

#settings-view .gate-code-edit input {
    flex: 1;
    min-width: 0;
    max-width: 200px;
}

#settings-view .email-add-row,
#settings-view .blackout-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#settings-view .email-add-row input {
    flex: 1;
    min-width: 150px;
    max-width: 300px;
}

#settings-view .blackout-add-row input[type="date"] {
    width: auto;
}

#settings-view .blackout-add-row input[type="text"] {
    flex: 1;
    min-width: 100px;
    max-width: 200px;
}

/* Dark mode for tab bar */
@media (prefers-color-scheme: dark) {
    .bottom-tab-bar {
        background: rgba(30, 32, 34, 0.92);
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    .tab-item {
        color: #888;
    }

    .tab-item.active {
        color: var(--primary-light);
    }

    .tab-item.active::after {
        background: var(--primary-light);
    }

    .tab-item-new .tab-icon {
        background: #5a6b5e;
    }

    .tab-item-new.active .tab-icon {
        background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    }
}

/* ================================
   Pull to Refresh
   ================================ */
.pull-to-refresh {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: transform 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.pull-to-refresh.visible {
    opacity: 1;
}

.pull-to-refresh.pulling {
    transform: translateX(-50%) translateY(20px);
}

.pull-to-refresh.refreshing {
    transform: translateX(-50%) translateY(20px);
}

.pull-to-refresh svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary-color);
    transition: transform 0.2s ease;
}

.pull-to-refresh.refreshing svg {
    animation: refreshSpin 0.8s linear infinite;
}

@keyframes refreshSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ================================
   View 2: Calendar View
   ================================ */
.calendar-month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.cal-nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-nav-btn:hover {
    background: var(--primary-dark);
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e5e5e5;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.cal-day {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 0.9rem;
    padding: 6px;
    overflow: hidden;
}

.cal-day:hover {
    background: var(--accent-warm);
}

/* Density-based coloring */
.cal-day.density-1 { background: #f0f7f2; }
.cal-day.density-2 { background: #e1f0e4; }
.cal-day.density-3 { background: #d2e8d6; }
.cal-day.density-4 { background: #c3e0c8; }

.cal-day.density-1:hover,
.cal-day.density-2:hover,
.cal-day.density-3:hover,
.cal-day.density-4:hover {
    filter: brightness(0.97);
}

.cal-day.today {
    background: var(--accent-warm);
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.cal-day.today:hover {
    background: #e0c9a8;
}

.cal-day.past {
    opacity: 0.4;
    cursor: pointer;
}

.cal-day.blocked {
    background: #fee;
    cursor: not-allowed;
}

.cal-day.blocked:hover {
    background: #fee;
}

.blocked-indicator {
    background: var(--error-color);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.6rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-day.empty {
    background: transparent;
    cursor: default;
}

.cal-day.empty:hover {
    background: transparent;
}

.cal-day-num {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.cal-day.today .cal-day-num {
    color: var(--white);
    background: var(--primary-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.2);
    animation: todayPulse 2s ease-in-out infinite;
}

@keyframes todayPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.2); }
    50% { box-shadow: 0 0 0 5px rgba(45, 90, 61, 0.1); }
}

.cal-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.cal-event {
    background: var(--accent-color);
    color: var(--text-color);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.65rem;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 2px;
}

.cal-event-time {
    font-weight: 600;
    margin-right: 2px;
}

.cal-event-name {
    opacity: 0.9;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-tub-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.5);
    background: transparent;
    overflow: hidden;
}

.cal-tub-indicator.full {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(0, 0, 0, 0.6);
}

.cal-tub-indicator.half::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

/* Cabin tub event styling */
.cal-event.cabin-event {
    background: #b8a9c9;
}

/* Cabin square indicator (calendar) */
.cal-tub-square {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    margin-left: auto;
    border: 1px solid #c53030;
    background: transparent;
}

.cal-tub-square.filled {
    background: #c53030;
}

.cal-more {
    font-size: 0.6rem;
    color: var(--text-light);
    padding: 1px 4px;
}

/* ================================
   View 3: Day View (Time Slots)
   ================================ */
.day-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.day-header h2 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin: 0;
    min-width: 200px;
    text-align: center;
}

/* Day Instructions */
.day-instructions {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    margin: 0 0 0.75rem 0;
    font-style: italic;
}

/* Day Schedule - Table Layout */
.day-schedule-header {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-weight: 600;
    font-size: 0.75rem;
    text-align: center;
    align-items: center;
}

.schedule-col-main {
    letter-spacing: 0.1em;
}

.day-schedule {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow);
}

.schedule-row {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid #eee;
    align-items: center;
    min-height: 44px;
}

.schedule-row:last-child {
    border-bottom: none;
}

.schedule-row.past {
    opacity: 0.4;
}

/* Reservation grouping styles - Main tubs (green) */
.schedule-row.has-main-booking,
.schedule-row.has-cabin-booking {
    position: relative;
}

.schedule-row.has-main-booking::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 80px;
    right: 68px;
    background-color: rgba(45, 90, 61, 0.10);
    border-left: 2px solid rgba(45, 90, 61, 0.3);
    border-right: 2px solid rgba(45, 90, 61, 0.3);
    pointer-events: none;
    z-index: 0;
}

.schedule-row.main-booking-start::before {
    border-top: 2px solid rgba(45, 90, 61, 0.3);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.schedule-row.main-booking-end::before {
    border-bottom: 2px solid rgba(45, 90, 61, 0.3);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Reservation grouping styles - Cabin (red) */
.schedule-row.has-cabin-booking::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 60px;
    background-color: rgba(180, 60, 60, 0.10);
    border-left: 2px solid rgba(180, 60, 60, 0.3);
    border-right: 2px solid rgba(180, 60, 60, 0.3);
    pointer-events: none;
    z-index: 0;
}

.schedule-row.cabin-booking-start::after {
    border-top: 2px solid rgba(180, 60, 60, 0.3);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.schedule-row.cabin-booking-end::after {
    border-bottom: 2px solid rgba(180, 60, 60, 0.3);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Gap between different reservations */
.schedule-row.main-booking-start {
    margin-top: 6px;
}

.schedule-row.main-booking-start:first-child {
    margin-top: 0;
}

.booking-labels {
    position: absolute;
    left: 88px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1px;
    z-index: 2;
}

.booking-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
    cursor: pointer;
    line-height: 1.1;
}

.booking-label:hover {
    text-decoration: underline;
}

/* Ensure content stays above the shading */
.schedule-row .schedule-cell,
.schedule-row .schedule-time {
    position: relative;
    z-index: 1;
}

.schedule-time {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.schedule-time[data-book-all] {
    cursor: pointer;
    color: var(--primary-color);
}

.schedule-time[data-book-all]:hover {
    text-decoration: underline;
}

.time-arrow {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Main tubs cell with 3 circles */
.schedule-cell.main-tubs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.tub-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: transparent;
    display: inline-block;
    cursor: default;
    transition: all 0.15s ease;
}

.tub-icon.filled {
    background: var(--primary-color);
    cursor: pointer;
}

.tub-icon.available {
    cursor: pointer;
}

.tub-icon.available:hover {
    background: rgba(45, 90, 61, 0.2);
    transform: scale(1.1);
}

.tub-icon.filled:hover {
    transform: scale(1.1);
}

/* Cabin cell with square */
.schedule-cell.cabin-tub {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cabin-icon {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    background: transparent;
    display: inline-block;
    cursor: default;
    transition: all 0.15s ease;
}

.cabin-icon.available {
    /* Available - grey empty square */
    border-color: #bbb;
    cursor: pointer;
}

.cabin-icon.available:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.cabin-icon.open {
    /* Booked, open to family - thick red border, empty inside */
    border-color: #c53030;
    border-width: 3px;
    background: transparent;
}

.cabin-icon.private {
    /* Booked privately - filled red square */
    border-color: #c53030;
    background: #c53030;
}

.cabin-icon.booked {
    cursor: pointer;
}

.cabin-icon.booked:hover {
    transform: scale(1.1);
}

@media (max-width: 400px) {
    .day-schedule-header,
    .schedule-row {
        grid-template-columns: 70px 1fr 50px;
    }
    .tub-icon {
        width: 20px;
        height: 20px;
    }
    .cabin-icon {
        width: 16px;
        height: 16px;
    }
    .schedule-cell.main-tubs {
        gap: 0.5rem;
    }
    /* Adjust shading position for smaller screens */
    .schedule-row.has-main-booking::before {
        left: 70px;
        right: 58px;
    }
    .schedule-row.has-cabin-booking::after {
        width: 50px;
    }
    .booking-labels {
        left: 78px;
    }
    .booking-label {
        max-width: 50px;
        font-size: 0.65rem;
    }
}

.schedule-cell.empty {
    background: #f0f0f0;
}

.cell-guest {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-tubs {
    display: flex;
    gap: 3px;
    margin: 2px 0;
}

.cell-time {
    font-size: 0.7rem;
    color: var(--text-light);
}

.cell-cabin-type {
    font-size: 0.7rem;
    color: #6b5b95;
    font-weight: 500;
}

.schedule-cell.cabin.private .cell-cabin-type {
    color: #c53030;
}

@media (max-width: 400px) {
    .day-schedule-header {
        grid-template-columns: 55px 1fr 70px;
        font-size: 0.7rem;
    }
    .schedule-row {
        grid-template-columns: 55px 1fr 70px;
    }
    .schedule-time {
        font-size: 0.7rem;
    }
    .cell-guest {
        font-size: 0.75rem;
    }
}

/* ================================
   View 4: Reservation Form
   ================================ */
.reservation-form-new {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.form-section {
    margin-bottom: 1.75rem;
}

.form-section:not(:first-child) {
    margin-top: 1.5rem;
}

.form-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.form-row-inline {
    display: flex;
    gap: 1rem;
}

.form-row-inline .form-group {
    flex: 1;
}

.tub-selection-new {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tub-chip {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tub-chip input {
    display: none;
}

.tub-chip span {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(to bottom, #fff, #f8f8f8);
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    color: #2d3436;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    min-height: var(--min-touch-target);
    display: flex;
    align-items: center;
}

.tub-chip input:checked + span {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(45, 90, 61, 0.25);
}

.tub-chip:hover span {
    border-color: var(--primary-light);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.tub-chip:active span {
    transform: translateY(0);
}

.tub-type-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tub-type-option {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.tub-type-option input {
    display: none;
}

.tub-type-option span {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    color: #2d3436;
    transition: all 0.2s ease;
    text-align: center;
}

.tub-type-option input:checked + span {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.tub-type-option.cabin-option input:checked + span {
    background: #6b5b95;
    border-color: #6b5b95;
}

.tub-type-option:hover span {
    border-color: var(--primary-color);
}

.tub-type-option.cabin-option:hover span {
    border-color: #6b5b95;
}

.cabin-tub-section {
    margin-top: 1rem;
    padding: 1rem;
    background: #f5f0fa;
    border-radius: var(--border-radius);
    border-left: 3px solid #6b5b95;
}

.cabin-note {
    font-size: 0.875rem;
    color: #6b5b95;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

/* Legend */
.tub-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f8f8f8;
    border-radius: var(--border-radius);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dots {
    display: flex;
    gap: 2px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--primary-color);
    background: transparent;
}

.legend-dot.filled {
    background: var(--primary-color);
}

.legend-square {
    width: 8px;
    height: 8px;
    border: 1.5px solid #c53030;
    background: transparent;
}

.legend-square.filled {
    background: #c53030;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    flex: 1;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f0f7f0;
}

.autocomplete-item strong {
    color: var(--primary-color);
}

/* ================================
   Settings Panel (Collapsible)
   ================================ */
.settings-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 90;
    /* iOS safe area padding */
    padding-bottom: env(safe-area-inset-bottom);
}

.settings-panel summary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    list-style: none;
}

.settings-panel summary::-webkit-details-marker {
    display: none;
}

.settings-panel summary::before {
    content: '▲';
    margin-right: 0.5rem;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.settings-panel[open] summary::before {
    transform: rotate(180deg);
}

.settings-panel .settings-content {
    padding: 1rem 1.5rem 1.5rem;
    max-height: 50vh;
    overflow-y: auto;
}

.settings-panel .admin-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fafafa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
    box-shadow: none;
}

.settings-panel .admin-section h4 {
    font-size: 0.875rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* ================================
   Responsive adjustments for new UI
   ================================ */
@media (max-width: 480px) {
    .app-header {
        padding: 0.5rem 0.75rem;
        padding-top: max(0.5rem, env(safe-area-inset-top));
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .header-left,
    .header-right {
        width: 70px;
    }

    .header-btn {
        font-size: 0.9rem;
    }

    .fab {
        bottom: 130px;
        right: 1rem;
        width: 52px;
        height: 52px;
    }

    /* Compact reservation form on mobile */
    .reservation-form-new {
        padding: 1rem;
    }

    .reservation-form-new .form-section {
        margin-bottom: 1rem;
    }

    .reservation-form-new .form-section:not(:first-child) {
        margin-top: 0.75rem;
    }

    .reservation-form-new .form-section h3 {
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
    }

    .reservation-form-new .form-group {
        margin-bottom: 0.5rem;
    }

    .reservation-form-new .form-group label {
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
    }

    .reservation-form-new .form-group input,
    .reservation-form-new .form-group select,
    .reservation-form-new .form-group textarea {
        padding: 0.5rem;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .form-row-inline {
        flex-direction: row;
        gap: 0.5rem;
    }

    /* Date picker same width as time pickers */
    .reservation-form-new #reservation-date {
        width: calc(50% - 0.25rem);
    }

    .tub-selection-new {
        gap: 0.5rem;
    }

    .tub-chip span {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .tub-type-option span {
        padding: 0.4rem 0.5rem;
        font-size: 0.8rem;
    }

    .cabin-tub-section {
        padding: 0.75rem;
        margin-top: 0.5rem;
    }

    .cabin-note {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .recurring-toggle {
        margin-top: 0.5rem;
    }

    .recurring-options {
        margin-top: 0.5rem;
        padding: 0.75rem;
    }

    .cal-day {
        font-size: 0.8rem;
        min-height: 70px;
    }

    .cal-event {
        font-size: 0.6rem;
        padding: 1px 3px;
    }

    .cal-event-name {
        display: none;
    }
}

/* ================================
   Recurring Reservations
   ================================ */
.recurring-toggle {
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.recurring-options {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.recurring-badge {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.recurring-edit-options {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff8e8;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--accent-color);
}

.recurring-edit-notice {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.recurring-edit-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ================================
   Blackout Dates Admin
   ================================ */
.blackout-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.blackout-section h4 {
    font-size: 0.875rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.blackout-list {
    margin-bottom: 1rem;
}

.blackout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--error-color);
}

.blackout-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.blackout-date {
    font-weight: 600;
    color: var(--text-color);
}

.blackout-reason {
    font-size: 0.8rem;
    color: var(--text-light);
}

.blackout-add-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blackout-add-row input[type="date"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.blackout-add-row input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.blackout-add-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

@media (max-width: 480px) {
    .blackout-add-row {
        flex-direction: column;
    }

    .blackout-add-row input[type="date"],
    .blackout-add-row input[type="text"] {
        width: 100%;
    }

    .recurring-edit-buttons {
        flex-direction: column;
    }

    .recurring-edit-buttons .btn {
        width: 100%;
    }
}

/* ================================
   Analytics Dashboard
   ================================ */
.list-header-buttons {
    display: flex;
    gap: 0.5rem;
}

.analytics-header {
    margin-bottom: 1.5rem;
}

.analytics-header h2 {
    margin-bottom: 1rem;
}

.analytics-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.analytics-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: var(--white);
}

.custom-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.custom-range-inputs input[type="date"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.custom-range-inputs span {
    color: var(--text-light);
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.chart-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.chart-card h3 {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.chart-card canvas {
    max-height: 250px;
}

.chart-card-wide {
    grid-column: 1 / -1;
}

.chart-card-wide canvas {
    max-height: 200px;
}

.top-guests-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.top-guest-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
}

.top-guest-row:last-child {
    border-bottom: none;
}

.top-guest-rank {
    font-size: 0.8rem;
    color: var(--text-light);
    min-width: 1.5rem;
}

.top-guest-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
}

.top-guest-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

.no-data {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    padding: 1rem;
}

@media (max-width: 480px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .analytics-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .analytics-filters select {
        width: 100%;
    }

    .custom-range-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .custom-range-inputs input[type="date"] {
        width: 100%;
    }
}

/* ================================
   Drag and Drop Rescheduling
   ================================ */

/* Draggable items */
.list-item[draggable="true"] {
    cursor: grab;
}

.list-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Dragging state */
.list-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* List view drop zones */
.list-day-header.drag-over {
    background: var(--accent-warm);
    border-radius: var(--border-radius);
    padding: 0.75rem 0.5rem 0.25rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

/* Drag handle indicator */
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    color: #ccc;
    flex-shrink: 0;
    cursor: grab;
    touch-action: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle svg {
    pointer-events: none;
}

.list-item:hover .drag-handle {
    color: #999;
}

/* Drag feedback toast */
.drag-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-light);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.drag-toast.visible {
    opacity: 1;
}

.drag-toast.error {
    background: #c53030;
}

/* ================================
   Animations & Micro-interactions
   ================================ */

/* View transitions */
.view {
    animation: fadeSlideIn 0.25s ease-out;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Icon button animations */
.btn-icon {
    transition: transform 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* Loading spinner enhancement */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 0.8s linear infinite;
}

/* Toast slide-in */
.drag-toast {
    animation: toastSlideUp 0.2s ease-out;
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Staggered list animation for reservation items */
.list-item {
    animation: listItemFadeIn 0.3s ease-out backwards;
}

.list-item:nth-child(1) { animation-delay: 0.02s; }
.list-item:nth-child(2) { animation-delay: 0.04s; }
.list-item:nth-child(3) { animation-delay: 0.06s; }
.list-item:nth-child(4) { animation-delay: 0.08s; }
.list-item:nth-child(5) { animation-delay: 0.1s; }
.list-item:nth-child(6) { animation-delay: 0.12s; }
.list-item:nth-child(7) { animation-delay: 0.14s; }
.list-item:nth-child(8) { animation-delay: 0.16s; }

@keyframes listItemFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================
   Calendar Event Tooltip
   ================================ */
.cal-event {
    position: relative;
}

.cal-event[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-color);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    animation: tooltipFadeIn 0.15s ease-out;
}

.cal-event[title]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text-color);
    z-index: 101;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ================================
   Dark Mode Support
   ================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1d1e;
        --white: #252a2c;
        --text-color: #e8e8e8;
        --text-light: #9ca3a8;
        --primary-color: #4a9c67;
        --primary-dark: #3d8256;
        --primary-light: #5cb878;
        --accent-color: #d4a86a;
        --accent-warm: #3d3529;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.25);
        --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.35);
        --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.2), 0 6px 20px rgba(0, 0, 0, 0.3);
    }

    body {
        background-color: var(--background-color);
    }

    .calendar-grid {
        background: #1a1d1e;
    }

    .list-day-header {
        border-bottom-color: #404040;
    }

    input, select, textarea {
        background: #2a2d2e;
        border-color: #404040;
        color: var(--text-color);
    }

    input:focus, select:focus, textarea:focus {
        border-color: var(--primary-light);
    }

    .cal-day.density-1 { background: #2a322c; }
    .cal-day.density-2 { background: #2f3a30; }
    .cal-day.density-3 { background: #344234; }
    .cal-day.density-4 { background: #394a38; }

    .cal-day.today {
        background: var(--accent-warm);
        box-shadow: inset 0 0 0 2px var(--primary-light);
    }

    .cal-event {
        background: var(--accent-color);
        color: #1a1d1e;
    }

    .drag-handle {
        color: #555;
    }

    .list-item:hover .drag-handle {
        color: #888;
    }

    /* Fix for blocked days in dark mode */
    .cal-day.blocked {
        background: #3a2525;
    }

    .cal-day.past {
        opacity: 0.5;
    }

    .top-guest-row {
        border-bottom-color: #404040;
    }

    /* Form tub/cabin pill buttons */
    .tub-chip span {
        background: linear-gradient(to bottom, #2a2d2e, #252a2c);
        border-color: #404040;
        color: var(--text-color);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .tub-chip:hover span {
        border-color: var(--primary-light);
    }

    .tub-type-option span {
        border-color: #404040;
        color: var(--text-color);
    }

    .tub-type-option:hover span {
        border-color: var(--primary-light);
    }

    .tub-type-option.cabin-option:hover span {
        border-color: #8b7ab8;
    }

    /* Cabin section */
    .cabin-tub-section {
        background: #2a2535;
        border-left-color: #8b7ab8;
    }

    .cabin-note {
        color: #a99bc7;
    }

    .cell-cabin-type {
        color: #a99bc7;
    }
}
