/* =============================================
   Z-BOOKING FRONTEND STYLES
   ============================================= */

/* === Layout Container === */
.zb-booking-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    align-items: flex-start;
}

/* === Map Wrapper === */
.zb-map-wrapper {
    width: 100%;
    background: #f0f0f0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    min-width: 0;
}

.zb-map-au-co-wrapper {
    width: 100% !important;
    height: 70vh !important;
    min-height: 400px;
    max-height: 800px;
    overflow: hidden !important;
    background: #f5f5f5 !important;
    border: 1px solid #e0e0e0 !important;
    position: relative !important;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.zb-map-au-co {
    transform-origin: 0 0 !important;
}

/* === Zoom Controls === */
.zb-zoom-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.zb-zoom-controls button,
#zb-zoom-in, #zb-zoom-out, #zb-zoom-reset {
    width: 44px !important;
    height: 44px !important;
    background: rgba(255,255,255,0.95) !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 22px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    color: #333 !important;
    transition: background 0.2s, transform 0.1s;
}

.zb-zoom-controls button:active,
#zb-zoom-in:active, #zb-zoom-out:active, #zb-zoom-reset:active {
    transform: scale(0.92);
    background: #e0e0e0 !important;
}

.zb-zoom-controls button svg,
#zb-zoom-in svg, #zb-zoom-out svg, #zb-zoom-reset svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    stroke: #333 !important;
    flex-shrink: 0;
    pointer-events: none;
}

/* === Tier Legend === */
.zb-tier-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 12px 16px;
    background: #1a1a2e;
    justify-content: center;
}

.zb-tier-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #ccc;
    white-space: nowrap;
}

.zb-tier-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* === Sidebar (Booking Panel) === */
.zb-booking-sidebar {
    width: 100%;
    background: #fff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box;
}

.zb-booking-sidebar h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    border-bottom: none;
    padding-bottom: 0;
}

#zb-selected-seats-list {
    max-height: 200px;
    overflow-y: auto;
}

.zb-empty-msg {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 16px 0;
    margin: 0;
}

.zb-selected-item {
    display: flex;
    align-items: center;
    padding: 10px 12px 10px 16px !important;
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: 14px;
    color: #fff;
    gap: 0;
    border-left: none !important;
    width: 100%;
    box-sizing: border-box;
}

.zb-seat-id {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    padding-right: 8px;
    margin-right: 8px;
    border-right: 1px dashed rgba(255,255,255,0.35);
    flex-shrink: 0;
}

.zb-seat-tier {
    flex: 1;
    font-size: 12px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
    margin-right: 8px;
    border-right: 1px dashed rgba(255,255,255,0.35);
    min-width: 60px;
}

.zb-seat-price {
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0.9;
    padding-right: 8px;
    margin-right: 8px;
    border-right: 1px dashed rgba(255,255,255,0.35);
    flex-shrink: 0;
}

.zb-remove-seat {
    background: rgba(255,255,255,0.2) !important;
    border: none !important;
    color: #fff !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: background 0.2s;
    flex-shrink: 0;
    line-height: 0 !important;
    overflow: hidden;
    aspect-ratio: 1;
    box-sizing: border-box;
}

.zb-remove-seat svg {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    min-height: 12px !important;
    max-width: 12px !important;
    max-height: 12px !important;
    display: block !important;
    flex-shrink: 0;
    margin: auto !important;
}

.zb-remove-seat:hover {
    background: rgba(0,0,0,0.3);
}

/* === Total & Book Button === */
.zb-booking-total {
    margin: 12px 0;
    font-size: 18px;
    text-align: left;
    font-weight: 700;
    color: #1a1a2e;
    padding-top: 12px;
    border-top: 2px solid #eee;
}

.zb-booking-total span {
    color: #d32f2f;
}

#zb-btn-book {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(211,47,47,0.3);
    text-transform: uppercase;
}

#zb-btn-book:hover:not(:disabled) {
    background: linear-gradient(135deg, #e53935, #c62828);
    box-shadow: 0 6px 16px rgba(211,47,47,0.4);
    transform: translateY(-1px);
}

#zb-btn-book:active:not(:disabled) {
    transform: translateY(0);
}

#zb-btn-book:disabled {
    background: #bbb;
    cursor: not-allowed;
    box-shadow: none;
}

/* === Seats (inside map) === */
.zb-seat {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border 0.15s ease;
}

.zb-seat-available {
    cursor: pointer;
}

.zb-seat-available:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    z-index: 5 !important;
}

.zb-seat-selected {
    border: 3px solid #FFD700 !important;
    box-shadow: 0 0 12px rgba(255,215,0,0.6) !important;
    z-index: 5 !important;
}

.zb-seat-sold {
    background-color: #444 !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.zb-seat-locked-admin {
    position: relative;
    box-shadow: inset 0 0 0 2px #d32f2f !important; /* Viền đỏ để admin dễ nhận diện */
}
.zb-seat-locked-admin::after {
    content: "🔒";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    z-index: 10;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* === WooCommerce Tabs - luôn ngang === */
.wc-tabs.product-tabs,
ul.wc-tabs {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 0 !important;
}

.wc-tabs.product-tabs li,
ul.wc-tabs li {
    flex: 1 !important;
    text-align: center !important;
    display: block !important;
    float: none !important;
}

.wc-tabs.product-tabs li a,
ul.wc-tabs li a {
    display: block !important;
    white-space: nowrap !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
}

/* === Mobile First Responsive === */
@media (max-width: 768px) {
    .zb-map-au-co-wrapper {
        height: 55vh !important;
        min-height: 320px;
    }

    .zb-booking-sidebar {
        padding: 16px;
        position: sticky;
        bottom: 0;
        z-index: 100;
    }

    .zb-booking-sidebar h3 {
        font-size: 15px;
    }

    #zb-selected-seats-list {
        max-height: 120px;
    }

    .zb-selected-item {
        font-size: 12px;
        padding: 6px 0;
    }

    .zb-booking-total {
        font-size: 16px;
        margin: 8px 0;
        padding-top: 8px;
    }

    #zb-btn-book {
        padding: 12px;
        font-size: 15px;
    }

    .zb-tier-legend {
        gap: 6px 12px;
        padding: 8px 12px;
    }

    .zb-tier-legend-item {
        font-size: 11px;
    }

    /* Zoom buttons larger on mobile for touch */
    #zb-zoom-in, #zb-zoom-out, #zb-zoom-reset {
        width: 48px !important;
        height: 48px !important;
    }
}

@media (min-width: 1024px) {
    .zb-booking-container {
        flex-direction: row;
    }

    .zb-map-wrapper {
        flex: 1;
        min-width: 0;
    }

    .zb-booking-sidebar {
        width: 340px;
        flex-shrink: 0;
        position: sticky;
        top: 20px;
    }

    .zb-map-au-co-wrapper {
        height: 80vh !important;
        max-height: 900px;
    }

    #zb-selected-seats-list {
        max-height: 300px;
    }
}

/* === Scrollbar styling === */
#zb-selected-seats-list::-webkit-scrollbar {
    width: 4px;
}
#zb-selected-seats-list::-webkit-scrollbar-track {
    background: #f5f5f5;
}
#zb-selected-seats-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* === Loading state === */
#zb-btn-book.is-loading {
    pointer-events: none;
    opacity: 0.7;
}
