/**
 * Mobile UX Enhancements for Legacy jQuery Seating Chart
 * Addresses 50% lower mobile conversion rate (19.3% vs 38.1% desktop)
 *
 * Target: /reserve/vtcPostPerformance.php (legacy image-swap chart)
 * Simplified version - minimal overflow risk
 */

/* ========================================
   MOBILE-SPECIFIC ENHANCEMENTS
   ======================================== */

@media (max-width: 768px) {

    /* ===== FIX 1: Larger Tap Targets for Seat Images ===== */
    /* Keep existing yellow highlight, just make seats easier to tap */
    #seatingChartTable .img-swap {
        padding: 6px;
        margin: -6px;
        min-width: 40px;
        min-height: 40px;
        display: inline-block;
        cursor: pointer;
        box-sizing: content-box;
    }

    /* ===== FIX 3: Prevent Page Overflow ===== */
    body {
        overflow-x: hidden;
    }

    .pageContainer {
        max-width: 100% !important;
        overflow-x: auto;
    }

    /* ===== FIX 4: Seating Chart Table Scrollable ===== */
    #seatingChartTable {
        width: auto;
        max-width: 100%;
    }

    /* ===== FIX 5: Cart Display Area ===== */
    #cart {
        position: sticky;
        bottom: 10px;
        background: white;
        padding: 10px;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        z-index: 100;
        margin: 10px 0;
    }

    /* ===== FIX 6: Seat Count Badge (only when seats selected) ===== */
    .seat-count-badge {
        position: fixed;
        top: 80px;
        right: 15px;
        background: #2196F3;
        color: white;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: bold;
        box-shadow: 0 3px 10px rgba(33, 150, 243, 0.5);
        z-index: 999;
        pointer-events: none;
    }

    /* Hide badge when empty */
    .seat-count-badge.empty,
    .seat-count-badge:empty {
        display: none;
    }

    /* ===== FIX 7: Prevent Accidental Zoom ===== */
    table {
        touch-action: manipulation;
    }

    /* ===== FIX 8: Better Stage Label ===== */
    .bottom {
        font-size: 14px;
        padding: 8px;
    }

    /* ===== FIX 9: Section Title ===== */
    .description {
        font-size: 16px;
        padding: 10px;
    }
}

/* ========================================
   SMALL MOBILE DEVICES (< 480px)
   ======================================== */

@media (max-width: 480px) {

    /* Even larger tap targets for small phones */
    #seatingChartTable .img-swap {
        padding: 8px;
        margin: -8px;
        min-width: 44px;
        min-height: 44px;
    }

    /* More compact text */
    .bottom {
        font-size: 12px;
        padding: 6px;
    }

    .description {
        font-size: 14px;
        padding: 8px;
    }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
