/* =========================================
   Easypass Plugin Overrides (Theme Controlled)
   Replaces plugin frontend.css visual styles
   No important flags allowed here — specificity wins
   ========================================= */

/* =========================================
   1. EVENT TICKETS CONTAINER
   ========================================= */
.ep-event-tickets {
    max-width: 800px;
    margin: 0 auto 2.5rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    color: var(--ep-text-main);
    box-shadow: none;
    border: none;
    font-family: var(--ep-font-family);
    width: 100%;
}

/* =========================================
   2. TICKETS GRID & CARDS
   ========================================= */
.ep-tickets-grid {
    display: flex;
    flex-direction: column;
    gap: var(--ep-space-3);
}

.ep-ticket-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--ep-space-4);
    padding: var(--ep-space-4);
    border-radius: var(--ep-radius-md);
    background: var(--ep-bg-card);
    border: 1px solid var(--ep-border-color);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ep-ticket-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--ep-brand);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ep-ticket-card:hover {
    border-color: var(--ep-brand);
    transform: translateY(-1px);
    box-shadow: var(--ep-shadow-md);
}

.ep-ticket-card:hover::before {
    opacity: 1;
}

.ep-ticket-card.ep-sold-out {
    opacity: 0.55;
    background: var(--ep-bg-input);
    border-style: dashed;
    pointer-events: none;
}

.ep-ticket-card.ep-sold-out::before {
    background: var(--ep-error);
    opacity: 0.5;
}

/* Ticket Info */
.ep-ticket-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ep-ticket-name {
    margin: 0;
    font-weight: 700;
    color: var(--ep-text-main);
    font-size: var(--ep-text-base);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: var(--ep-space-2);
    flex-wrap: wrap;
}

.ep-ticket-price {
    margin: 0;
    font-size: var(--ep-text-lg);
    color: var(--ep-brand);
    font-weight: 800;
    line-height: 1.2;
}

.ep-ticket-price del {
    color: var(--ep-text-muted);
    font-weight: 500;
    font-size: var(--ep-text-sm);
    margin-right: var(--ep-space-2);
}

.ep-ticket-price ins {
    text-decoration: none;
}

.ep-ticket-description {
    font-size: var(--ep-text-sm);
    color: var(--ep-text-muted);
    margin: 2px 0 0 0;
    line-height: 1.45;
}

.ep-ticket-description p {
    margin: 0;
}

/* Badges */
.ep-stock-badge-container {
    display: inline-flex;
    align-items: center;
    gap: var(--ep-space-1);
}

.ep-badge-soldout,
.ep-badge-lowstock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 2px 8px;
    border-radius: var(--ep-radius-sm);
    font-size: var(--ep-text-xs);
    line-height: 1.4;
    white-space: nowrap;
}

.ep-badge-soldout {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.ep-badge-lowstock {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Actions & Quantity */
.ep-ticket-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--ep-space-2);
    min-width: 0;
}

.ep-ticket-unavailable-msg {
    font-size: var(--ep-text-xs);
    color: var(--ep-error);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Quantity Control */
.ep-ticket-qty-control {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-radius: var(--ep-radius-md);
    padding: 3px;
    background: var(--ep-bg-input);
    border: 1px solid var(--ep-border-color);
    min-width: 110px;
    justify-content: space-between;
}

.ep-qty-btn {
    border: none;
    background: var(--ep-bg-surface);
    width: 32px;
    height: 32px;
    border-radius: var(--ep-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: var(--ep-text-lg);
    line-height: 1;
    color: var(--ep-text-main);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.ep-qty-btn:hover {
    background: var(--ep-brand);
    color: #ffffff;
    border-color: var(--ep-brand);
}

.ep-qty-btn:active {
    transform: scale(0.95);
}

.ep-ticket-qty-control input[type="number"] {
    width: 42px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--ep-text-main);
    font-size: var(--ep-text-base);
    font-weight: 700;
    -moz-appearance: textfield;
    padding: 0;
    margin: 0;
}

.ep-ticket-qty-control input[type="number"]::-webkit-outer-spin-button,
.ep-ticket-qty-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Submit Button — hidden visually but kept in DOM so the sticky footer button can trigger it */
.ep-submit-wrapper {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ep-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--ep-space-2);
    width: 100%;
    padding: var(--ep-space-3) var(--ep-space-5);
    border-radius: var(--ep-radius-md);
    font-weight: 700;
    font-size: var(--ep-text-base);
    border: none;
    background: linear-gradient(135deg, var(--ep-brand), var(--ep-brand-glow));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.ep-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

.ep-submit:disabled,
.ep-submit--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    background: var(--ep-bg-surface);
    color: var(--ep-text-muted);
    transform: none;
    filter: none;
}

/* =========================================
   3. CATALOG GRID (Home)
   ========================================= */
.ep-events-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.ep-catalog-card {
    background: var(--ep-bg-card);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--ep-text-main);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--ep-border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.ep-catalog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    border-color: var(--ep-brand);
}

.ep-card-image {
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #1f2937;
}

.ep-card-date-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 8px 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.ep-card-date-badge .ep-day {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
}

.ep-card-date-badge .ep-month {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ep-brand);
    margin-top: 2px;
}

.ep-card-details {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ep-card-title {
    font-size: 1.4rem;
    margin: 0 0 12px 0;
    color: var(--ep-text-main);
    font-weight: 700;
    line-height: 1.3;
}

.ep-card-loc,
.ep-card-time {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    color: var(--ep-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ep-card-btn {
    margin-top: auto;
    display: inline-block;
    padding-top: 20px;
    color: var(--ep-brand);
    font-weight: 600;
    font-size: 0.95rem;
}

/* =========================================
   4. META ITEMS (Single Event Hero)
   ========================================= */
.ep-meta-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #fff;
}

/* =========================================
   5. STICKY RESERVATION NOTICE
   ========================================= */
#ep-sticky-reservation-notice {
    position: sticky;
    top: 100px;
    z-index: 10000;
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px 0;
    pointer-events: none;
}

#ep-sticky-reservation-notice .woocommerce-info,
#ep-sticky-reservation-notice .woocommerce-notice {
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    background-color: #111;
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.9rem;
    pointer-events: auto;
    width: 100%;
    box-sizing: border-box;
}

#ep-sticky-reservation-notice .woocommerce-info::before {
    display: none;
}

#ep-checkout-timer-inline {
    font-variant-numeric: tabular-nums;
    margin-left: 5px;
    font-weight: 700;
    color: #4ade80;
}

/* =========================================
   6. CART TIMER (Sticky Footer)
   ========================================= */
#ep-cart-timer {
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 320px;
    max-width: 90%;
    border-radius: 50px;
    bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* =========================================
   7. SLOT SELECTOR (Date/Time Selection)
   ========================================= */
.ep-event-slots-selector {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--ep-border-color);
    border-radius: 20px;
}

.ep-event-slots-selector h4 {
    color: var(--ep-text-main);
    font-weight: 700;
    margin-top: 0;
}

.ep-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.ep-slot-card {
    position: relative;
    cursor: pointer;
}

/* Consolidated duplicate .ep-slot-inner base below; selected-state rules remain local. */

.ep-slot-card input:checked+.ep-slot-inner {
    border-color: #2563EB;
    background: rgba(37, 99, 235, 0.15);
    box-shadow: 0 0 0 1px #2563EB, 0 8px 16px -4px rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
    border-width: 1px;
}

.ep-slot-card input:checked+.ep-slot-inner div:first-child {
    color: #2563EB;
}

.ep-slot-card input:checked+.ep-slot-inner div:nth-child(2),
.ep-slot-card input:checked+.ep-slot-inner span {
    color: var(--ep-text-main);
}

.ep-slot-inner {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--ep-border-color);
    border-radius: 14px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s ease-out;
    position: relative;
}

[data-theme="light"] .ep-slot-inner {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ep-slot-card:hover .ep-slot-inner:not(.ep-slot-disabled) {
    border-color: var(--ep-brand);
    transform: translateY(-2px);
    background: rgba(37, 99, 235, 0.05);
}

.ep-slot-inner div:first-child {
    color: var(--ep-text-main);
    font-size: 1rem;
    font-weight: 700;
}

.ep-slot-inner div:nth-child(2) {
    color: var(--ep-text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.ep-slot-disabled .ep-slot-inner {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
    border-style: dashed;
}

/* =========================================
   8. SEATING MAP
   ========================================= */
#ep-seating-map-container {
    position: relative;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

#ep-map-canvas {
    position: relative;
    user-select: none;
    overflow: hidden;
}

#ep-map-tooltip {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #334155;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 99999;
}

/* =========================================
   9. SHORTCODE COMPONENTS
   ========================================= */

/* --- Cards / Wrappers --- */
.ep-card {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: var(--ep-bg-card);
    border-radius: var(--ep-radius-lg);
    border: 1px solid var(--ep-border-color);
    color: var(--ep-text-main);
}

.ep-card--narrow {
    max-width: 480px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* --- Alerts --- */
.ep-alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ep-alert--success {
    background: #dcfce7;
    color: #166534;
}

.ep-alert--error {
    background: #fee2e2;
    color: #b91c1c;
}

.ep-alert--info {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* --- Forms --- */
.ep-form-group {
    margin-bottom: 20px;
}

.ep-form-group--flex {
    display: flex;
    gap: 15px;
}

.ep-form-group--flex>div {
    flex: 1;
}

.ep-form-group__label {
    display: block;
    margin-bottom: 8px;
    color: #4b5563;
    font-weight: 500;
}

.ep-input,
.ep-form-group input[type="text"],
.ep-form-group input[type="email"],
.ep-form-group input[type="password"],
.ep-form-group input[type="number"],
.ep-form-group input[type="tel"],
.ep-form-group select,
.ep-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #1f2937;
    font-size: 1rem;
    box-sizing: border-box;
}

.ep-form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563EB;
}

.ep-form-group small {
    color: #6b7280;
    font-size: 0.85rem;
}

/* --- KYC Upload --- */
.ep-kyc-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
    position: relative;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ep-kyc-upload-box:hover {
    border-color: #2563EB;
    background: #eff6ff;
}

.ep-kyc-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    display: none;
    margin-top: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ep-kyc-label {
    pointer-events: none;
}

.ep-kyc-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.ep-camera-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #64748b;
}

/* --- Status Badges --- */
.ep-status-badge {
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
}

.ep-status-badge--active {
    background: #28a745;
}

.ep-status-badge--cancelled,
.ep-status-badge--void {
    background: #dc3545;
}

.ep-status-badge--used,
.ep-status-badge--checked-in {
    background: #6c757d;
}

/* --- My Tickets --- */
.ep-my-tickets-wrapper h2 {
    margin-bottom: 20px;
    color: var(--ep-text-main);
}

.ep-ticket-card--my {
    border: 1px solid var(--ep-border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--ep-bg-card);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.ep-ticket-card--my .ep-ticket-header {
    background: #0f172a;
    color: #fff;
    padding: 15px;
    text-align: center;
}

.ep-ticket-card--my .ep-ticket-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.ep-ticket-card--my .ep-ticket-header p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.ep-ticket-card--my .ep-ticket-body {
    padding: 20px;
    text-align: center;
}

.ep-ticket-card--my .ep-ticket-code {
    font-family: monospace;
    color: #666;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 4px;
    display: inline-block;
}

.ep-ticket-card--my .ep-ticket-void {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
}

/* --- Calculator --- */
.ep-calculator-section {
    background: transparent;
    padding: 0;
}

.ep-calc-box {
    margin: 0 auto;
}

.ep-calc-currency {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
}

.ep-result-value {
    color: var(--ep-brand);
}

.ep-result-note {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
}

/* --- Utilities --- */
.ep-honeypot {
    display: none;
    visibility: hidden;
}

.ep-text-center {
    text-align: center;
}

.ep-text-green {
    color: #166534;
}

.ep-text-orange {
    color: #d97706;
}

.ep-text-dark-red {
    color: #b91c1c;
}

.ep-text-muted-custom {
    color: #64748b;
}

.ep-rejection-box {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 15px;
    margin-bottom: 25px;
}

.ep-rejection-box h4 {
    margin: 0 0 5px;
    color: #b91c1c;
}

.ep-rejection-box p {
    margin: 0;
    color: #7f1d1d;
}

/* --- Password Strength --- */
#ep-pass-strength-container {
    margin-top: 8px;
}

#ep-pass-strength-bar {
    height: 4px;
    width: 100%;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

#ep-pass-strength-bar-inner {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

#ep-pass-strength-text {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6b7280;
}

/* --- Seating Map Dark Mode --- */
@media (prefers-color-scheme: dark) {
    #ep-seating-map-container {
        background: #0f172a;
        border-color: #1e293b;
    }

    #ep-map-canvas {
        background: #1e293b;
    }

    #ep-map-legend {
        background: #0f172a;
    }

    #ep-map-controls button {
        background: #1e293b;
        color: #f1f5f9;
        border-color: #334155;
    }

    .ep-ticket-card {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }

    .ep-ticket-name,
    .ep-ticket-price {
        color: #f1f5f9;
    }

    #ep-open-seating-map {
        background: #1e293b;
        color: #f1f5f9;
        border-color: #334155;
    }

    #ep-open-seating-map:hover {
        background: #334155;
    }

    #ep-seating-map-container div[style*="background:#f8fafc"] {
        background: #1e293b;
        border-bottom-color: #334155;
    }

    #ep-seating-map-container span[style*="font-weight:bold"] {
        color: #f1f5f9;
    }

    #ep-seating-map-container #ep-close-seating-map {
        color: #f1f5f9;
    }

    #ep-selected-seats-summary {
        background: #1e293b;
        border-color: #334155;
    }

    #ep-selected-seats-summary h4 {
        color: #f1f5f9;
    }

    .ep-summary-item {
        background: #0f172a;
        border-color: #1e293b;
        color: #f1f5f9;
    }
}

/* =========================================
   10. RESPONSIVE
   ========================================= */
@media (max-width: 600px) {
    .ep-ticket-card {
        grid-template-columns: 1fr;
        gap: var(--ep-space-3);
        padding: var(--ep-space-3);
        grid-auto-flow: column;
        margin: 0;
    }

    .ep-ticket-actions {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        margin-top: 0;
    }

    .ep-ticket-qty-control {
        width: auto;
        min-width: 120px;
    }

    .ep-ticket-qty-control input[type="number"] {
        width: 32px;
        font-size: var(--ep-text-lg);
    }

    .ep-ticket-name {
        font-size: var(--ep-text-base);
    }

    .ep-ticket-price {
        font-size: var(--ep-text-base);
    }

    .ep-ticket-description {
        font-size: var(--ep-text-xs);
    }

    .ep-submit {
        padding: var(--ep-space-3) var(--ep-space-4);
        font-size: var(--ep-text-sm);
    }

    #ep-sticky-reservation-notice {
        top: 88px;
    }

    #ep-sticky-reservation-notice .woocommerce-info {
        font-size: 0.75rem;
        padding: 8px 15px;
    }
}