/**
 * UNITEDSAMAJ Tickets — Modal and frontend styles.
 */

/* ─── Modal ─── */
.ust-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ust-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.ust-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 520px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.ust-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    z-index: 2;
}

.ust-modal-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.ust-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.ust-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.ust-modal-meta span {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.ust-modal-datetime {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ust-modal-meta-icon {
    width: 16px;
    height: 16px;
    color: #0066cc;
    opacity: 0.85;
    flex-shrink: 0;
}

.ust-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.ust-modal-close:hover {
    color: #333;
}

.ust-modal-body {
    padding: 20px;
}

body.ust-modal-open {
    overflow: hidden;
}

/* ─── Loading spinner ─── */
.ust-loading {
    text-align: center;
    padding: 40px 0;
}

.ust-loading .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #007cba;
    border-radius: 50%;
    margin: 0 auto 10px;
    animation: ust-spin 0.8s linear infinite;
}

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

/* ─── Ticket section on event page ─── */
.ust-ticket-section {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.ust-buy-ticket-btn:hover {
    opacity: 0.9;
}

/* ─── Form elements ─── */
.ust-ticket-form .us-form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.ust-ticket-form .us-form-control:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.15);
}

/* ─── Quantity buttons ─── */
.ust-qty-btn:hover {
    background: #f0f0f0 !important;
    border-color: #007cba !important;
    color: #007cba;
}

.ust-qty-btn:active {
    background: #e0e0e0 !important;
}

/* ─── Payment options ─── */
.ust-payment-option:hover {
    border-color: #007cba !important;
}

/* ─── Sticky price bar (step 1) ─── */
.ust-sticky-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e0e8f0;
    box-shadow: 0 -2px 12px rgba(0, 124, 186, 0.08);
    border-radius: 0 0 12px 12px;
    z-index: 10;
    margin: 12px -20px -20px;
    padding: 0;
    overflow: hidden;
}

.ust-sticky-bar-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
}

.ust-sticky-bar-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.ust-sticky-bar-toggle:hover {
    background: #f0f7fc;
}

.ust-sticky-bar-toggle:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

.ust-sticky-ticket-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.ust-sticky-label {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.ust-sticky-collapse-icon {
    width: 18px;
    height: 18px;
    color: #007cba;
    margin-left: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ust-sticky-collapse-icon--open {
    transform: rotate(180deg);
}

.ust-sticky-total {
    font-weight: 700;
    font-size: 16px;
    color: #007cba;
    white-space: nowrap;
    margin: 0 8px;
}

.ust-sticky-continue-btn {
    padding: 8px 16px !important;
    min-width: 100px;
    font-size: 13px !important;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 6px !important;
    flex-shrink: 0;
}

.ust-sticky-breakdown {
    background: #f7f9fc;
    border-top: 1px solid #e0e8f0;
    padding: 10px 16px;
    font-size: 13px;
}

.ust-sticky-items {
    margin-bottom: 4px;
}

.ust-sticky-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
    color: #555;
}

.ust-sticky-breakdown-total {
    border-top: 1px solid #dde3ec;
    margin-top: 6px;
    padding-top: 8px;
    font-size: 14px;
    color: #222;
}

/* ─── Checkout order summary (step 2) ─── */
.ust-checkout-summary {
    background: #f7f9fc;
    border: 1px solid #d8e4f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 15px;
}

.ust-checkout-summary-header {
    font-weight: 700;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid #e0e8f0;
}

.ust-checkout-summary-items {
    margin-bottom: 2px;
}

.ust-checkout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
    color: #555;
}

.ust-checkout-fee-row {
    font-size: 12px;
    color: #888;
}

.ust-checkout-total-row {
    border-top: 1px solid #dde3ec;
    margin-top: 6px;
    padding-top: 8px;
    font-size: 15px;
    color: #111;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .ust-modal-header h3 {
        font-size: 21px;
    }

    .ust-modal-meta span {
        font-size: 14px;
    }

    .ust-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }

    .ust-modal-header {
        border-radius: 0;
    }

    .ust-sticky-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        border-radius: 0;
        margin: 0;
        z-index: 100002;
    }

    .ust-modal-body {
        padding-bottom: 86px;
    }

    .ust-step h4 {
        font-size: 20px !important;
        line-height: 1.3;
    }

    .ust-step h5 {
        font-size: 17px !important;
        line-height: 1.35;
    }

    .ust-ticket-type-row {
        font-size: 16px;
    }

    .ust-ticket-type-row div[style*="font-weight:600"] {
        font-size: 17px;
    }

    .ust-ticket-type-row div[style*="font-size:12px"] {
        font-size: 14px !important;
    }

    .ust-ticket-type-row div[style*="font-size:14px"] {
        font-size: 16px !important;
    }

    .ust-ticket-form label {
        font-size: 15px !important;
        line-height: 1.4;
    }

    .ust-ticket-form .us-form-control {
        font-size: 16px;
        padding: 11px 12px;
    }

    .ust-ticket-form select.us-form-control {
        min-height: 46px;
        height: 46px;
        line-height: 1.35;
        padding-top: 10px;
        padding-bottom: 10px;
        padding-right: 34px;
        box-sizing: border-box;
    }

    .ust-step button,
    .ust-step .us-btn {
        font-size: 16px !important;
    }

    .ust-qty-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }

    .ust-ticket-qty {
        font-size: 17px !important;
    }

    .ust-sticky-bar-summary {
        gap: 8px;
        padding: 8px 12px;
    }

    .ust-sticky-label {
        display: none;
    }

    .ust-sticky-total {
        margin: 0 4px;
        font-size: 17px;
    }

    .ust-sticky-continue-btn {
        padding: 8px 12px !important;
        min-width: 70px;
        font-size: 14px !important;
    }

    .ust-sticky-breakdown {
        padding: 8px 12px;
        font-size: 14px;
    }

    .ust-sticky-ticket-badge {
        min-width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .ust-sticky-breakdown-row {
        font-size: 14px;
    }

    .ust-checkout-summary-header {
        font-size: 13px;
    }

    .ust-checkout-row {
        font-size: 14px;
    }

    .ust-checkout-total-row {
        font-size: 16px;
    }

    .ust-ticket-type-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .ust-ticket-type-row > div:last-child {
        align-self: flex-end;
    }
}
