/*
 * Zoom Room Common Styles
 * Shared across all customer-facing pages
 */

:root {
    /* Zoom Room Brand Colors */
    --zr-blue: #00468b;
    --zr-orange: #f37021;
    --zr-orange-90: rgba(243, 112, 33, 0.9);
    --primary: #00468b;
    --primary-dark: #003366;
    --primary-light: #e6f0f9;
    --accent: #f37021;
    --accent-dark: #d4530a;
    --accent-light: #fef0e6;
    --secondary: #00468b;
    --secondary-light: #e6f0f9;
    --warning: #f37021;
    --warning-light: #fef0e6;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --success: #16a34a;
    --success-light: #dcfce7;
    --success-bg: #f0fdf4;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #333333;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #f0f0f0;
    --surface: #f9fafb;
    --text-inverse: #ffffff;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;
    --info-text: #1e40af;
    --warning-bg: #fffbeb;
    --warning-border: #fbbf24;
    --warning-text: #92400e;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Dark Mode (system preference)
   ============================================ */
html[data-theme="dark"] {
    --primary: #4a9eff;
    --primary-dark: #2d7fd4;
    --primary-light: #1a2a3d;
    --accent: #ff8c42;
    --accent-dark: #e67320;
    --accent-light: #3d2a1a;
    --secondary: #4a9eff;
    --secondary-light: #1a2a3d;
    --warning: #ff8c42;
    --warning-light: #3d2a1a;
    --danger: #f87171;
    --danger-light: #450a0a;
    --danger-bg: #3b1010;
    --danger-border: #7f1d1d;
    --success: #4ade80;
    --success-light: #14532d;
    --success-bg: #0a2e1a;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --bg: #0f172a;
    --card: #1e293b;
    --border: #334155;
    --border-light: #283548;
    --surface: #1a2332;
    --text-inverse: #0f172a;
    --info-bg: #1e3a5f;
    --info-border: #1e40af;
    --info-text: #93c5fd;
    --warning-bg: #451a03;
    --warning-border: #92400e;
    --warning-text: #fbbf24;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

/* Skip to content link (accessibility) */
.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10001;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: 'Fjalla One', sans-serif;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Main content area grows to push footer down */
main {
    flex: 1 0 auto;
    width: 100%;
}

/* ============================================
   Header
   ============================================ */
.header {
    background: var(--card);
    border-bottom: 3px solid var(--accent);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

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

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 48px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.header-nav a {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s;
}

.header-nav a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.header-nav a.active {
    color: var(--primary);
    font-weight: 600;
}

.header-nav a.nav-primary {
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
}

.header-nav a.nav-primary:hover {
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.franchise-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: 0.5px;
    padding-left: 24px;
    border-left: 1px solid var(--border);
}

.franchise-link:hover {
    color: var(--accent);
}

.btn-login {
    background: var(--accent);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 4px;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--accent-dark);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    touch-action: manipulation;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.2s;
    transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.mobile-nav-overlay.active {
    display: block;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

.mobile-nav a {
    padding: 12px 24px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.mobile-nav a.mobile-login-btn {
    background: var(--accent);
    color: white;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    padding: 14px 24px;
    margin: 4px 24px 8px;
    border-radius: 50px;
    letter-spacing: 0.5px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mobile-nav a.mobile-login-btn:hover {
    background: var(--accent-dark);
    color: white;
}

.mobile-nav a.mobile-franchise-link {
    font-weight: 700;
}

.mobile-nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.mobile-nav.active {
    display: flex;
}

/* Theme toggle (mobile menu) */
.theme-toggle {
    display: flex;
    gap: 0;
    margin: 8px 24px 4px;
    padding: 3px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.theme-seg {
    flex: 1;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.theme-seg.active {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 600;
}

@media (max-width: 1100px) {
    .header-nav, .header-right {
        display: none;
    }
    .mobile-menu-btn {
        display: flex;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }
    .header {
        padding: 8px 16px;
    }
    .logo img {
        height: 36px;
    }
}

/* Extra-small screens (iPhone Mini, etc.) */
@media (max-width: 480px) {
    .header {
        padding: 10px 16px;
    }
    .header-content {
        gap: 12px;
    }
    .logo img {
        height: 32px;
    }
    /* Hide location text to prevent width blowout */
    #header-location {
        display: none !important;
    }
    .header-right {
        gap: 12px;
    }
}

/* ============================================
   Main Container
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    color: var(--text);
    background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    min-height: 48px;
}

input[type="password"] {
    font-family: inherit;
    letter-spacing: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.dog-info-group {
    border: 2px solid var(--accent);
    background: var(--accent-light);
    border-radius: 12px;
    padding: 16px;
    margin-top: 4px;
    margin-bottom: 16px;
}
.dog-info-group .form-group:last-child {
    margin-bottom: 0;
}
.dog-info-group .section-title {
    margin-top: 0;
}
/* Hide Safari's default "today" display on empty date inputs.
   Safari (both desktop + iOS) renders type="date" with today's date when empty.
   hanging-punctuation is supported by Safari only (not Chrome/Firefox),
   so this block targets all Safari browsers exclusively. */
@supports (hanging-punctuation: first) {
    input[type="date"]:not(.has-date) {
        color: transparent;
        position: relative;
    }
    input[type="date"]:not(.has-date)::-webkit-date-and-time-value {
        color: transparent;
    }
    input[type="date"]:not(.has-date)::before {
        content: "mm/dd/yyyy";
        color: var(--text-muted, #999);
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
    }
    /* Hide placeholder when focused (user is actively typing) */
    input[type="date"]:focus::before {
        display: none;
    }
    input[type="date"]:focus {
        color: inherit;
    }
    input[type="date"]:focus::-webkit-date-and-time-value {
        color: inherit;
    }
    input[type="date"].has-date {
        color: inherit;
    }
    input[type="date"].has-date::-webkit-date-and-time-value {
        color: inherit;
    }
    input[type="date"].has-date::before {
        display: none;
    }
}

/* ============================================
   Buttons
   ============================================ */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

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

.btn-success:hover {
    background: #15803d;
}

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

.btn-accent:hover {
    background: var(--accent-dark);
}

.btn-accent:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-warning {
    background: #ea580c;  /* Dark orange for "Only X Spots" */
    color: white;
}

.btn-warning:hover {
    background: #c2410c;
}

.btn-waitlist {
    background: #fdba74;  /* Light orange for "Join Waitlist" */
    color: #7c2d12;
}

.btn-waitlist:hover {
    background: #fb923c;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

.btn-block {
    width: 100%;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

.spinner-dark {
    border-color: rgba(0,0,0,0.1);
    border-top-color: var(--primary);
}

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

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   Alternatives (waitlist suggestion flow)
   ============================================ */

.alternatives-header {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.alternatives-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.alternatives-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
}

.alt-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface, #f8f9fa);
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 12px;
}

.alt-card-info {
    flex: 1;
    min-width: 0;
}

.alt-card-day {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.alt-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.alt-card .btn {
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 12px;
}

.alt-tier-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0 4px;
}

.alt-tier-label:first-child {
    margin-top: 0;
}

.alternatives-loading {
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   Divider
   ============================================ */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.divider::before {
    margin-right: 16px;
}

.divider::after {
    margin-left: 16px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 8px;
}

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ============================================
   Footer (Layout A - Full)
   ============================================ */
.site-footer {
    background: var(--primary);
    color: white;
    padding: 24px 24px 90px 24px;
    margin-top: 48px;
}

.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.footer-logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.footer-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer-nav a:hover {
    opacity: 1;
}

.footer-nav .separator {
    opacity: 0.5;
    font-size: 10px;
}

.footer-nav .franchise-info-txt {
    text-transform: uppercase;
}

.footer-social {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.footer-social a {
    color: white;
    display: flex;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.footer-social a:hover {
    opacity: 1;
}

.footer-social svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 16px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    opacity: 0.7;
}

.footer-bottom .footer-bottom-right {
    display: flex;
    gap: 16px;
}

.footer-legal {
    display: flex;
    gap: 16px;
}

.footer-legal a {
    color: white;
    text-decoration: none;
}

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

@media (min-width: 821px) {
    .desktop-hide {
        display: none !important;
    }
}

@media (max-width: 820px) {
    .site-footer {
        padding-bottom: 22px;
    }

    .footer-main {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-logo {
        margin: 0 auto;
    }

    .footer-nav {
        margin: 0 auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .footer-nav a {
        font-size: 15px;
    }

    .footer-nav a.franchise-info-txt {
        font-size: 14px;
        grid-column: 1 / -1;
        text-align: center;
    }

    .footer-left {
        display: flex;
    }

    .footer-bottom .footer-left,
    .footer-bottom .footer-legal {
        font-size: 8px;
        gap: 12px;
    }

    .mobile-hide {
        display: none;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        gap: 16px;
        text-align: center;
    }

    .footer-bottom .footer-bottom-right {
        flex-direction: column;
        align-items: center;
    }
}

/* ============================================
   Dark Mode Component Overrides
   ============================================ */
html[data-theme="dark"] {
    /* Form inputs */
    input, select, textarea {
        background: var(--card);
        color: var(--text);
        border-color: var(--border);
        color-scheme: dark;
    }

    input:focus, select:focus, textarea:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
    }

    /* Modal */
    .modal {
        background: var(--card);
    }

    .modal-overlay {
        background: rgba(0, 0, 0, 0.7);
    }

    /* Spinner */
    .spinner {
        border-color: rgba(255, 255, 255, 0.15);
        border-top-color: var(--primary);
    }

    /* Footer - keep readable on dark primary bg */
    .site-footer {
        background: #0c1527;
    }

    .footer-main {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    /* Images on white backgrounds */
    img[src*="product"], img[src*="gift"] {
        border-radius: 8px;
        box-shadow: 0 0 0 1px var(--border);
    }

    /* Google Maps iframes */
    iframe[src*="google.com/maps"] {
        border: 1px solid var(--border);
        border-radius: 8px;
    }

    /* Loading overlays */
    .loading-overlay {
        background: rgba(15, 23, 42, 0.9) !important;
    }

    /* Logo visibility on dark background */
    .logo img, .footer-logo {
        filter: brightness(1.8);
    }

    /* SVG icons with hardcoded strokes */
    svg[stroke="#00468b"] {
        stroke: var(--primary);
    }

    /* Buttons with white text - keep readable */
    .btn-primary, .btn-accent, .btn-success, .btn-danger, .btn-warning {
        color: #ffffff;
    }

    .btn-login {
        color: #ffffff;
    }
}
