/*
 * Nexus-One Events — Frontend CSS
 * Scope : catalogue, détail événement, formulaire achat, espace client billets
 *
 * Conventions :
 *   - Préfixe .nexus- sur toutes les classes (pas de collision thème)
 *   - BEM : .nexus-block__element--modifier
 *   - Variables CSS sur :root pour personnalisation thème
 *   - Mobile-first, breakpoint 768px
 *
 * @since 1.10.0
 */

/* ─── Variables ───────────────────────────────────────────────────────────── */
:root {
    --ne-blue:       #1e50a0;
    --ne-blue-light: #e8f0fb;
    --ne-blue-dark:  #163a78;
    --ne-text:       #2c2c2c;
    --ne-text-muted: #6b7280;
    --ne-border:     #d1d9e6;
    --ne-bg:         #f8fafc;
    --ne-white:      #ffffff;
    --ne-radius:     8px;
    --ne-radius-sm:  4px;
    --ne-shadow:     0 2px 8px rgba(0,0,0,.08);
    --ne-shadow-md:  0 4px 16px rgba(0,0,0,.12);
    --ne-transition: .18s ease;

    /* Statuts */
    --ne-ok:         #16a34a;
    --ne-ok-bg:      #f0fdf4;
    --ne-warn:       #d97706;
    --ne-warn-bg:    #fffbeb;
    --ne-danger:     #dc2626;
    --ne-danger-bg:  #fef2f2;
    --ne-info:       #0284c7;
    --ne-info-bg:    #f0f9ff;
    --ne-grey:       #6b7280;
    --ne-grey-bg:    #f3f4f6;
}

/* ─── Réinitialisation légère ────────────────────────────────────────────── */
.nexus-events-liste *,
.nexus-event-detail *,
.nexus-events-espace * {
    box-sizing: border-box;
}

/* ─── Utilitaires ─────────────────────────────────────────────────────────── */
.nexus-hint {
    display: block;
    font-size: .8rem;
    color: var(--ne-text-muted);
    margin-top: 4px;
}

/* ─── Notices ─────────────────────────────────────────────────────────────── */
.nexus-notice {
    padding: 12px 16px;
    border-radius: var(--ne-radius-sm);
    border-left: 4px solid currentColor;
    margin: 16px 0;
    font-size: .9rem;
    line-height: 1.5;
}

.nexus-notice--success {
    background: var(--ne-ok-bg);
    color: var(--ne-ok);
    border-color: var(--ne-ok);
}

.nexus-notice--warning {
    background: var(--ne-warn-bg);
    color: var(--ne-warn);
    border-color: var(--ne-warn);
}

.nexus-notice--error {
    background: var(--ne-danger-bg);
    color: var(--ne-danger);
    border-color: var(--ne-danger);
}

.nexus-notice--info {
    background: var(--ne-info-bg);
    color: var(--ne-info);
    border-color: var(--ne-info);
}

/* ─── Badges statut ───────────────────────────────────────────────────────── */
.nexus-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Statuts événement */
.nexus-badge--brouillon  { background: var(--ne-grey-bg);   color: var(--ne-grey); }
.nexus-badge--programme  { background: var(--ne-info-bg);   color: var(--ne-info); }
.nexus-badge--en_vente   { background: var(--ne-ok-bg);     color: var(--ne-ok); }
.nexus-badge--termine    { background: var(--ne-grey-bg);   color: var(--ne-grey); }
.nexus-badge--archive    { background: var(--ne-grey-bg);   color: var(--ne-grey); }

/* Statuts commande */
.nexus-badge--pending         { background: var(--ne-warn-bg);   color: var(--ne-warn); }
.nexus-badge--completed       { background: var(--ne-ok-bg);     color: var(--ne-ok); }
.nexus-badge--failed          { background: var(--ne-danger-bg); color: var(--ne-danger); }
.nexus-badge--offline_pending { background: var(--ne-info-bg);   color: var(--ne-info); }
.nexus-badge--refunded        { background: var(--ne-grey-bg);   color: var(--ne-grey); }

/* Statuts billet */
.nexus-badge--valide   { background: var(--ne-ok-bg);     color: var(--ne-ok); }
.nexus-badge--utilise  { background: var(--ne-grey-bg);   color: var(--ne-grey); }
.nexus-badge--annule   { background: var(--ne-danger-bg); color: var(--ne-danger); }

/* Statuts séance */
.nexus-badge--disponible { background: var(--ne-ok-bg);     color: var(--ne-ok); }
.nexus-badge--complet    { background: var(--ne-warn-bg);   color: var(--ne-warn); }

/* ─── Boutons ─────────────────────────────────────────────────────────────── */
.nexus-btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: var(--ne-radius-sm);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background var(--ne-transition), transform var(--ne-transition);
    line-height: 1.4;
}

.nexus-btn:focus-visible {
    outline: 3px solid var(--ne-blue);
    outline-offset: 2px;
}

.nexus-btn--primary {
    background: var(--ne-blue);
    color: var(--ne-white);
}

.nexus-btn--primary:hover {
    background: var(--ne-blue-dark);
    color: var(--ne-white);
    text-decoration: none;
}

.nexus-btn--secondary {
    background: var(--ne-white);
    color: var(--ne-blue);
    border: 1.5px solid var(--ne-blue);
}

.nexus-btn--secondary:hover {
    background: var(--ne-blue-light);
    color: var(--ne-blue);
    text-decoration: none;
}

.nexus-btn--large {
    padding: 13px 28px;
    font-size: 1rem;
    width: 100%;
    text-align: center;
}

.nexus-btn--sm {
    padding: 5px 12px;
    font-size: .8rem;
}

.nexus-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CATALOGUE — [nexus_events_liste]
═══════════════════════════════════════════════════════════════════════════ */

.nexus-events-liste {
    margin: 0 auto;
}

.nexus-events-empty {
    text-align: center;
    color: var(--ne-text-muted);
    padding: 40px 0;
    font-style: italic;
}

.nexus-events-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 540px) {
    .nexus-events-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .nexus-events-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Carte événement */
.nexus-event-card {
    background: var(--ne-white);
    border: 1px solid var(--ne-border);
    border-radius: var(--ne-radius);
    box-shadow: var(--ne-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow var(--ne-transition), transform var(--ne-transition);
}

.nexus-event-card:hover {
    box-shadow: var(--ne-shadow-md);
    transform: translateY(-2px);
}

.nexus-event-card__visuel img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.nexus-event-card__body {
    padding: 16px 18px;
    flex: 1;
}

.nexus-event-card__titre {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ne-text);
    margin: 0 0 10px;
    line-height: 1.3;
}

.nexus-event-card__date,
.nexus-event-card__lieu {
    font-size: .85rem;
    color: var(--ne-text-muted);
    margin: 4px 0;
}

.nexus-event-card__places {
    font-size: .82rem;
    color: var(--ne-ok);
    margin: 6px 0 0;
    font-weight: 500;
}

.nexus-event-card__places--alerte {
    color: var(--ne-danger);
    font-weight: 700;
}

.nexus-event-card__desc {
    font-size: .85rem;
    color: var(--ne-text-muted);
    margin: 10px 0 0;
    line-height: 1.5;
}

.nexus-event-card__footer {
    padding: 14px 18px;
    border-top: 1px solid var(--ne-border);
    background: var(--ne-bg);
}

/* Bandeau infos rapides */
.nexus-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 28px;
    padding: 14px 18px;
    background: var(--ne-blue-light);
    border-left: 4px solid var(--ne-blue);
    border-radius: var(--ne-radius-sm);
}
.nexus-detail-meta__item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .9rem;
    color: var(--ne-text);
}
.nexus-detail-meta__icon {
    font-size: 1rem;
}

/* Infos pratiques */
.nexus-detail-pratique {
    margin: 0 0 28px;
    padding: 22px 24px;
    background: var(--ne-bg);
    border: 1px solid var(--ne-border);
    border-radius: var(--ne-radius);
    margin-top: 40px;
}
.nexus-detail-pratique__titre {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ne-blue);
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ne-border);
}
.nexus-detail-pratique__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}
.nexus-detail-pratique__bloc h4 {
    font-size: .85rem;
    font-weight: 700;
    color: var(--ne-text);
    margin: 0 0 8px;
}


.nexus-detail-pratique__bloc p {
    font-size: .85rem;
    color: var(--ne-text-muted);
    margin: 0 0 4px;
    line-height: 1.5;
}
.nexus-link {
    font-size: .82rem;
    color: var(--ne-blue);
    text-decoration: none;
}
.nexus-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════════════
   DÉTAIL + FORMULAIRE D'ACHAT — [nexus_events_detail]
═══════════════════════════════════════════════════════════════════════════ */

.nexus-event-detail__visuel {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--ne-radius);
    margin-bottom: 20px;
}

.nexus-event-detail__titre {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ne-text);
    margin: 0 0 16px;
    line-height: 1.25;
}

.nexus-event-detail__description {
    line-height: 1.7;
    color: var(--ne-text);
    margin-bottom: 28px;
}

/* Formulaire checkout */
.nexus-checkout-form {
    background: var(--ne-white);
    border: 1px solid var(--ne-border);
    border-radius: var(--ne-radius);
    padding: 24px 28px;
    margin-top: 28px;
    box-shadow: var(--ne-shadow);
}

.nexus-checkout-form h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ne-blue);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ne-blue-light);
}

.nexus-checkout-form h4 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--ne-text);
    margin: 20px 0 12px;
}

/* Champs de formulaire */
.nexus-form-group {
    margin-bottom: 16px;
}

.nexus-form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--ne-text);
    margin-bottom: 6px;
}

.nexus-form-group input[type="text"],
.nexus-form-group input[type="email"],
.nexus-form-group input[type="number"],
.nexus-form-group select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--ne-border);
    border-radius: var(--ne-radius-sm);
    font-size: .9rem;
    color: var(--ne-text);
    background: var(--ne-white);
    transition: border-color var(--ne-transition);
    appearance: none;
}

.nexus-form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.nexus-form-group input:focus,
.nexus-form-group select:focus {
    outline: none;
    border-color: var(--ne-blue);
    box-shadow: 0 0 0 3px rgba(30,80,160,.12);
}

.nexus-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 480px) {
    .nexus-form-row { grid-template-columns: 1fr; }
}

/* Récapitulatif total */
.nexus-total-recap {
    background: var(--ne-blue-light);
    border-left: 4px solid var(--ne-blue);
    padding: 12px 16px;
    border-radius: var(--ne-radius-sm);
    font-size: 1rem;
    color: var(--ne-blue);
    margin: 16px 0;
}

/* RGPD */
.nexus-rgpd label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .83rem;
    font-weight: 400;
    color: var(--ne-text-muted);
    cursor: pointer;
    line-height: 1.5;
}

.nexus-rgpd input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 2px;
    accent-color: var(--ne-blue);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ESPACE CLIENT — [nexus_events_espace]
═══════════════════════════════════════════════════════════════════════════ */

.nexus-events-espace {
    max-width: 720px;
}

.nexus-events-espace h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ne-text);
    margin: 0 0 20px;
}

.nexus-espace-login {
    background: var(--ne-white);
    border: 1px solid var(--ne-border);
    border-radius: var(--ne-radius);
    padding: 24px 28px;
    max-width: 400px;
}

.nexus-espace-login p {
    font-size: .9rem;
    color: var(--ne-text-muted);
    margin-bottom: 16px;
}

.nexus-espace-intro {
    font-size: .9rem;
    color: var(--ne-text-muted);
    margin-bottom: 20px;
}

.nexus-espace-event-group {
    margin-bottom: 28px;
}

.nexus-espace-event-group h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ne-blue);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ne-border);
}

.nexus-billets-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Carte billet */
.nexus-billet-card {
    background: var(--ne-white);
    border: 1px solid var(--ne-border);
    border-radius: var(--ne-radius);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: var(--ne-shadow);
}

.nexus-billet-card--utilise {
    opacity: .7;
    background: var(--ne-bg);
}

.nexus-billet-card--annule {
    opacity: .5;
    background: var(--ne-bg);
    text-decoration: line-through;
}

.nexus-billet-card__info {
    flex: 1;
}

.nexus-billet-card__seance {
    font-size: .9rem;
    font-weight: 600;
    color: var(--ne-text);
    margin: 0 0 4px;
}

.nexus-billet-card__tarif {
    font-size: .85rem;
    color: var(--ne-text-muted);
    margin: 0 0 8px;
}

.nexus-billet-card__statut {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nexus-billet-card__statut small {
    font-size: .75rem;
    color: var(--ne-text-muted);
}

.nexus-billet-card__actions {
    flex-shrink: 0;
}

@media (max-width: 540px) {
    .nexus-billet-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .nexus-checkout-form {
        padding: 16px;
    }
}
/* ─── Bouton paiement ─────────────────────────────────────────────────────── */
.nexus-btn--pay {
    background: #1e50a0;
    color: #ffffff;
    text-align: center;
    display: block;
    width: 100%;
}

.nexus-btn--pay:hover {
    background: #163a78;
    color: #ffffff;
    text-decoration: none;
}

.nexus-btn--pay svg {
    fill: #1a1a1a;
    vertical-align: middle;
    margin-right: 6px;
}

/* ─── Espace client — espacement footer + marges tableau Mon compte ───────── */
.nexus-events-espace {
    padding-bottom: 48px;
}

.nexus-espace-wrap {
    padding-bottom: 32px;
}

#nexus-tab-compte {
    padding-left: 8px;
}

#nexus-tab-compte table td,
#nexus-tab-compte table th {
    padding-left: 12px;
}
