/**
 * Styles pour les alertes infos - Design Moderne
 * Utilise des variables CSS personnalisables depuis les paramètres WordPress
 */

/* Variables par défaut (peuvent être surchargées via wp_head) */
:root {
    --alerte-bg-color: #0f0f1a;
    --alerte-card-bg: #1a1a2e;
    --alerte-card-hover-bg: #252542;
    --alerte-text-color: #ffffff;
    --alerte-border-color: #0EA5E9;
    --alerte-border-radius: 16px;
    --alerte-timestamp-bg: #0EA5E9;
    --alerte-timestamp-color: #ffffff;
    --alerte-importante-color: #F59E0B;
    --alerte-urgente-color: #EF4444;
}

/* ==========================================
   CAROUSEL D'ALERTES
   ========================================== */

.lvdd-alertes-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--alerte-bg-color) 0%, #16162a 100%);
    border-radius: 20px;
    padding: 30px 70px;
}

.alertes-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.alertes-carousel-track-wrapper {
    flex: 1;
    overflow: hidden;
}

.alertes-carousel-track {
    display: flex;
    gap: 10px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.alertes-carousel-slide {
    flex: 0 0 calc(23% - 8px);
    min-width: 200px;
    max-width: 300px;
    display: flex;
}

/* Fix pour l'affichage correct des slides */
.alertes-carousel-slide .lvdd-alerte-card {
    width: 100%;
    margin: 0;
}

/* ==========================================
   BOUTONS DE NAVIGATION
   ========================================== */

.alertes-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--alerte-text-color);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.alertes-carousel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.alertes-prev {
    left: 10px;
}

.alertes-next {
    right: 10px;
}

/* ==========================================
   CARTE D'ALERTE - DESIGN MODERNE
   ========================================== */

.lvdd-alerte-card {
    display: flex;
    flex-direction: column;
    background: var(--alerte-card-bg);
    border-radius: var(--alerte-border-radius);
    text-decoration: none;
    color: var(--alerte-text-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 320px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lvdd-alerte-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   IMAGE DE L'ALERTE
   ========================================== */

.lvdd-alerte-card .alerte-image-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    flex-shrink: 0;
}

.lvdd-alerte-card .alerte-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.lvdd-alerte-card:hover .alerte-image {
    transform: scale(1.1);
}

.lvdd-alerte-card .alerte-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, var(--alerte-card-bg) 0%, transparent 100%);
    pointer-events: none;
}

/* Carte sans image */
.lvdd-alerte-card.no-image {
    min-height: 220px;
}

.lvdd-alerte-card.no-image .alerte-body {
    padding-top: 20px;
}

/* ==========================================
   CORPS DE LA CARTE
   ========================================== */

.lvdd-alerte-card .alerte-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.lvdd-alerte-card.has-image .alerte-body {
    margin-top: -30px;
}

/* Header avec badge et heure */
.lvdd-alerte-card .alerte-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
}

/* Badge de priorité */
.lvdd-alerte-card .alerte-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--alerte-border-color);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lvdd-alerte-card .alerte-badge svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    flex-shrink: 0;
}

.lvdd-alerte-card.priorite-importante .alerte-badge {
    background: var(--alerte-importante-color);
}

.lvdd-alerte-card.priorite-urgente .alerte-badge {
    background: var(--alerte-urgente-color);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Heure */
.lvdd-alerte-card .alerte-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.lvdd-alerte-card .alerte-time svg {
    opacity: 0.7;
}

/* Titre */
.lvdd-alerte-card .alerte-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.4;
    color: var(--alerte-text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Extrait */
.lvdd-alerte-card .alerte-excerpt {
    font-size: 14px;
    margin: 0;
    opacity: 0.7;
    line-height: 1.6;
    color: var(--alerte-text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Footer */
.lvdd-alerte-card .alerte-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lvdd-alerte-card .alerte-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.lvdd-alerte-card .alerte-read-more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--alerte-border-color);
    transition: all 0.3s ease;
}

.lvdd-alerte-card .alerte-read-more svg {
    transition: transform 0.3s ease;
}

.lvdd-alerte-card:hover .alerte-read-more {
    color: #fff;
}

.lvdd-alerte-card:hover .alerte-read-more svg {
    transform: translateX(4px);
}

.lvdd-alerte-card.priorite-importante .alerte-read-more {
    color: var(--alerte-importante-color);
}

.lvdd-alerte-card.priorite-urgente .alerte-read-more {
    color: var(--alerte-urgente-color);
}

/* ==========================================
   EFFETS DE PRIORITÉ
   ========================================== */

.lvdd-alerte-card.priorite-importante {
    border-color: rgba(245, 158, 11, 0.3);
}

.lvdd-alerte-card.priorite-importante:hover {
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.2);
}

.lvdd-alerte-card.priorite-urgente {
    border-color: rgba(239, 68, 68, 0.3);
    animation: card-urgent-glow 3s infinite;
}

@keyframes card-urgent-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
    }
}

.lvdd-alerte-card.priorite-urgente:hover {
    box-shadow: 0 20px 40px rgba(239, 68, 68, 0.3);
    animation: none;
}

/* ==========================================
   LISTE D'ALERTES
   ========================================== */

.lvdd-alertes-liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.lvdd-no-alertes {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1200px) {
    .alertes-carousel-slide {
        flex: 0 0 calc(50% - 12px);
    }
}

@media (max-width: 768px) {
    .lvdd-alertes-carousel {
        padding: 20px 50px;
        border-radius: 16px;
    }

    .alertes-carousel-slide {
        flex: 0 0 100%;
    }

    .alertes-carousel-btn {
        width: 40px;
        height: 40px;
    }

    .alertes-prev {
        left: 5px;
    }

    .alertes-next {
        right: 5px;
    }

    .lvdd-alerte-card {
        min-height: 280px;
    }

    .lvdd-alerte-card .alerte-image-wrapper {
        height: 140px;
    }

    .lvdd-alerte-card .alerte-title {
        font-size: 15px;
    }

    .lvdd-alerte-card .alerte-excerpt {
        font-size: 13px;
        -webkit-line-clamp: 2;
    }

    .lvdd-alerte-card .alerte-body {
        padding: 15px;
    }

    .lvdd-alertes-liste {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .lvdd-alertes-carousel {
        padding: 15px 45px;
    }

    .lvdd-alerte-card .alerte-badge {
        font-size: 10px;
        padding: 4px 10px;
    }

    .lvdd-alerte-card .alerte-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Bouton d'abonnement aux notifications */
.lvdd-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.lvdd-subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.lvdd-subscribe-btn.subscribed {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.subscribe-icon {
    font-size: 20px;
}
