/**
 * FODESE Event Manager - Styles CSS
 * Version: 1.0.0
 */

/* ============================================
   BADGES DE STATUT
   ============================================ */

.event-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: badgeSlideIn 0.4s ease-out;
}

@keyframes badgeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-text {
    font-family: 'Poppins', sans-serif;
}

/* Badge Terminé - Rouge */
.status-termine .event-badge,
.event-badge.badge-termine {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
}

/* Badge Bientôt - Orange */
.status-bientot .event-badge,
.event-badge.badge-bientot {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    animation: badgeSlideIn 0.4s ease-out, pulse 2s infinite;
}

/* Badge Complet - Noir */
.status-complet .event-badge,
.event-badge.badge-complet {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
}

/* ============================================
   COUNTDOWN TIMER
   ============================================ */

.event-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(250, 120, 69, 0.1) 0%, rgba(214, 35, 7, 0.1) 100%);
    border-radius: 12px;
    margin-top: 12px;
    border: 1px solid rgba(250, 120, 69, 0.2);
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 45px;
}

.countdown-number {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary, #FA7845);
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

.countdown-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--secondary, #030100);
    opacity: 0.7;
    margin-top: 2px;
}

.countdown-separator {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary, #FA7845);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.countdown-expired {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary, #FA7845);
    font-style: italic;
}

/* ============================================
   EFFETS VISUELS SUR LES CARTES
   ============================================ */

/* Événement terminé */
.event-termine {
    opacity: 0.65;
    filter: grayscale(40%);
    transform: none !important;
    transition: all 0.3s ease;
}

.event-termine:hover {
    transform: none !important;
    box-shadow: none !important;
}

.event-termine .glass-card:hover {
    transform: none !important;
}

/* Événement bientôt - Animation pulse/glow */
.event-bientot {
    animation: softPulse 3s ease-in-out infinite;
}

@keyframes softPulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 15px 40px rgba(250, 120, 69, 0.25);
    }
}

.event-bientot::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary, #FA7845), transparent, var(--primary, #FA7845));
    z-index: -1;
    opacity: 0;
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.5; }
}

/* Événement complet */
.event-complet {
    opacity: 0.85;
}

.event-complet::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.02) 10px,
        rgba(0, 0, 0, 0.02) 20px
    );
    pointer-events: none;
    border-radius: inherit;
}

/* ============================================
   BOUTONS INTELLIGENTS
   ============================================ */

.btn-disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%) !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.btn-complet {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
    cursor: not-allowed !important;
}

.btn-bientot {
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(250, 120, 69, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(250, 120, 69, 0.5);
    }
}

/* ============================================
   FILTRES
   ============================================ */

.filter-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid transparent;
    color: var(--primary-dark, #0e0502);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Poppins', sans-serif;
}

.filter-btn:hover {
    background: rgba(250, 120, 69, 0.1);
    border-color: var(--primary, #FA7845);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary, #FA7845) 0%, #d62307 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(250, 120, 69, 0.4);
}

.filter-btn i {
    font-size: 0.875rem;
}

/* Animation lors du filtrage */
.event-hidden {
    animation: fadeOut 0.3s ease-out forwards;
}

.event-visible {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   RESPONSIVE GRID POUR LES CARTES
   ============================================ */

/* Forcer la responsivité des cartes d'événements */
#forums .grid {
    display: grid !important;
    grid-template-columns: repeat(1, 1fr) !important;
    gap: 1.5rem !important;
}

@media (min-width: 640px) {
    #forums .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 1024px) {
    #forums .grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Garantir que les cartes ne dépassent pas */
.glass-card {
    max-width: 100% !important;
    width: 100% !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .event-badge {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 0.65rem;
    }
    
    .event-countdown {
        padding: 10px 12px;
        gap: 4px;
    }
    
    .countdown-item {
        min-width: 35px;
    }
    
    .countdown-number {
        font-size: 1rem;
    }
    
    .countdown-separator {
        font-size: 1rem;
    }
    
    .filter-btn {
        padding: 8px 14px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .filter-container {
        gap: 8px;
    }
    
    .filter-btn span {
        display: none;
    }
    
    .filter-btn i {
        margin: 0;
    }
}

/* ============================================
   ANIMATIONS SUPPLÉMENTAIRES
   ============================================ */

/* Animation d'entrée pour les cartes */
.glass-card {
    animation: cardEnter 0.5s ease-out;
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation pour les cartes */
.glass-card:nth-child(1) { animation-delay: 0s; }
.glass-card:nth-child(2) { animation-delay: 0.1s; }
.glass-card:nth-child(3) { animation-delay: 0.2s; }
.glass-card:nth-child(4) { animation-delay: 0.3s; }
.glass-card:nth-child(5) { animation-delay: 0.4s; }
.glass-card:nth-child(6) { animation-delay: 0.5s; }

/* Hover effect amélioré pour les événements actifs */
.glass-card:not(.event-termine):not(.event-complet):hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================
   INDICATEUR DE STATUT (petit point)
   ============================================ */

.status-indicator {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-indicator.termine {
    background: #dc2626;
}

.status-indicator.bientot {
    background: #f97316;
    animation: pulse 2s infinite;
}

.status-indicator.complet {
    background: #1f2937;
}

.status-indicator.actif {
    background: #22c55e;
}
