/* Computile Events Manager - Frontend Styles */

/* Variables CSS */
:root {
    --cem-primary-color: rgb(220, 190, 132);
    --cem-primary-hover: rgba(220, 190, 132, 0.9);
    --cem-success-color: #28a745;
    --cem-danger-color: #dc3545;
    --cem-warning-color: #ffc107;
    --cem-info-color: #17a2b8;
    --cem-border-radius: 6px;
    --cem-box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    --cem-box-shadow-hover: 0 2px 8px rgba(0,0,0,0.08);
    --cem-gradient-primary: linear-gradient(135deg, var(--cem-primary-color) 0%, rgba(220, 190, 132, 0.8) 100%);
}

/* Container principal */
.cem-events-container {
    margin: 20px 0;
}

/* Grille d'événements */
.events-list {
    display: grid;
    gap: 24px;
    margin-bottom: 40px;
}

/* Message aucun événement */
.no-events-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    margin: 0;
    font-size: 1.1em;
}

.events-list.events-style-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Carte d'événement */
.event-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: var(--cem-border-radius);
    overflow: hidden;
    box-shadow: var(--cem-box-shadow);
}


/* Image de l'événement */
.event-card .event-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    display: block;
}

.event-card .event-image:hover {
    /* Aucun effet au survol */
}


/* Contenu de la carte */
.event-card .event-content {
    padding: 20px;
}

.event-card h3 {
    margin: 0 0 12px 0;
    color: #1a1a1a;
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.3;
}

.event-card .event-meta {
    margin-bottom: 12px;
    font-size: 0.9em;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.event-card .event-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.event-card .event-excerpt {
    color: #666;
    line-height: 1.5;
    margin-bottom: 16px;
    font-size: 0.95em;
}

/* Structure des cartes améliorée */
.event-main-info {
    margin-bottom: 16px;
}

.event-datetime {
    margin-bottom: 8px;
}

.event-date {
    display: block;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.event-time {
    display: block;
    font-size: 0.9em;
    color: #666;
}

.event-location {
    margin-bottom: 12px;
}

.event-location span {
    font-weight: 500;
    color: #333;
}

.event-availability {
    margin-bottom: 12px;
}

.availability-info {
    font-size: 0.85em;
    color: #666;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
}

/* Boutons */
.event-details-btn,
.cem-btn {
    background: var(--cem-primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    letter-spacing: 0.3px;
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

button.event-details-btn:hover,
.cem-btn:hover {
    background: var(--cem-primary-hover);
}


.cem-btn.cem-btn-secondary {
    background: #6c757d;
}

.cem-btn.cem-btn-secondary:hover {
    background: #5a6268;
}

/* ===== MODAL REDESIGNÉE - RAFFINÉE ET COMPACTE ===== */

/* Overlay modal */
.event-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.event-modal.active {
    display: block;
}

/* Contenu modal */
.modal-content {
    background: #ffffff;
    margin: 2% auto;
    border-radius: 16px;
    width: 95%;
    max-width: 1100px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Header du modal */
.modal-header {
    position: relative;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
}

.modal-header-content {
    padding: 24px 60px 24px 24px;
    position: relative;
}

.modal-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    color: #111827;
}

.modal-featured-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    overflow: hidden;
    opacity: 0.1;
    z-index: 1;
}

.modal-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bouton fermer */
.close-modal {
    position: absolute;
    right: 16px;
    top: 16px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #333;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    opacity: 0.8;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.3);
    color: #000;
    opacity: 1;
}

/* Corps du modal */
.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

/* Layout deux colonnes */
.modal-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 35px;
    align-items: start;
}

/* Colonne principale */
.modal-main {
    min-width: 0;
}

/* Colonne sidebar */
.modal-sidebar {
    position: sticky;
    top: 0;
}

/* Grille d'informations épurée */
.event-info-grid {
    margin-bottom: 24px;
}

.info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child {
    border-bottom: none;
}

.info-group {
    min-width: 0;
}

.info-content {
    width: 100%;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    display: block;
    margin-bottom: 4px;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.4;
    word-break: break-word;
}

.info-detail {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
}

.price-compact {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
}

/* Capacité compacte */
.capacity-compact {
    font-weight: 600;
    color: #1e293b;
    display: inline-block;
    margin-right: 8px;
}

.capacity-bar-mini {
    display: inline-block;
    width: 40px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    vertical-align: middle;
}

.capacity-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, var(--cem-primary-color) 0%, #10b981 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Actions de contact épurées */
.contact-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.contact-action {
    display: inline-block;
    padding: 8px 16px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.contact-action:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    text-decoration: none;
    color: #111827;
}

/* Description mini */
.event-description-mini {
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
    border-left: 3px solid #d1d5db;
}

.event-description-mini h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.description-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
}

/* Catégories d'événement */
.event-category-display {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.event-category-tag {
    display: inline-block;
    background: var(--cem-primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Galerie d'images */
.event-gallery-slider {
    margin-top: 24px;
}

.gallery-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-main {
    position: relative;
    background: #f8f9fa;
}

.gallery-current-image {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.gallery-main-img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--cem-primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gallery-prev:hover,
.gallery-next:hover {
    background: var(--cem-primary-color);
    color: white;
    opacity: 1;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 190, 132, 0.4);
}

.gallery-prev {
    left: 12px;
}

.gallery-next {
    right: 12px;
}

.gallery-thumbnails {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gallery-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
}

.gallery-thumb.active {
    opacity: 1;
    border-color: var(--cem-primary-color);
}

/* Image principale si pas de galerie */
.event-main-image {
    margin-top: 24px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.event-featured-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: cover;
}

/* Panneau d'inscription */
.registration-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.registration-panel .event-registration-form {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.registration-panel h4 {
    color: #111827;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    text-align: center;
}

.registration-panel .form-field {
    margin-bottom: 16px;
}

.registration-panel label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.registration-panel input[type="text"],
.registration-panel input[type="email"],
.registration-panel input[type="tel"],
.registration-panel select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.registration-panel input:focus,
.registration-panel select:focus {
    outline: none;
    border-color: var(--cem-primary-color);
    box-shadow: 0 0 0 3px rgba(220, 190, 132, 0.1);
}

.registration-panel .cem-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    margin-top: 8px;
    background: var(--cem-primary-color);
    border: none;
    color: #ffffff;
    transition: all 0.2s ease;
}

.registration-panel .cem-btn:hover {
    background: var(--cem-primary-hover);
}

/* Messages */
.cem-message {
    padding: 15px;
    border-radius: var(--cem-border-radius);
    text-align: center;
    font-weight: 500;
    margin: 20px 0;
}

.cem-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cem-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.cem-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.cem-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Statut de l'événement */
.event-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-status.available {
    background: #d4edda;
    color: #155724;
}

.event-status.limited {
    background: #fff3cd;
    color: #856404;
}

.event-status.full {
    background: #f8d7da;
    color: #721c24;
}


/* Responsive */
@media (max-width: 768px) {
    .events-list.events-style-grid {
        grid-template-columns: 1fr;
    }
    
    .event-card .event-image {
        height: 150px;
    }
    
    .modal-content {
        width: 98%;
        margin: 1% auto;
        max-height: 98vh;
        border-radius: 12px;
        max-width: none;
    }
    
    .modal-header-content {
        padding: 20px 20px 16px 20px;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    /* Layout mobile : une seule colonne */
    .modal-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Grille mobile : une colonne */
    .info-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .event-meta {
        flex-direction: column;
        gap: 8px !important;
    }
    
    .contact-actions {
        justify-content: center;
        gap: 8px;
    }
    
    .contact-action {
        flex: 1;
        justify-content: center;
        min-width: 0;
        max-width: 100px;
    }
    
    .modal-featured-image {
        display: none;
    }
    
    .registration-panel {
        padding: 16px;
    }
    
    .modal-sidebar {
        position: static;
        order: -1; /* Inscription en haut sur mobile */
    }
}

@media (max-width: 480px) {
    .event-card h3 {
        font-size: 1.1em;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .essential-item {
        gap: 12px;
    }
    
    .essential-icon {
        width: 28px;
        height: 28px;
        font-size: 1.3rem;
    }
}

/* Impression */
@media print {
    .event-modal,
    .event-details-btn,
    .close-modal,
    .event-registration-form,
    .contact-quick {
        display: none !important;
    }
    
    .event-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibilité */
.screen-reader-text {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Focus visible pour l'accessibilité */
*:focus-visible {
    outline: 2px solid var(--cem-primary-color);
    outline-offset: 2px;
}

/* Animation de chargement */
.cem-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(220, 190, 132, 0.3);
    border-radius: 50%;
    border-top-color: var(--cem-primary-color);
    animation: spin 1s ease-in-out infinite;
}

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