/**
 * NEF Event Tickets Block Styling - REVISED
 * High specificity to override The Events Calendar defaults
 *
 * File: nef-platform-core/public/css/event-tickets.css
 */

/* ============================================================================
   WRAPPER - Add Card Style
   ========================================================================= */

.tribe-common.event-tickets.tribe-tickets__tickets-wrapper {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin: 0;
}

/* ============================================================================
   TITLE
   ========================================================================= */

.tribe-tickets__tickets-wrapper .tribe-tickets__tickets-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin: 0 0 20px !important;
    padding: 0 !important;
    letter-spacing: -0.01em !important;
    text-transform: none !important;
}

/* ============================================================================
   CART NOTICE
   ========================================================================= */

.tribe-tickets__tickets-wrapper .tribe-tickets__notice--barred {
    display: none !important;
    background: #f0f9ff !important;
    border: 1px solid #bfdbfe !important;
    border-left: 4px solid #3b82f6 !important;
    padding: 12px 16px !important;
    border-radius: 6px !important;
    margin-bottom: 20px !important;
}

.tribe-tickets__notice--barred .tribe-tickets-notice__content {
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #1e40af !important;
    margin: 0 !important;
}

/* ============================================================================
   TICKET ITEMS - Card Style
   ========================================================================= */

.tribe-tickets__tickets-wrapper .tribe-tickets__tickets-item {
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 16px !important;
    transition: all 0.2s ease !important;
}

.tribe-tickets__tickets-wrapper .tribe-tickets__tickets-item:last-of-type {
    margin-bottom: 20px !important;
}

.tribe-tickets__tickets-wrapper .tribe-tickets__tickets-item:hover {
    border-color: #d1d5db !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

/* ============================================================================
   TICKET TITLE
   ========================================================================= */

.tribe-tickets__tickets-item .tribe-tickets__tickets-item-content-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin: 0 0 8px !important;
    text-transform: capitalize !important;
}

/* ============================================================================
   TICKET DESCRIPTION
   ========================================================================= */

.tribe-tickets__tickets-item .tribe-tickets__tickets-item-details-content {
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: #6b7280 !important;
    margin: 0 0 16px !important;
}

/* ============================================================================
   PRICE & AVAILABILITY ROW
   ========================================================================= */

.tribe-tickets__tickets-item .tribe-tickets__tickets-item-extra {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 16px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* Price */
.tribe-tickets__tickets-item .tribe-tickets__tickets-item-extra-price {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 !important;
}

.tribe-tickets__tickets-item-extra-price .tribe-currency-symbol {
    font-size: 16px !important;
    font-weight: 600 !important;
}

.tribe-tickets__tickets-item-extra-price .tribe-amount {
    font-size: 20px !important;
}

/* Availability Badge */
.tribe-tickets__tickets-item .tribe-tickets__tickets-item-extra-available {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #059669 !important;
    background: #d1fae5 !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    margin: 0 !important;
}

/* ============================================================================
   QUANTITY SELECTOR - Inline Style
   ========================================================================= */

.tribe-tickets__tickets-item .tribe-tickets__tickets-item-quantity {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    margin: 0 !important;
}

/* Remove/Add Buttons */
.tribe-tickets__tickets-item-quantity .tribe-tickets__tickets-item-quantity-remove,
.tribe-tickets__tickets-item-quantity .tribe-tickets__tickets-item-quantity-add {
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #fff !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.tribe-tickets__tickets-item-quantity-remove {
    border-radius: 6px 0 0 6px !important;
    border-right: none !important;
}

.tribe-tickets__tickets-item-quantity-add {
    border-radius: 0 6px 6px 0 !important;
    border-left: none !important;
}

.tribe-tickets__tickets-item-quantity-remove:hover,
.tribe-tickets__tickets-item-quantity-add:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

/* Number Input */
.tribe-tickets__tickets-item-quantity .tribe-tickets__tickets-item-quantity-number {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

.tribe-tickets__tickets-item-quantity-number .tribe-tickets__tickets-item-quantity-number-input {
    width: 60px !important;
    height: 36px !important;
    text-align: center !important;
    border: 1px solid #d1d5db !important;
    border-left: none !important;
    border-right: none !important;
    background: #fff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #111827 !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-appearance: none !important;
    -moz-appearance: textfield !important;
    border-radius: 0 !important;
}

.tribe-tickets__tickets-item-quantity-number-input::-webkit-inner-spin-button,
.tribe-tickets__tickets-item-quantity-number-input::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

.tribe-tickets__tickets-item-quantity-number-input:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    border-left: none !important;
    border-right: none !important;
}

/* ============================================================================
   FOOTER - Quantity Summary + Total + Button (STACKED LAYOUT)
   ========================================================================= */

.tribe-tickets__tickets-wrapper .tribe-tickets__tickets-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
    padding: 20px !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    margin-top: 0 !important;
}

/* Top Row: Quantity + Total */
.tribe-tickets__tickets-footer-quantity,
.tribe-tickets__tickets-footer-total {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
}

/* Quantity Summary */
.tribe-tickets__tickets-footer .tribe-tickets__tickets-footer-quantity {
    font-size: 14px !important;
    color: #6b7280 !important;
    margin: 0 !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.tribe-tickets__tickets-footer-quantity .tribe-tickets__tickets-footer-quantity-label {
    font-weight: 500 !important;
}

.tribe-tickets__tickets-footer-quantity .tribe-tickets__tickets-footer-quantity-number {
    font-weight: 700 !important;
    color: #111827 !important;
    font-size: 16px !important;
}

/* Total */
.tribe-tickets__tickets-footer .tribe-tickets__tickets-footer-total {
    font-size: 14px !important;
    margin: 0 !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.tribe-tickets__tickets-footer-total .tribe-tickets__tickets-footer-total-label {
    font-weight: 500 !important;
    color: #6b7280 !important;
}

.tribe-tickets__tickets-footer-total .tribe-tickets__tickets-footer-total-wrap {
    font-weight: 700 !important;
    color: #111827 !important;
    font-size: 18px !important;
}

.tribe-tickets__tickets-footer-total-wrap .tribe-currency-symbol {
    font-size: 16px !important;
}

.tribe-tickets__tickets-footer-total-wrap .tribe-amount {
    font-size: 18px !important;
}

/* Get Tickets Button - Full Width */
.tribe-tickets__tickets-footer .tribe-tickets__tickets-buy {
    width: 100% !important;
    background: #111827 !important;
    color: #fff !important;
    border: none !important;
    padding: 14px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.4 !important;
    margin-top: 8px !important;
}

.tribe-tickets__tickets-buy:hover:not(:disabled) {
    background: #1f2937 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.tribe-tickets__tickets-buy:disabled {
    background: #d1d5db !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================= */

@media (max-width: 768px) {
    .tribe-tickets__tickets-wrapper {
        padding: 20px !important;
    }

    .tribe-tickets__tickets-item {
        padding: 16px !important;
    }

    .tribe-tickets__tickets-item .tribe-tickets__tickets-item-extra {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .tribe-tickets__tickets-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .tribe-tickets__tickets-footer-quantity,
    .tribe-tickets__tickets-footer-total {
        justify-content: space-between !important;
        width: 100% !important;
    }

    .tribe-tickets__tickets-buy {
        width: 100% !important;
        padding: 14px 24px !important;
    }
}

@media (max-width: 480px) {
    .tribe-tickets__tickets-wrapper {
        padding: 16px !important;
    }

    .tribe-tickets__tickets-title {
        font-size: 16px !important;
    }

    .tribe-tickets__tickets-item-content-title {
        font-size: 15px !important;
    }

    .tribe-tickets__tickets-item-extra-price {
        font-size: 18px !important;
    }

    .tribe-tickets__tickets-item-quantity-number-input {
        width: 50px !important;
    }
}

/* ============================================================================
   UTILITY - Hide Elements
   ========================================================================= */

.screen-reader-text,
.tribe-common-a11y-visual-hide {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    width: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.tribe-common-a11y-hidden {
    display: none !important;
}

/* ============================================================================
   HIDE TEC MODAL - Using Custom Checkout Flow
   ========================================================================= */

/* Hide only the modal dialog/overlay - NOT the ticket selector on event page */
.tribe-dialog,
.tribe-modal,
.tribe-dialog__overlay,
.tribe-modal__overlay,
.tribe-dialog__wrapper,
.tribe-modal__wrapper,
#tribe-tickets__modal-form {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Ensure ticket selector on event page is visible */
.tribe-tickets__tickets-wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================================================
   CHECKOUT / ATTENDEE REGISTRATION FORM
   ========================================================================= */

/* Ensure body can scroll when checkout loads */
body.single-tribe_events {
    overflow-y: auto !important;
    max-height: none !important;
    height: auto !important;
}

/* Ensure parent containers don't restrict overflow */
.single-tribe_events .elementor,
.single-tribe_events .elementor-section,
.single-tribe_events .elementor-container,
.single-tribe_events .elementor-widget-wrap {
    overflow: visible !important;
    max-height: none !important;
}

/* Ensure wrapper can expand to show checkout form */
.tribe-common.event-tickets.tribe-tickets__tickets-wrapper {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    min-height: auto !important;
}

/* Attendee Registration / Checkout Section */
.tribe-tickets__tickets-wrapper .tribe-tickets__registration,
.tribe-tickets__tickets-wrapper .tribe-tickets__attendee-tickets,
.tribe-tickets__tickets-wrapper .tribe-tickets__commerce-checkout {
    display: block !important;
    margin-top: 24px !important;
    padding: 24px !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    overflow: visible !important;
}

/* Form Fields */
.tribe-tickets__registration .tribe-tickets__item,
.tribe-tickets__attendee-tickets .tribe-ticket {
    margin-bottom: 20px !important;
    padding: 20px !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
}

/* Form Labels */
.tribe-tickets__registration label,
.tribe-tickets__attendee-tickets label {
    display: block !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 6px !important;
}

/* Form Inputs */
.tribe-tickets__registration input[type="text"],
.tribe-tickets__registration input[type="email"],
.tribe-tickets__registration input[type="tel"],
.tribe-tickets__registration select,
.tribe-tickets__registration textarea,
.tribe-tickets__attendee-tickets input[type="text"],
.tribe-tickets__attendee-tickets input[type="email"],
.tribe-tickets__attendee-tickets input[type="tel"],
.tribe-tickets__attendee-tickets select,
.tribe-tickets__attendee-tickets textarea {
    width: 100% !important;
    padding: 10px 14px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    color: #111827 !important;
    background: #fff !important;
    transition: all 0.2s ease !important;
}

.tribe-tickets__registration input:focus,
.tribe-tickets__registration select:focus,
.tribe-tickets__registration textarea:focus,
.tribe-tickets__attendee-tickets input:focus,
.tribe-tickets__attendee-tickets select:focus,
.tribe-tickets__attendee-tickets textarea:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Submit Button in Checkout */
.tribe-tickets__registration .tribe-tickets__registration-checkout-button,
.tribe-tickets__commerce-checkout .tribe-tickets__commerce-checkout-button {
    width: 100% !important;
    background: #111827 !important;
    color: #fff !important;
    border: none !important;
    padding: 14px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-top: 20px !important;
}

.tribe-tickets__registration-checkout-button:hover,
.tribe-tickets__commerce-checkout-button:hover {
    background: #1f2937 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}
