/**
 * Events Feature — Frontend CSS
 * Styles for: date selector, event details card, dates list, gallery,
 * status badges, spots display, thank-you message
 */

/* ══════════════════════════════════════════
   DATE SELECTOR (on product page)
══════════════════════════════════════════ */

.ws-event-date-selector-wrap {
    margin: 20px 0 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f6fc 0%, #e8f4fd 100%);
    border: 2px solid #c4d9f0;
    border-radius: 12px;
    direction: rtl;
    text-align: right;
    width: 100%;
    flex: 1 1 100%;
    box-sizing: border-box;
}

/* Force standard WooCommerce Add to Cart form to wrap items (date on top, button on bottom) */
.woocommerce div.product form.cart,
.elementor-widget-woocommerce-product-add-to-cart form.cart {
    flex-wrap: wrap !important;
}

.ws-event-date-label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1a3c5e;
    margin-bottom: 10px;
}

.ws-event-date-label .ws-required {
    color: #d63638;
    margin-right: 4px;
}

.ws-event-date-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #c4d9f0;
    border-radius: 8px;
    background: #fff;
    color: #1d2327;
    cursor: pointer;
    direction: rtl;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%231a3c5e' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    transition: border-color .2s, box-shadow .2s;
}

.ws-event-date-select:focus {
    border-color: #1a3c5e;
    box-shadow: 0 0 0 3px rgba(26,60,94,.15);
    outline: none;
}

.ws-event-date-select:invalid,
.ws-event-date-select[value=""] {
    color: #999;
}

.ws-event-date-hint {
    font-size: 12px;
    color: #888;
    margin: 8px 0 0;
}

.ws-event-no-dates {
    padding: 16px 20px;
    background: #fce8e8;
    border: 1px solid #f5c0c0;
    border-radius: 8px;
    color: #8b0000;
    font-size: 14px;
    text-align: right;
    direction: rtl;
    margin: 16px 0;
}

/* Highlight date selector when "add to cart" is clicked without selection */
.ws-event-date-select.ws-error {
    border-color: #d63638;
    box-shadow: 0 0 0 3px rgba(214,54,56,.15);
    animation: ws-shake .4s ease;
}

@keyframes ws-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ══════════════════════════════════════════
   EVENT DETAILS CARD
══════════════════════════════════════════ */

.ws-event-details-card {
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.ws-event-details-section {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.ws-event-details-heading {
    font-size: 16px;
    font-weight: 700;
    color: #1a3c5e;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8ecf0;
}

.ws-event-details-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: center;
}

/* Mobile responsive for grids */
@media (max-width: 767px) {
    .ws-event-details-grid {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .ws-event-detail-item.ws-half-row {
        flex: 1 1 100%;
    }
}

.ws-event-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ws-event-detail-item.ws-full-row {
    flex: 1 0 100%;
}

.ws-event-detail-item.ws-half-row {
    flex: 1 0 calc(50% - 16px);
}

.ws-event-detail-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ws-event-detail-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.ws-event-detail-label {
    font-size: 14px;
    font-weight: 700;
    color: #1a3c5e;
}

.ws-event-detail-label::after {
    content: ":";
}

.ws-event-detail-value {
    font-size: 15px;
    color: #1d2327;
    line-height: 1.4;
}

.ws-event-price {
    font-size: 20px;
    font-weight: 700;
    color: #1a3c5e;
}

.ws-event-date-pill {
    display: inline-block;
    background: #e8f4fd;
    color: #004085;
    border: 1px solid #c4d9f0;
    border-radius: 50px;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 600;
    margin: 2px 4px 2px 0;
}

/* ══════════════════════════════════════════
   STATUS BADGES
══════════════════════════════════════════ */

.ws-event-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
}

.ws-badge-open   { background: #d7f0e0; color: #00692b; }
.ws-badge-full   { background: #fce8c8; color: #8a4500; }
.ws-badge-closed { background: #fce8e8; color: #8b0000; }

/* Spots display */
.ws-spots-zero       { color: #d63638; font-weight: 600; }
.ws-spots-few        { color: #dba617; font-weight: 600; }
.ws-spots-remaining  { color: #00a32a; }
.ws-date-passed      { color: #d63638; font-size: .85em; }

/* ══════════════════════════════════════════
   DATES LIST SHORTCODE
══════════════════════════════════════════ */

.ws-event-dates-list {
    list-style: none;
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
}

.ws-event-dates-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    color: #1d2327;
}

.ws-event-dates-list-item:last-child { border-bottom: none; }

.ws-event-dates-bullet { font-size: 18px; }

.ws-event-no-dates-public {
    color: #888;
    font-style: italic;
}

/* ══════════════════════════════════════════
   GALLERY
══════════════════════════════════════════ */

.ws-event-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin: 10px 0;
}

.ws-gallery-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transition: transform .2s, box-shadow .2s;
}

.ws-gallery-link:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

.ws-gallery-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

/* ══════════════════════════════════════════
   FIELD WRAPPERS
══════════════════════════════════════════ */

.ws-event-field {
    margin-bottom: 16px;
}

.ws-event-field__title {
    margin-bottom: 6px;
}

.ws-event-content {
    direction: rtl;
    text-align: right;
}

/* ══════════════════════════════════════════
   THANK-YOU PAGE
══════════════════════════════════════════ */

.ws-event-thankyou {
    background: linear-gradient(135deg, #1a3c5e 0%, #2563a8 100%);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    margin: 30px 0;
    color: #fff;
    direction: rtl;
}

.ws-event-thankyou-icon {
    font-size: 52px;
    margin-bottom: 12px;
    display: block;
}

.ws-event-thankyou-title {
    color: #fff;
    font-size: 26px;
    margin: 0 0 8px;
    font-weight: 700;
}

.ws-event-thankyou-sub {
    color: rgba(255,255,255,.85);
    font-size: 16px;
    margin: 0 0 24px;
}

.ws-event-thankyou-item {
    background: rgba(255,255,255,.12);
    border-radius: 10px;
    padding: 14px 20px;
    margin: 10px auto;
    max-width: 480px;
    text-align: center;
}

.ws-event-thankyou-date {
    font-size: 14px;
    color: rgba(255,255,255,.8);
    display: block;
    margin-top: 4px;
}

.ws-event-thankyou-link {
    display: inline-block;
    margin-top: 10px;
    background: #fff;
    color: #1a3c5e;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background .2s, transform .2s;
}

.ws-event-thankyou-link:hover {
    background: #e8f4fd;
    transform: translateY(-1px);
}
