/* 
 * Armenopole Events Carousel CSS
 * Utilise les couleurs du site : #2BBBAD et #00897b
 */

/* Changement de police pour tout le carrousel */
.armenopole-carousel-container {
    max-width: 100%; /* Utiliser toute la largeur disponible */
    margin: 0 auto;
    padding: 20px 0;
    position: relative;
    font-family: 'Roboto', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* Styles de base du carrousel */
.armenopole-events-swiper {
    width: 100%;
    padding: 20px 5px; /* Réduire le padding horizontal */
}

/* Style des cartes d'événement */
.event-card {
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.event-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* Style de l'image */
.event-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 0;
    padding-top: 82.4%; /* Ratio exact 728:600 (600/728 = 0.824) */
}

.event-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .event-image img {
    transform: scale(1.05);
}

/* Badge de catégorie sur l'image */
.event-category-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 137, 123, 0.85);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
    text-transform: uppercase;
}

/* Ligne de séparation élégante - redesign plus fin et stylé */
.event-divider {
    height: 1px;
    background: linear-gradient(to right, 
        rgba(255, 255, 255, 0), 
        #2BBBAD,
        #00897b,
        #2BBBAD,
        rgba(255, 255, 255, 0)
    );
    margin: 0;
    position: relative;
}

.event-divider::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 25%;
    right: 25%;
    height: 1px;
    background: linear-gradient(to right, 
        rgba(255, 255, 255, 0), 
        rgba(255, 255, 255, 0.5),
        rgba(255, 255, 255, 0)
    );
}

/* Style des informations - padding réajusté */
.event-info {
    padding: 6px 12px 10px 12px; /* Réduit le padding du haut et augmenté en bas */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Style du titre de l'événement - légèrement augmenté en hauteur */
.event-title {
    margin: 0 0 8px; /* Augmenté la marge en bas */
    font-size: 1.25rem;
    line-height: 1.3; /* Légèrement augmenté pour plus d'espace */
    width: 100%;
    max-height: 2.8em; /* Augmenté de 2.5em à 2.8em pour plus d'espace */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
    font-weight: 600;
}

.event-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.event-title a:hover {
    color: #00897b;
}

/* Layout en deux colonnes pour la date et les infos secondaires */
.event-details-row {
    display: flex;
    width: 100%;
    margin-top: 3px;
}

/* Bloc date/heure simplifié */
.event-date-time {
    width: 65px;
    min-width: 65px; /* Empêche la réduction du bloc date/heure */
    height: auto;
    background-color: #00897b;
    color: white;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-shrink: 0; /* Empêche la réduction du bloc date/heure */
}

.event-day {
    font-size: 1.4rem;
    font-weight: bold;
    padding-top: 3px;
    margin: 0;
}

.event-month {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 500;
    padding-bottom: 3px;
    margin: 0;
}

.event-time-block {
    background-color: #00897b;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* Informations secondaires */
.event-secondary-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

/* Style de l'organisateur - corrigé pour afficher exactement deux lignes */
.event-organizer {
    color: #666;
    font-size: 1.05rem;
    max-height: 3.6em; /* Augmenté à 3.6em pour accommoder 2 lignes complètes */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
    padding: 0;
    font-weight: 500;
    line-height: 1.4; /* Hauteur de ligne explicite pour éviter le texte coupé */
}

/* Style de la localisation - limité à une ligne avec ellipsis */
.event-location {
    font-size: 0.85rem;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 28px;
    background-color: rgba(43, 187, 173, 0.05); /* Léger fond transparent teinté de vert */
    border-radius: 4px;
    padding: 0 8px;
    margin-top: auto;
    position: relative; /* Pour le positionnement correct */
}

/* Conteneur de la région pour permettre l'ellipsis */
.event-location span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 25px); /* Réserve de l'espace pour le drapeau */
    padding-right: 5px; /* Espace entre le texte et le drapeau */
    flex: 1;
}

/* Style du drapeau */
.country-flag {
    width: 16px;
    height: 12px;
    margin-left: 5px;
    flex-shrink: 0; /* Empêche la réduction du drapeau */
}

/* Masquer les informations de sponsoring */
.sponsored .event-card::before {
    display: none;
}

/* Style des flèches de navigation */
.swiper-button-next,
.swiper-button-prev {
    width: 45px !important;
    height: 45px !important;
    background-color: rgba(0, 137, 123, 0.85);
    color: white !important;
    border-radius: 10px;
    display: flex !important;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-top: -22px !important; /* Centrer verticalement */
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: rgba(0, 137, 123, 1);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 22px !important;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Position des flèches */
.swiper-button-prev {
    left: 5px;
}

.swiper-button-next {
    right: 5px;
}

/* Style de la pagination (peut être masquée) */
.swiper-pagination {
    display: none !important;
}

/* Animation des cartes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.swiper-slide-active .event-card {
    animation: fadeInUp 0.3s ease forwards;
}

/* Styles pour l'affichage de secours quand l'API ne répond pas */
.armenopole-fallback-container {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 40px 20px;
    text-align: center;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.armenopole-logo {
    max-width: 400px;
    margin: 0 auto 30px;
}

.armenopole-logo img {
    max-width: 100%;
    height: auto;
    display: block;
}

.armenopole-fallback-message {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

.armenopole-fallback-message a {
    color: #00897b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.armenopole-fallback-message a:hover {
    color: #2BBBAD;
    text-decoration: underline;
}

/* Animation subtile pour le logo en cas de fallback */
@keyframes pulseLight {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.armenopole-logo img {
    animation: pulseLight 3s infinite ease-in-out;
}

/* Style du widget dashboard */
.armenopole-dashboard-events ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.armenopole-dashboard-events li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.armenopole-dashboard-events li:last-child {
    border-bottom: none;
}

.armenopole-dashboard-events .event-date {
    display: block;
    font-weight: bold;
    color: #2BBBAD;
    background: none;
    text-align: left;
    padding: 0;
    margin: 0 0 5px;
}

.armenopole-dashboard-events a {
    font-weight: 500;
    margin-right: 10px;
}

.armenopole-dashboard-events .event-category {
    font-size: 0.8em;
    padding: 2px 6px;
}

/* Styles responsives - maintenir la même disposition sur tous les appareils */
@media (max-width: 767px) {
    /* Maintenir en ligne comme sur desktop */
    .event-details-row {
        flex-direction: row;
    }
    
    .event-date-time {
        min-width: 65px; /* Assure que le bloc date ne rétrécit pas */
        width: 65px; /* Même largeur que sur desktop */
        margin-bottom: 0;
        margin-right: 12px;
        flex-shrink: 0; /* Empêche la réduction du bloc date */
    }
    
    /* S'assurer que la localisation ne se rétrécit pas trop */
    .event-secondary-info {
        min-width: 0; /* Permet à flex child de rétrécir en dessous de sa largeur min-content */
        flex: 1;
    }

    .event-location {
        margin-top: 0;
    }

    /* Ajustements pour très petits écrans */
    @media (max-width: 400px) {
        .event-info {
            padding: 6px 8px 8px 8px;
        }
        
        .event-date-time {
            min-width: 55px;
            width: 55px;
            margin-right: 8px;
        }
        
        .event-day {
            font-size: 1.3rem;
        }
        
        .event-month {
            font-size: 0.75rem;
        }
        
        .event-time-block {
            font-size: 0.8rem;
        }
        
        .event-organizer {
            font-size: 0.95rem;
        }
        
        .event-location {
            font-size: 0.8rem;
            padding: 0 6px;
        }
        
        /* Boutons de navigation plus petits sur mobile */
        .swiper-button-next,
        .swiper-button-prev {
            width: 32px !important;
            height: 32px !important;
        }
        
        .swiper-button-next:after,
        .swiper-button-prev:after {
            font-size: 16px !important;
        }
    }
}

/* Pour l'affichage de secours */
.armenopole-fallback-container {
    padding: 30px 15px;
}

.armenopole-fallback-message {
    font-size: 1rem;
}