/* NSU Events – Frontend Styles
   ─────────────────────────────────────────────────────────────── */

/* ── Events Grid ──────────────────────────────────────────── */

.nsu-events-grid {
    display: grid;
    grid-template-columns: repeat(var(--nsu-grid-cols, 3), 1fr);
    gap: 1.75rem;
    margin: 2rem 0;
}

.nsu-events-grid__card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 5px 5px 12px rgba(0, 0, 0, .04), -5px -5px 12px rgba(255, 255, 255, .85);
    transition: transform .25s ease, box-shadow .25s ease;
}

.nsu-events-grid__card:hover {
    transform: translateY(-4px);
    box-shadow: 8px 8px 24px rgba(0, 0, 0, .07), -4px -4px 12px rgba(255, 255, 255, .9);
}

/* Image */
.nsu-events-grid__thumb-wrap {
    display: block;
    text-decoration: none;
}

.nsu-events-grid__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nsu-events-grid__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.nsu-events-grid__card:hover .nsu-events-grid__thumb img {
    transform: scale(1.03);
}

.nsu-events-grid__thumb--placeholder .dashicons {
    font-size: 3rem;
    width: 3rem;
    height: 3rem;
    color: #c7c7d6;
}

/* Body */
.nsu-events-grid__body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.nsu-events-grid__date {
    display: inline-block;
    padding: .3rem .7rem;
    margin-bottom: .6rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6366f1;
    background: #eef2ff;
    border-radius: 6px;
}

.nsu-events-grid__title {
    margin: 0 0 .5rem;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
}

.nsu-events-grid__title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color .15s ease;
}

.nsu-events-grid__title a:hover {
    color: #6366f1;
}

/* Ticket info row */
.nsu-events-grid__ticket-info {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .75rem;
    font-size: .85rem;
}

.nsu-events-grid__price {
    font-weight: 700;
    color: #6366f1;
}

.nsu-events-grid__soldout {
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    background: #dc2626;
    padding: .15rem .5rem;
    border-radius: 4px;
}

.nsu-events-grid__lowstock {
    font-size: .75rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    padding: .15rem .5rem;
    border-radius: 4px;
}

.nsu-events-grid__link {
    display: inline-block;
    font-size: .85rem;
    font-weight: 600;
    color: #6366f1;
    text-decoration: none;
    transition: color .15s ease;
}

.nsu-events-grid__link:hover {
    color: #4338ca;
    text-decoration: underline;
}

.nsu-events-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
    font-size: .95rem;
}

/* ── Single Event: Details (Redesign) ───────────────────────── */
.nsu-event-details {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.nsu-event-details__heading {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.nsu-event-compact-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.nsu-event-compact-info__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nsu-event-compact-info__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 8px;
    flex-shrink: 0;
}

.nsu-event-compact-info__icon svg {
    width: 16px;
    height: 16px;
}

.nsu-event-compact-info__text {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.4;
}

.nsu-event-compact-info__text strong {
    font-weight: 600;
    color: #0f172a;
}

.nsu-event-compact-info__divider {
    margin: 0 0.5rem;
    color: #cbd5e1;
}

/* ── Single Event: Ticket Types ───────────────────────────── */

.nsu-event-ticket-types {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nsu-event-ticket-type {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.nsu-event-ticket-type__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: nowrap;
    gap: 0.75rem;
}

.nsu-event-ticket-type__info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nsu-event-ticket-type__label {
    font-weight: 700;
    color: #0f172a;
    font-size: 1.05rem;
}

.nsu-event-ticket-type__price {
    color: #4f46e5;
    font-weight: 700;
    font-size: 0.95rem;
    background: #e0e7ff;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.nsu-event-ticket-type__controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sold-out / low-stock notices */
.nsu-event-soldout-notice {
    margin-top: 1.25rem;
    padding: 1rem;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 8px;
    border: 1px solid #fecaca;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

.nsu-event-low-stock-notice {
    margin-top: 1.25rem;
    padding: 1rem;
    background: #fffbeb;
    color: #b45309;
    border-radius: 8px;
    border: 1px solid #fde68a;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

/* ── Buy Button & Action Area ─────────────────────────────── */

.nsu-event-ticket-action {
    padding: 1rem;
    background: #f8fafc;
}

.nsu-event-checkout-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
}

.nsu-event-qty-input {
    width: 60px;
    height: 36px;
    padding: 0 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.nsu-event-qty-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.nsu-event-ticket-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 1.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nsu-event-ticket-btn--buy {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nsu-event-ticket-btn--buy:hover {
    background: #4338ca;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
}

.nsu-event-ticket-btn--buy.nsu-event-ticket-btn--loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
    color: transparent;
}
.nsu-event-ticket-btn--buy.nsu-event-ticket-btn--loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nsu-spin 0.8s linear infinite;
}

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

.nsu-event-ticket-btn--soldout {
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

/* ── Attendee Forms ───────────────────────────────────────── */

.nsu-attendee-fields-container {
    margin-bottom: 1rem;
}

.nsu-attendee-fieldset {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.nsu-attendee-fieldset__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.nsu-attendee-fieldset__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 50%;
}

.nsu-attendee-fieldset__avatar svg {
    width: 16px;
    height: 16px;
}

.nsu-attendee-fieldset__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.nsu-form-row {
    margin-bottom: 0.5rem;
}

.nsu-form-row--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.nsu-form-group {
    display: flex;
    flex-direction: column;
}

.nsu-label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.nsu-required-mark {
    color: #ef4444;
}

.nsu-input {
    width: 100%;
    height: 36px;
    padding: 0 0.75rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #0f172a;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.nsu-input:focus {
    background: #ffffff;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.nsu-input--error {
    border-color: #ef4444 !important;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* ── Toast Notification ───────────────────────────────────── */
.nsu-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.nsu-toast--visible {
    transform: translateY(0);
    opacity: 1;
}

.nsu-toast__icon {
    font-size: 1.4rem;
}

.nsu-toast__msg {
    font-weight: 500;
}

.nsu-toast__link {
    color: #818cf8;
    font-weight: 700;
    text-decoration: none;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.2);
}

.nsu-toast__link:hover {
    color: #a5b4fc;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .nsu-events-grid {
        --nsu-grid-cols: 2 !important;
    }
}

@media (max-width: 600px) {
    .nsu-events-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .nsu-event-details {
        padding: 0.75rem;
    }
    
    .nsu-form-row--grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .nsu-event-ticket-type__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .nsu-event-checkout-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nsu-event-ticket-btn {
        width: 100%;
    }

    .nsu-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        flex-wrap: wrap;
    }
    
    .nsu-toast__link {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
    }
}

/* Event Top Section styling */
.nsu-event-top-section {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.nsu-event-featured-image-wrapper {
    flex: 0 0 250px;
    max-width: 250px;
}

.nsu-event-post-content {
    flex: 1;
    min-width: 250px;
}

.nsu-event-featured-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    object-fit: cover;
}
