/**
 * Styles pour le popup d'articles
 * Thème: Black Orion
 * Version: 2.0 - Avec support mobile amélioré et navigation multi-articles
 */

/* Variables reprises du thème */
:root {
    --color-black-dark: #000000;
    --color-black-medium: #1a1a1a;
    --color-black-light: #2d2d2d;
    --color-black: #090a0f;
}

/* Conteneur principal du popup */
.article-popup-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 295px;
    max-width: 90vw;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.4s ease-out;
    font-family: 'Montserrat', sans-serif;
}

/* État actif du popup */
.article-popup-container.show {
    transform: translateX(0);
}

/* État réduit du popup */
.article-popup-container.minimized {
    width: 50px;
    height: 50px;
    overflow: hidden;
}

/* Contenu du popup */
.article-popup {
    background: linear-gradient(135deg, var(--color-black-dark), var(--color-black-medium));
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Effet d'étoiles pour le fond du popup */
.article-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 40px 60px, #ffffff 100%, transparent),
        radial-gradient(1px 1px at 90px 150px, #ffffff 100%, transparent),
        radial-gradient(2px 2px at 160px 30px, #ffffff 100%, transparent),
        radial-gradient(1.5px 1.5px at 230px 120px, #ffffff 100%, transparent),
        radial-gradient(1px 1px at 320px 80px, #ffffff 100%, transparent);
    background-repeat: repeat;
    background-size: 350px 350px;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

/* En-tête du popup */
.article-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.article-popup-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.article-popup-controls {
    display: flex;
    gap: 10px;
}

.article-popup-control {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.article-popup-control:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Contenu principal du popup */
.article-popup-content {
    padding: 15px;
    position: relative;
    z-index: 1;
}

/* Image de l'article */
.article-popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Titre de l'article */
.article-popup-article-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

/* Extrait de l'article */
.article-popup-excerpt {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 15px 0;
    max-height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Pied du popup */
.article-popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px 15px;
}

/* Bouton pour lire l'article */
.article-popup-read {
    background: linear-gradient(135deg, #c1bf46, #d47834);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.article-popup-read:hover {
    background: linear-gradient(135deg, #d5cd57, #e5e246);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Bouton pour ne plus afficher */
.article-popup-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
    text-decoration: underline;
}

.article-popup-dismiss:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Animation d'entrée */
@keyframes popupSlideIn {
    from {
        transform: translateX(120%);
    }
    to {
        transform: translateX(0);
    }
}

.article-popup-container.show {
    animation: popupSlideIn 0.4s ease-out forwards;
}

/* Styles pour l'icône du popup minimisé */
.article-popup-mini-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--color-black-dark), var(--color-black-medium));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 20px;
    position: relative;
    z-index: 2;
}

.article-popup-mini-icon::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #ff3860;
    border-radius: 50%;
    border: 2px solid var(--color-black-dark);
}

/* === Override complet des styles génériques de style.css pour TON popup === */
.article-popup-container .article-popup {
  /* remplace la position fixe du thème par une position relative dans ton container */
  position: relative !important;
  bottom: auto        !important;
  right: auto         !important;
  width: auto         !important;
  /* remplace le fond noir du thème par ton dégradé */
  background: linear-gradient(135deg, var(--color-black-dark), var(--color-black-medium)) !important;
  border-radius: 10px     !important;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5) !important;
  overflow: visible       !important;
  /* annule le translateY(100%) et l'opacité à 0 */
  transform: none         !important;
  opacity: 1              !important;
  /* plus de transition par défaut */
  transition: none        !important;
  /* remets ton propre z-index si besoin */
  z-index: 9999           !important;
}

/* Navigation entre articles */
.article-popup-navigation {
    display: flex;
    justify-content: space-between;
    padding: 0 15px 10px;
}

.article-popup-nav-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 14px;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-popup-nav-button:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.article-popup-nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.article-popup-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* Styles responsifs */
@media (max-width: 768px) {
    /* Conteneur principal - toujours en mode icône sur mobile/tablette */
    .article-popup-container {
        right: 10px;
        bottom: 10px;
        width: 50px;
        height: 50px;
        overflow: hidden;
    }
    
    /* Afficher l'icône par défaut sur mobile/tablette */
    .article-popup-mini-icon {
        display: flex !important;
    }
    
    /* Cacher le popup complet par défaut sur mobile/tablette */
    .article-popup {
        display: none;
    }
    
    /* Quand le popup est ouvert sur mobile/tablette */
    .article-popup-container.mobile-expanded {
        width: 90%;
        max-width: 350px;
        height: auto;
        overflow: visible;
    }
    
    /* Afficher le popup complet quand il est ouvert sur mobile/tablette */
    .article-popup-container.mobile-expanded .article-popup {
        display: block;
    }
    
    /* Cacher l'icône quand le popup est ouvert sur mobile/tablette */
    .article-popup-container.mobile-expanded .article-popup-mini-icon {
        display: none !important;
    }
    
    /* Ajuster la hauteur de l'image sur mobile */
    .article-popup-image {
        height: 120px;
    }
    
    /* Ajuster la taille du popup quand il est ouvert sur mobile/tablette */
    .article-popup-container.mobile-expanded .article-popup {
        width: 100% !important;
    }
}
