/* ==========================================================================
   DPA Webinar — Frontend Styles
   ========================================================================== */

/* Wrapper */
.dpa-webinar-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ---- Archive ---- */
.dpa-webinar-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.dpa-webinar-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.dpa-webinar-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.dpa-webinar-card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.dpa-webinar-card__body {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.dpa-webinar-card__title {
    font-size: 1.1rem;
    margin: 0 0 .6rem;
}
.dpa-webinar-card__date,
.dpa-webinar-card__price,
.dpa-webinar-card__seats {
    font-size: .9rem;
    color: #555;
    margin: .2rem 0;
}
.dpa-webinar-card__excerpt {
    flex: 1;
    font-size: .9rem;
    color: #444;
    margin: .6rem 0 1rem;
}
.dpa-webinar-card__cta {
    align-self: flex-start;
}
.dpa-webinar-none {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* ---- Single Webinar — page width ---- */
/* Widen only the single-webinar page to accommodate the two-column layout. */
#dpa-webinar-single {
    max-width: 1200px;
}

/* ---- Two-column layout ---- */
.dpa-webinar-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2.5rem;
    align-items: start; /* required: allows sticky to work inside a grid */
}

/* Left: description */
.dpa-webinar-main {
    min-width: 0; /* prevent grid blowout on long content */
}

/* Right: sticky seat-selection panel */
.dpa-webinar-sidebar {
    min-width: 0;
}

.dpa-webinar-sidebar__inner {
    position: sticky;
    /* Respect the WP admin bar height (CSS var set by WordPress core). */
    top: calc(var(--wp-admin--admin-bar--height, 0px) + 1.5rem);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .07);
}

/* Remove extra top margin from the seat section when it's inside the sidebar */
.dpa-webinar-sidebar__inner .dpa-seat-map-section {
    margin-top: 0;
}

/* ---- Responsive: stack below 768 px ---- */
@media ( max-width: 768px ) {
    .dpa-webinar-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .dpa-webinar-sidebar__inner {
        position: static;
        box-shadow: none;
    }
}

/* ---- Single Webinar ---- */
.dpa-webinar-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.dpa-webinar-header__meta {
    flex: 1;
    min-width: 0;
}
.dpa-webinar-header__thumbnail {
    flex-shrink: 0;
    width: 240px;
}
.dpa-webinar-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.dpa-webinar-title {
    margin-bottom: .4rem;
}
.dpa-webinar-date,
.dpa-webinar-price {
    margin: .25rem 0;
    font-size: .95rem;
}
.dpa-webinar-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: .8rem 1.2rem;
    margin: 1rem 0;
    color: #856404;
}

/* ---- Seat Map ---- */
.dpa-seat-map-section {
    margin-top: 2rem;
}
.dpa-seat-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
    font-size: .85rem;
    align-items: center;
}
/* Legend items share seat colours but must not use the fixed 40×40 square size. */
.dpa-seat-legend .dpa-seat {
    width: auto;
    height: auto;
    padding: 4px 10px;
    white-space: nowrap;
    transform: none !important;
}
.dpa-seat-map {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    min-height: 80px;
}
/* Seats inside the map stretch to fill their grid cell for equal spacing on all edges. */
.dpa-seat-map .dpa-seat {
    width: 100%;
}
.dpa-seat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .1s, box-shadow .1s;
    user-select: none;
    overflow: hidden;
    white-space: nowrap;
}
.dpa-seat--available {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
    cursor: pointer;
}
.dpa-seat--available:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.dpa-seat--selected {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
    transform: scale(1.1);
}
.dpa-seat--held {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
    cursor: not-allowed;
}
.dpa-seat--booked {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
    cursor: not-allowed;
}
.dpa-seat-map__loading {
    color: #999;
    font-style: italic;
    width: 100%;
    text-align: center;
    padding: 1.5rem 0;
}

/* ---- Reservation Timer ---- */
.dpa-reservation-timer {
    margin: 1rem 0;
    padding: .8rem 1.2rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    color: #1e40af;
    font-size: .95rem;
}
.dpa-reservation-timer strong {
    font-size: 1.1rem;
    font-variant-numeric: tabular-nums;
}

/* ---- Pick for Me ---- */
.dpa-pick-for-me {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}
.dpa-pick-qty {
    width: 160px;
    padding: .45rem .65rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: .9rem;
    line-height: 1.4;
}
.dpa-pick-btn {
    padding: .45rem 1.1rem;
    font-size: .9rem;
    white-space: nowrap;
}
.dpa-pick-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ---- Add-to-Cart Form ---- */
.dpa-add-to-cart-form {
    margin-top: .75rem;
    margin-bottom: 1rem;
    padding: 1.2rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
}
.dpa-selected-summary {
    font-size: .95rem;
    margin-bottom: .8rem;
    color: #166534;
}
.dpa-checkout-btn {
    font-size: 1rem;
    padding: .6rem 1.5rem;
}

