﻿#canvas-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    /* ✅ FIX: Maintain aspect ratio on all devices */
    aspect-ratio: 4/3; /* Adjust based on your originalWidth/originalHeight ratio */
    /* ✅ Prevent height expansion */
    height: auto !important;
}

/* Modern Pricing Card Styles */
.pricing-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.pricing-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

    .pricing-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12), 0 20px 40px rgba(0, 0, 0, 0.08);
    }

    .pricing-card.sold-out {
        opacity: 0.7;
        filter: grayscale(0.5);
    }

        .pricing-card.sold-out:hover {
            transform: none;
        }

.pricing-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    position: relative;
}

    .pricing-header::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 0;
        right: 0;
        height: 10px;
        background: inherit;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 60%, 0 100%);
    }

.pricing-card.sold-out .pricing-header {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.pricing-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-amount {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.pricing-currency {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
    margin-right: 0.25rem;
}

.pricing-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
}

.pricing-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    margin: 0;
    min-height: 2.5rem;
}

.pricing-body {
    padding: 2rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    flex-grow: 1;
}

.pricing-feature-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

    .pricing-feature-item:last-child {
        border-bottom: none;
    }

.feature-checkbox-wrapper {
    display: flex;
    align-items: center;
    min-width: 20px;
    padding-top: 2px;
}

.feature-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

    .feature-checkbox:disabled {
        cursor: not-allowed;
        opacity: 0.6;
    }

.feature-content {
    flex: 1;
}

.feature-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.feature-price {
    color: #667eea;
    font-weight: 600;
    font-size: 0.875rem;
}

.feature-description {
    color: #718096;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.pricing-footer {
    padding: 0 1.5rem 2rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quantity-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.quantity-select {
    padding: 0.6rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

    .quantity-select:hover {
        border-color: #667eea;
    }

    .quantity-select:focus {
        outline: none;
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

.availability-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
}

.badge-coming-soon {
    background: #fef3c7;
    color: #92400e;
}

.badge-sold-out {
    background: #fee2e2;
    color: #991b1b;
}

.sold-out-message {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
}

/* ✅ Fabric.js canvas wrapper */
.canvas-container {
    width: 100% !important;
    height: auto !important;
    position: relative !important;
}

    /* ✅ Ensure canvas elements respect container */
    .canvas-container > canvas {
        width: 100% !important;
        height: auto !important;
        display: block;
    }
/* ✅ MOBILE OPTIMIZATIONS */
@media (max-width: 991px) {
    /* Remove card padding on tablets and below */
    .card-body {
        padding: 0.5rem !important;
    }

    /* Reduce section padding */
    .section-md {
        padding-top: 0 !important;
        padding-bottom: 1rem !important;
    }

    /* Reduce container padding */
    .container-xl {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Make canvas container full width */
    #canvas-container {
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Reduce tab content padding */
    .tab-content {
        margin-top: 1rem !important;
    }

    /* Reduce row padding */
    .pb-5.pt-5 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

@media (max-width: 767px) {
    /* Remove nearly all padding on mobile */
    .card-body {
        padding: 0.25rem !important;
    }

    .container-xl {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Full-width canvas on mobile */
    #canvas-container {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        aspect-ratio: 4/3;
        position: relative;
    }

        /* Ensure canvas fills container */
        #canvas-container canvas,
        #canvas-container .canvas-container {
            width: 100% !important;
            max-width: 100% !important;
        }

    /* Reduce card margin */
    .card.border-light {
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }

        .card.border-light.p-md-2 {
            padding: 0 !important;
        }

    /* Reduce nav tabs size */
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Reduce hero section on mobile */
    .section-image.pb-7 {
        padding-bottom: 2rem !important;
    }

    /* Reduce top margin offset */
    .mt-n7 {
        margin-top: -1.5rem !important;
    }

    /* Hide venue layout heading on very small screens */
    .fh5co-section-heading h2.fh5co-lead {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    /* Reduce pricing card padding */
    .pricing-container {
        padding: 0 !important;
    }

    .pricing-card {
        margin: 0.5rem 0 !important;
    }
}

@media (max-width: 480px) {
    /* Extra small screens - maximum canvas space */
    #canvas-container {
        width: 100vw !important;
        max-width: 100vw !important;
/*        margin-left: -0.25rem !important;
        margin-right: -0.25rem !important;*/
        /* Adjust aspect ratio for taller canvas on small screens */
        aspect-ratio: 1/1;
    }

    .quantity-selector {
        flex-direction: column;
        gap: 0.5rem;
    }

    #ticket-popup {
        max-width: calc(100vw - 20px) !important;
        min-width: auto !important;
        left: 10px !important;
        right: 10px !important;
    }

    #seat-loading-notification {
        max-width: calc(100vw - 20px);
        min-width: auto !important;
    }

    .quantity-select {
        width: 100%;
    }

    /* Minimize all surrounding padding */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .col-12 {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* Compact nav tabs */
    .nav-tabs .nav-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }

        .nav-tabs .nav-link .fa {
            display: none; /* Hide icons on very small screens */
        }

    /* Reduce heading sizes */
    .fh5co-section-heading h2.fh5co-lead {
        font-size: 1rem;
    }

    /* Compact ticket table */
    #cart th, #cart td {
        padding: 0.25rem;
        font-size: 1.17rem;
    }
}

/* ✅ Landscape mode optimization */
@media (max-width: 767px) and (orientation: landscape) {
    #canvas-container {
        aspect-ratio: 16/9;
        max-height: 70vh;
    }

    /* Hide non-essential elements in landscape */
    .section-image {
        display: none !important;
    }

    .mt-n7 {
        margin-top: 0 !important;
    }
}

/* ✅ Touch-friendly adjustments */
@media (pointer: coarse) {
    #canvas-container {
        touch-action: pan-x pan-y pinch-zoom;
    }
}
/* Responsive adjustments */
@media (max-width: 768px) {
    .pricing-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem 0;
    }

    #canvas-container {
        width: 100%;
        max-width: 100%;
        padding: 0 10px;
    }

    .pricing-card {
        margin: 0 0.5rem;
    }

    .pricing-header {
        padding: 1.5rem 1rem 1rem;
    }

    .pricing-title {
        font-size: 1.25rem;
    }

    .pricing-value {
        font-size: 2.5rem;
    }

    .pricing-body {
        padding: 1.5rem 1rem;
    }
}


/* Canvas glow animations */
@keyframes pulseGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 255, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(255, 255, 0, 1));
    }
}

/* Selection indicator - no bounding box */
.canvas-container {
    position: relative;
}

.canvas-container canvas {
    outline: none !important;
}

/* Remove all Fabric.js control artifacts */
.upper-canvas {
    outline: none !important;
    border: none !important;
}

.canvas-container .corner {
    display: none !important; /* Hide corner controls completely */
}

/* Smooth canvas transitions */
.canvas-container canvas {
    transition: filter 0.2s ease-out;
}

/* ✅ ADD at the end of the file */

/* Popup viewport constraints */
#ticket-popup {
    max-width: 90vw !important;
    max-height: 80vh !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    #ticket-popup {
        max-width: 95vw !important;
        max-height: 85vh !important;
        font-size: 14px !important;
    }
    
    #ticket-popup h3 {
        font-size: 16px !important;
    }
    
    #ticket-popup button {
        padding: 10px 15px !important;
        font-size: 14px !important;
    }
}


/* Prevent body scroll when popup is open on mobile */
@media (max-width: 768px) {
    body.popup-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    #seat-loading-notification {
        max-width: calc(100vw - 40px);
        padding: 16px 20px !important;
        font-size: 14px !important;
    }
}
/* ✅ ADD at the end of the file */

/* Notification positioning and animations */
#seat-loading-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    z-index: 10000;
    box-sizing: border-box;
}


/* Smooth fade animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

