/* ── Seating Plan Styles ── */

:root {
    --seat-available: #DCDEE0;
    --seat-hover:     #A8AAAB;
    --seat-selected:  #439698;
    --seat-sold: #959A9E;
    --gold: rgb(247, 217, 67);
    --seating-dark: #0e1a2b;
    --seating-off-white: #ffffff;
}

/* ── Fixed top header bar (above sidebar) ── */
.seating-top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: white;
    z-index: 150;
}

/* ── SVG Viewer ── */
.viewer-container {
    position: fixed;
    top: 155px;
    left: 151px;
    right: 0;
    height: calc(100vh - 155px);
    z-index: 1;
}

.viewer-wrap {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.viewer-wrap:active { cursor: grabbing; }

.svg-container {
    position: absolute;
    top: 0; left: 0;
    transform-origin: 0 0;
}

.svg-container svg {
    display: block;
    width: 2383.92px;
    height: 1683.96px;
}

/* ── Seat States ── */
#Seats path {
    cursor: pointer;
    transition: fill 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

#Seats path.seat-available {
    fill: var(--seat-available) !important;
    opacity: 1;
}

#Seats path.seat-available.seat-hover {
    fill: #8c8f91 !important;
    opacity: 1;
}

#Seats path.seat-selected {
    fill: var(--seat-selected) !important;
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.25));
}

#Seats path.seat-sold {
    fill: var(--seat-sold) !important;
    cursor: default;
}

#Seats path.seat-sold-bronze {
    fill: #E8D4B0 !important;
    cursor: default;
}

#Seats path.seat-sold-silver {
    fill: #D1D3D5 !important;
    cursor: default;
}

#Seats path.seat-sold-gold {
    fill: #F0E4A0 !important;
    cursor: default;
}

#Seats path.seat-tier-locked {
    fill: #ffffff !important;
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Seating Header ── */
.seating-header {
    padding: 20px 30px 12px;
    border-bottom: 1px solid #2c2c2c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seating-header h1 {
    font-family: gnlight, Helvetica, sans-serif;
    font-size: 42px;
    font-weight: 100;
    color: #6b6b6b;
    line-height: 1;
    margin: 0;
}

.seating-divider {
    border: none;
    border-top: 1px solid #2c2c2c;
    margin: 0;
}

/* ── Legend ── */
.seating-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    row-gap: 6px;
    align-items: center;
    background: #ffffff;
    padding: 10px 30px;
    position: relative;
    z-index: 10;
}

.legend-row-break {
    display: none;
    flex-basis: 100%;
    height: 0;
}

.seating-back-btn {
    margin-left: auto;
    align-self: center;
    display: inline-block;
    background: none;
    border: 1px solid rgba(14,26,43,0.25);
    border-radius: 2px;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(14,26,43,0.45);
    text-decoration: none;
    padding: 5px 10px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    white-space: nowrap;
    cursor: pointer;
}

.seating-back-btn:hover,
.seating-back-btn:focus {
    color: var(--seating-dark);
    border-color: rgba(14,26,43,0.5);
    background: rgba(14,26,43,0.04);
    text-decoration: none;
}

/* Hidden by default (desktop); shown on mobile via media query below */
.seating-back-mobile { display: none; }

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-left: 12px;
    font-family: gnlight, Helvetica, sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(14,26,43,0.6);
}

.legend-dot {
    width: 10px; height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-dot.available { background: var(--seat-available); }
.legend-dot.selected  { background: var(--seat-selected); }
.legend-dot.sold      { background: #4a4e52; }

.legend-divider {
    width: 1px;
    height: 20px;
    background: rgba(107,107,107,0.25);
    flex-shrink: 0;
}

.legend-note-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.legend-note {
    font-size: 0.78rem;
    color: rgba(14,26,43,0.5);
    letter-spacing: 0.04em;
    text-transform: none;
    display: none;
}

.legend-tier-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 1px solid transparent;
    border-radius: 2px;
    padding: 5px 12px;
    font-family: gnlight, Helvetica, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(14,26,43,0.5);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.legend-tier-btn:hover {
    color: var(--seating-dark);
    border-color: rgba(14,26,43,0.2);
    background: rgba(14,26,43,0.03);
}

.legend-tier-btn.active {
    color: var(--seating-dark);
    border-color: rgba(14,26,43,0.3);
    background: rgba(14,26,43,0.05);
}

.legend-tier-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-tier-dot-bronze { background: #CD7F32; }
.legend-tier-dot-silver { background: #7A7E82; }
.legend-tier-dot-gold   { background: rgb(247,217,67); }

/* ── Tooltip ── */
.seat-tooltip {
    position: fixed;
    background: #ffffff;
    border: 1px solid rgba(107,107,107,0.2);
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 0.78rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 200;
    max-width: 180px;
}

.seat-tooltip.visible { opacity: 1; }

.seat-tooltip .seat-id {
    font-size: 1rem;
    color: #6b6b6b;
    display: block;
    margin-bottom: 2px;
}

.seat-tooltip .donor-name {
    color: #6b6b6b;
    font-size: 0.75rem;
}

.seat-tooltip .seat-status {
    color: rgba(107,107,107,0.6);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ── Zoom Controls ── */
.zoom-controls {
    position: fixed;
    bottom: 166px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
}

.zoom-btn {
    width: 36px; height: 36px;
    background: rgba(245,242,237,0.95);
    border: 1px solid rgba(107,107,107,0.4);
    color: #6b6b6b;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
}

.zoom-btn:hover {
    border-color: #6b6b6b;
    background: rgba(107,107,107,0.1);
}

/* ── Instructions ── */
.seating-instructions {
    position: fixed;
    bottom: 90px;
    left: calc(151px + 50%);
    transform: translateX(calc(-50% - 75.5px));
    background: rgba(245,242,237,0.92);
    border: 1px solid rgba(200,169,110,0.3);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: rgba(14,26,43,0.5);
    text-transform: uppercase;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.5s ease;
}

.seating-instructions.hide { opacity: 0; }

/* ── Bottom Dividers ── */
.bottom-padding-bg {
    position: fixed;
    bottom: 0;
    left: 151px; right: 0;
    height: 40px;
    background: #ffffff;
    z-index: 1001;
}

.bottom-divider-bg {
    position: fixed;
    bottom: 40px;
    left: 151px; right: 0;
    height: 5px;
    background: #ffffff;
    z-index: 999;
}

.bottom-divider-1 {
    position: fixed;
    bottom: 44px;
    left: 151px; right: 0;
    height: 1px;
    background: rgba(107,107,107,0.2);
    z-index: 1002;
}

.bottom-divider-2 {
    position: fixed;
    bottom: 40px;
    left: 151px; right: 0;
    height: 1px;
    background: rgba(107,107,107,0.2);
    z-index: 1002;
}

/* ── Donate Bar ── */
.donate-bar {
    position: fixed;
    bottom: 0; left: 151px; right: 0;
    height: 112px;
    background: #ffffff;
    border-top: 1px solid rgba(107,107,107,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px 44px;
    transform: translateY(100%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 1, 1);
    z-index: 1000;
}

.donate-bar.visible {
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.donate-bar-info {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 24px);
    flex-shrink: 1;
    min-width: 0;
}

.donate-bar-divider {
    width: 1px;
    height: 28px;
    background: rgba(107,107,107,0.2);
    flex-shrink: 0;
}

.selected-seat-tag {
    font-size: clamp(0.85rem, 1.4vw, 1.3rem);
    color: #6b6b6b;
    font-weight: 300;
    white-space: nowrap;
}

.donate-col-tier  { min-width: clamp(50px, 6vw, 90px);  flex-shrink: 1; }
.donate-col-total { min-width: clamp(70px, 9vw, 130px); flex-shrink: 1; }

.selected-seat-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(14,26,43,0.45);
}

.donate-bar-note {
    font-size: 0.72rem;
    color: rgba(14,26,43,0.65);
    line-height: 1.45;
    white-space: normal;
    max-width: 240px;
}

.donate-btn {
    background: #4a4e52;
    color: #ffffff;
    border: none;
    padding: 14px 36px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}

.donate-btn:hover { background: #2e3135; }
.donate-btn:active { transform: scale(0.98); }

.qty-control {
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.8vw, 10px);
    flex-shrink: 1;
    min-width: 0;
    justify-content: center;
}

.qty-btn {
    background: none;
    border: 1px solid rgba(14,26,43,0.25);
    color: rgba(14,26,43,0.6);
    width: 30px;
    height: 30px;
    border-radius: 3px;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.qty-btn:hover {
    border-color: rgba(14,26,43,0.5);
    color: var(--seating-dark);
    background: rgba(14,26,43,0.04);
}

.qty-value {
    font-size: 1.3rem;
    min-width: 32px;
    text-align: center;
    color: #6b6b6b;
    font-weight: 300;
    white-space: nowrap;
}

/* ── Donor Modal ── */
.donor-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14,26,43,0.4);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.donor-modal-backdrop.visible {
    opacity: 1;
    pointer-events: all;
}

.donor-modal {
    background: var(--seating-off-white);
    border: 1px solid rgba(107,107,107,0.2);
    padding: 40px 48px;
    border-radius: 4px;
    width: 100%;
    max-width: 420px;
}

.donor-modal h2 {
    font-family: gnlight, Helvetica, sans-serif;
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--seating-dark);
    margin-bottom: 6px;
}

.donor-modal-subtitle {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: rgba(14,26,43,0.45);
    margin-bottom: 28px;
    padding-left: 0;
}

.donor-modal-summary {
    background: rgba(14,26,43,0.04);
    border: 1px solid rgba(107,107,107,0.15);
    border-radius: 2px;
    padding: 12px 16px;
    margin: 0 0 24px;
    font-size: 0.82rem;
    color: rgba(14,26,43,0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.donor-modal-summary strong {
    color: var(--seating-dark);
    font-weight: 500;
}

#donorForm { width: 100%; }

.donor-field {
    margin-bottom: 16px;
}

.donor-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.donor-field .donor-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: rgba(14,26,43,0.75);
    margin: 0;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

.donor-field .donor-radio-label input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.donor-field label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(14,26,43,0.45);
    margin-bottom: 6px;
}

.donor-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid rgba(107,107,107,0.3);
    border-radius: 2px;
    font-size: 0.9rem;
    color: var(--seating-dark);
    background: #fff;
    outline: none;
    resize: none;
    transition: border-color 0.2s;
    font-family: inherit;
    line-height: 1.5;
}

.donor-field textarea:focus { border-color: var(--seat-selected); }

.dedication-counter {
    text-align: right;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: rgba(14,26,43,0.35);
    margin-top: 4px;
}

.donor-field input,
.donor-field select,
.donor-field .StripeElement {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid rgba(107,107,107,0.3);
    border-radius: 2px;
    font-size: 0.9rem;
    color: var(--seating-dark);
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.donor-field input:focus,
.donor-field select:focus,
.donor-field .StripeElement--focus {
    border-color: var(--seat-selected);
}

.donor-field .StripeElement--invalid {
    border-color: #ff6b6b;
}

.donor-modal-error {
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 8px;
    min-height: 1.2em;
}

.donor-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    width: 100%;
    box-sizing: border-box;
}

.donor-cancel-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(14,26,43,0.2);
    color: rgba(14,26,43,0.45);
    padding: 13px 16px;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: border-color 0.2s, color 0.2s;
}

.donor-cancel-btn:hover {
    border-color: rgba(14,26,43,0.5);
    color: var(--seating-dark);
}

.donor-submit-btn {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    background: var(--gold);
    color: var(--seating-dark);
    border: none;
    padding: 13px 16px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s;
}

.donor-submit-btn:hover { background: rgb(220, 193, 50); }
.donor-submit-btn:disabled {
    background: rgba(247,217,67,0.4);
    cursor: not-allowed;
}

/* ── Sold Modal ── */
.sold-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14,26,43,0.4);
    backdrop-filter: blur(4px);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sold-modal-backdrop.visible {
    opacity: 1;
    pointer-events: all;
}

.sold-modal {
    background: var(--seating-off-white);
    border: 1px solid rgba(200,169,110,0.4);
    padding: 40px 48px;
    border-radius: 4px;
    text-align: center;
    max-width: 340px;
}

.sold-modal .plaque-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.sold-modal h2 {
    font-size: 1.6rem;
    font-weight: 300;
    color: var(--gold);
    margin-bottom: 6px;
}

.sold-modal .donor {
    font-size: 0.85rem;
    color: rgba(14,26,43,0.6);
    margin-bottom: 24px;
}

.sold-modal-close {
    background: none;
    border: 1px solid rgba(200,169,110,0.5);
    color: var(--gold);
    padding: 10px 28px;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: border-color 0.2s;
}

.sold-modal-close:hover { border-color: var(--gold); }

/* ── Tier Selection Modal ── */
.tier-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14,26,43,0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tier-modal-backdrop.visible {
    opacity: 1;
    pointer-events: all;
}

.tier-modal {
    background: var(--seating-off-white);
    border: 1px solid rgba(107,107,107,0.2);
    padding: 40px 48px;
    border-radius: 4px;
    width: 100%;
    max-width: 440px;
}

.tier-modal h2 {
    font-family: gnlight, Helvetica, sans-serif;
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--seating-dark);
    margin-bottom: 6px;
}

.tier-modal-subtitle {
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    color: rgba(14,26,43,0.45);
    margin-bottom: 28px;
    padding-left: 0;
}

.tier-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tier-option {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: none;
    border: 1px solid rgba(107,107,107,0.2);
    border-radius: 2px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: border-color 0.2s, background 0.15s;
}

.tier-option:hover {
    border-color: rgba(14,26,43,0.5);
    background: rgba(14,26,43,0.03);
}

.tier-swatch {
    width: 32px;
    height: 32px;
    border-radius: 2px;
    flex-shrink: 0;
}

.tier-swatch-bronze { background: #CD7F32; }
.tier-swatch-silver { background: #7A7E82; }
.tier-swatch-gold   { background: rgb(247,217,67); }

.tier-name {
    font-family: gnmedium, Helvetica, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--seating-dark);
    letter-spacing: 0.04em;
}

.tier-price {
    font-size: 0.82rem;
    color: rgba(14,26,43,0.5);
    margin-top: 2px;
}

.tier-price span {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

/* ── Responsive ── */
@media (max-width: 1024px) and (min-width: 769px) {
    .donate-bar-note {
        font-size: 0.65rem;
        max-width: 180px;
    }

    .donate-bar > div:last-child {
        gap: 16px !important;
    }
}

@media (max-width: 430px) {
    .seating-instructions {
        bottom: 16px;
        font-size: 0.55rem;
        padding: 6px 10px;
    }
}

@media (max-width: 768px) {
    .viewer-container {
        left: 0;
        top: 160px;
        height: calc(100vh - 160px);
    }

    .seating-header {
        padding: 14px 16px 10px;
    }

    .seating-header h1 {
        font-size: 28px;
    }

    .seating-legend {
        padding: 8px 16px;
        gap: 14px;
        row-gap: 4px;
    }

    .seating-back-mobile { display: inline-block; }
    .seating-back-desktop { display: none; }
    .legend-row-break { display: block; }

    .legend-item {
        font-size: 0.6rem;
        gap: 5px;
        padding-left: 0;
    }

    .legend-note {
        display: inline;
        font-size: 0.55rem;
        line-height: 1.4;
    }

    .legend-note-group {
        gap: 6px;
        flex: 1;
        min-width: 0;
    }

    .legend-tier-btn {
        font-size: 0.55rem;
        padding: 2px 6px;
    }

    .legend-tier-dot { width: 8px; height: 8px; }

    .donate-bar-note { display: none; }

    /* Fix: col min-widths overflowed the bar on small phones, pushing the button off-screen */
    .donate-col-tier  { min-width: 40px; }
    .donate-col-total { min-width: 50px; }
    .qty-control      { min-width: 80px; gap: 5px; }

    .donate-bar {
        left: 0;
        padding: 0 12px 4px;
        height: 52px;
        bottom: 40px;
        transform: translateY(calc(100% + 40px));
    }

    .donate-bar.visible {
        transform: translateY(0);
    }

    .donate-bar-info { gap: 8px; }
    .donate-bar-divider { height: 20px; }
    .selected-seat-label { display: none; }
    .selected-seat-tag { font-size: 0.85rem; white-space: nowrap; }

    .donate-btn {
        padding: 9px 14px;
        font-size: 0.72rem;
        letter-spacing: 0.06em;
    }

    .qty-btn {
        width: 22px;
        height: 22px;
        font-size: 0.9rem;
    }

    .qty-value {
        font-size: 1rem;
        min-width: 20px;
    }

    .zoom-controls {
        bottom: 108px;
        right: 16px;
    }

    .bottom-padding-bg,
    .bottom-divider-bg,
    .bottom-divider-1,
    .bottom-divider-2 {
        left: 0;
    }

    .seating-instructions {
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.6rem;
        padding: 7px 12px;
        bottom: 24px;
    }
}
