/* Story View Page Styles - Version Premium Galactique */

/* Background Galactique Global */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-attachment: fixed;
    font-family: 'Rubik', 'Alef', Arial, sans-serif;
    color: #222;
    font-size: 1.08rem;
    letter-spacing: 0.01em;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Particules Galactiques Animées */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.6) 2px, transparent 2px),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.8) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(79, 172, 254, 0.7) 1.5px, transparent 1.5px),
        radial-gradient(circle at 90% 20%, rgba(255, 215, 0, 0.5) 1px, transparent 1px),
        radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.6) 2px, transparent 2px);
    background-size: 300px 300px, 250px 250px, 400px 400px, 350px 350px, 200px 200px;
    animation: galaxyFloat 25s ease-in-out infinite;
    pointer-events: none;
}

@keyframes galaxyFloat {
    0%, 100% { 
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.8;
    }
    25% { 
        transform: translateY(-20px) translateX(10px) rotate(1deg);
        opacity: 1;
    }
    50% { 
        transform: translateY(-30px) translateX(-10px) rotate(-1deg);
        opacity: 0.9;
    }
    75% { 
        transform: translateY(-10px) translateX(15px) rotate(0.5deg);
        opacity: 1;
    }
}

.story-view-page {
    background: transparent;
    min-height: 100vh;
    padding-top: 3.5rem;
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1000px; /* Élargi de 820px à 1000px */
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Alert Styles Premium */
.alert {
    padding: 20px 25px;
    border-radius: 18px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    font-weight: 600;
    animation: slideInFromTop 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.alert i {
    margin-left: 15px;
    font-size: 1.4rem;
}

.alert-error {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.9), rgba(238, 90, 82, 0.9));
    color: #fff;
    border-color: rgba(255, 107, 107, 0.3);
}

.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9), rgba(32, 201, 151, 0.9));
    color: #fff;
    border-color: rgba(40, 167, 69, 0.3);
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Main Story Article Premium */
.story-article {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    border-radius: 25px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    padding: 3rem 2.5rem;
    margin-bottom: 3rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.story-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #ffd700, #4facfe);
    background-size: 300% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.story-article:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Header de l'histoire Premium */
.story-header {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(233, 234, 246, 0.9));
    backdrop-filter: blur(25px);
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Suppression de l'animation shimmer sur le header */
/* .story-header::before supprimé */

.story-header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
}

.story-title {
    font-size: 3.2rem; /* Élargi de 2.8rem à 3.2rem */
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(44, 62, 80, 0.1);
    line-height: 1.2;
    background: linear-gradient(135deg, #2c3e50, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem; /* Espacement entre titre et badge */
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1rem;
    color: #4a5568;
    font-weight: 500;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.meta-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.meta-item i {
    color: #667eea;
    font-size: 1.1rem;
}

/* Badges de statut */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-badge.status-approved {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 4px 15px rgba(40, 167, 69, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-badge.status-pending {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 4px 15px rgba(255, 193, 7, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-badge.status-rejected {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 
        0 4px 15px rgba(220, 53, 69, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: inherit;
    pointer-events: none;
}

/* Texte de l'histoire - JUSTIFIÉ COMME DEMANDÉ */
.story-text {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2c3e50;
    margin-top: 2.5rem;
    text-align: justify; /* TEXTE JUSTIFIÉ */
    text-justify: inter-word;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Tags à la fin de l'histoire */
.story-tags-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
}

.story-tags-bottom .tag {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.story-tags-bottom .tag:hover {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.9), rgba(0, 242, 254, 0.9));
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
}

/* === STYLES D'ADMINISTRATION PREMIUM === */

/* Badge de Statut - AMÉLIORÉ POUR MEILLEURE VISIBILITÉ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 1rem; /* Augmenté de 0.85rem à 1rem */
    font-weight: 800; /* Augmenté de 700 à 800 */
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px; /* Augmenté de 0.5px */
    position: relative;
    top: 0;
    backdrop-filter: blur(15px);
    border: 2px solid; /* Bordure plus épaisse */
    align-self: flex-start;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); /* Ombre plus marquée */
    transition: all 0.3s ease;
    white-space: nowrap;
}

.status-badge:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.status-badge::before {
    content: '';
    margin-left: 0.3rem;
    font-size: 0.9rem;
}

.status-pending {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
    color: #ffffff; /* Texte blanc pour contraste maximal */
    border-color: #ff9500;
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.4);
}

.status-pending::before {
    content: '⏰'; /* Emoji horloge */
}

.status-approved {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    color: #ffffff; /* Texte blanc pour contraste maximal */
    border-color: #00b894;
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

.status-approved::before {
    content: '✓'; /* Emoji check */
}

.status-rejected {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #ffffff; /* Texte blanc pour contraste maximal */
    border-color: #e74c3c;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.status-rejected::before {
    content: '✗'; /* Emoji croix */
}

/* Section Outils d'Administration Premium */
.admin-tools-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 20px;
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: 
        0 15px 40px rgba(102, 126, 234, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

/* Suppression de l'animation sous le titre */
/* .admin-tools-section::before supprimé */

.admin-tools-header {
    text-align: center;
    margin-bottom: 1.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.admin-tools-title {
    font-size: 1.6rem;
    color: #4a5568;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
    text-shadow: none;
}

.admin-tools-title i {
    color: #667eea;
    font-size: 1.4rem;
    opacity: 0.8;
}

.admin-tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

/* Boutons d'Administration Premium */
.admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.9rem 1.4rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    min-width: 140px;
}

.admin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.admin-btn:hover::before {
    left: 100%;
}

.edit-btn {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.9), rgba(0, 242, 254, 0.9));
    color: white;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
}

.edit-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(79, 172, 254, 0.4);
}

.approve-btn {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9), rgba(32, 201, 151, 0.9));
    color: white;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.approve-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(40, 167, 69, 0.4);
}

.delete-btn {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.9), rgba(238, 90, 82, 0.9));
    color: white;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.delete-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.4);
}

/* Select de Statut Premium */
.status-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-select {
    padding: 0.9rem 1.4rem;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23667eea" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: left 1rem center;
    background-size: 0.7rem;
    padding-left: 2.8rem;
    white-space: nowrap;
}

.status-select:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.3);
    transform: scale(1.02);
}

.status-select:hover {
    border-color: #4facfe;
    background-color: rgba(248, 250, 255, 0.9);
    transform: translateY(-2px);
}

/* Messages d'Administration Premium */
.admin-message {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 1.8rem;
    border-radius: 18px;
    margin-top: 1.5rem;
    font-weight: 600;
    animation: slideInFromBottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.admin-message-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.9), rgba(32, 201, 151, 0.9));
    color: white;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.2);
}

.admin-message-error {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.9), rgba(238, 90, 82, 0.9));
    color: white;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.2);
}

.admin-message-info {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.9), rgba(0, 242, 254, 0.9));
    color: white;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.2);
}

.admin-message i {
    font-size: 1.3rem;
}

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

/* Indicateur de Chargement Premium */
.admin-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1.2rem;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.9), rgba(0, 242, 254, 0.9));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    margin-top: 1.5rem;
    color: white;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.2);
}

.admin-loading i {
    font-size: 1.3rem;
    animation: spin 1s linear infinite;
}

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

/* Section de Confirmation de Suppression Premium */
.delete-confirmation {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 243, 205, 0.95), rgba(255, 234, 167, 0.95));
    backdrop-filter: blur(25px);
    border: 2px solid rgba(243, 156, 18, 0.3);
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 1rem;
    animation: slideInFromBottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(243, 156, 18, 0.1);
}

.confirm-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    color: #856404;
    font-weight: 700;
    font-size: 1.1rem;
}

.confirm-message i {
    color: #f39c12;
    font-size: 1.4rem;
}

.confirm-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.confirm-delete-btn {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.9), rgba(200, 35, 51, 0.9));
    color: white;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
}

.confirm-delete-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(220, 53, 69, 0.4);
}

.cancel-delete-btn {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.9), rgba(90, 98, 104, 0.9));
    color: white;
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

.cancel-delete-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(108, 117, 125, 0.4);
}

/* === SECTION COMMENTAIRES PREMIUM === */

.comments-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px);
    border-radius: 25px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: 2.5rem;
    margin-top: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.comments-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #4facfe);
    background-size: 200% 100%;
    animation: shimmer 4s ease-in-out infinite;
}

.comments-header {
    font-size: 1.8rem;
    color: #2c3e50;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: linear-gradient(135deg, #2c3e50, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.comments-header i {
    color: #667eea;
    font-size: 1.6rem;
}

/* Formulaire d'ajout de commentaire Premium */
.comment-form {
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.comment-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 1.5rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: vertical;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    text-align: justify; /* TEXTE JUSTIFIÉ DANS TEXTAREA AUSSI */
}

.comment-form textarea:focus {
    border: 2px solid #4facfe;
    outline: none;
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.2);
    transform: scale(1.02);
}

.comment-form button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 auto;
}

.comment-form button:hover {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(79, 172, 254, 0.4);
}

/* Commentaires individuels Premium */
.comment {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.comment-author {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-author i {
    color: #4facfe;
}

.comment-date {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.comment-content {
    color: #2c3e50;
    line-height: 1.7;
    font-size: 1.05rem;
    text-align: justify; /* COMMENTAIRES AUSSI JUSTIFIÉS */
    text-justify: inter-word;
}

.no-comments {
    text-align: center;
    color: #aaa;
    font-size: 1.2rem;
    margin: 3rem 0;
    padding: 2rem;
}

.no-comments i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
    display: block;
}

/* Login Prompt Premium */
.login-prompt {
    text-align: center;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.login-prompt i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.login-prompt p {
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

.login-prompt a {
    color: #667eea;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

.login-prompt a:hover {
    color: #4facfe;
    text-shadow: 0 2px 10px rgba(79, 172, 254, 0.3);
}

/* === HISTOIRES SIMILAIRES - DESIGN EXACT DU SCREENSHOT === */

.related-stories {
    margin-top: 2.5rem;
    margin-bottom: 6rem; /* Augmenté pour plus d'espace avec le footer */
    padding: 50px 3rem; /* Ajout padding horizontal pour marge interne */
    background: #fff;
}

.related-stories .container {
    max-width: 1000px; /* Même largeur que le conteneur principal */
    margin: 0 auto;
    padding: 0; /* Suppression padding car déjà géré par le parent */
}

.related-stories .stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px; /* Réduit de 50px à 40px */
    gap: 20px;
}

.related-stories .stories-title {
    font-size: 2.2rem; /* Légèrement réduit de 2.5rem */
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.related-stories .stories-title i {
    color: #667eea;
    font-size: 1.8rem; /* Légèrement réduit */
}

.related-stories .stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Optimisé pour meilleur agencement */
    gap: 2rem; /* Retour à un gap plus confortable */
    margin-bottom: 2rem; /* Ajout marge bas pour espacement */
    justify-content: center;
    max-width: 100%;
    /* Optimisation pour éviter cartes isolées */
    grid-auto-rows: 1fr;
    align-items: stretch;
}

/* Design EXACT du screenshot */
.related-stories .story-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e9eaf6 100%);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(100,100,150,0.10);
    border: 1.5px solid #e3e8f0;
    padding: 0;
    margin-bottom: 0; /* Suppression marge bas */
    transition: box-shadow 0.2s, border 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
    /* Assure une hauteur uniforme */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related-stories .story-card:hover {
    box-shadow: 0 12px 40px rgba(100,100,150,0.13);
    border-color: #b3b8d0;
    transform: translateY(-4px) scale(1.01);
}

.related-stories .story-content {
    padding: 2rem 1.5rem 1.5rem 1.5rem; /* Padding plus confortable */
    display: flex;
    flex-direction: column;
    flex: 1; /* Prend tout l'espace disponible */
    min-height: 220px; /* Hauteur optimale pour éviter cartes déséquilibrées */
    justify-content: space-between; /* Répartit l'espace uniformément */
}

.related-stories .story-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.7rem;
}

.related-stories .story-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.related-stories .story-category {
    background: linear-gradient(90deg, #6a82fb 0%, #fc5c7d 100%);
    color: #fff;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    display: inline-block;
}

.related-stories .story-stats {
    display: flex;
    gap: 0.7rem;
    color: #6a82fb;
    font-size: 1rem;
    align-items: center;
    font-weight: 500;
}

.related-stories .story-stats i {
    color: #fc5c7d;
    margin-left: 0.2rem;
}

.related-stories .story-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.7rem;
    line-height: 1.3;
    transition: color 0.2s, text-decoration 0.2s;
    text-align: center;
    word-break: break-word;
    display: block;
}

.related-stories .story-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-stories .story-link:hover .story-title {
    text-decoration: underline;
    color: #6a82fb;
}

.related-stories .story-card:hover .story-title {
    text-decoration: none;
}

.related-stories .story-excerpt {
    color: #444;
    margin-bottom: 1.2rem;
    line-height: 1.6;
    font-size: 1.05rem;
    text-align: justify;
    text-justify: inter-word;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limite à 3 lignes pour uniformité */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1; /* Permet au texte de prendre l'espace disponible */
}

/* Meta layout EXACT du screenshot */
.related-stories .story-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    color: #6a82fb;
    margin-top: auto;
    width: 100%;
    gap: 0.5rem;
}

.related-stories .story-meta .author {
    order: 1;
    flex: 0 1 auto;
    justify-content: flex-end;
    text-align: right;
    font-weight: 500;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    color: #6a82fb;
}

.related-stories .story-meta .date {
    order: 2;
    flex: 0 0 auto;
    text-align: center;
    color: #b3b8d0;
    font-weight: 400;
    font-size: 0.92em;
    margin: 0 0.7rem;
}

.related-stories .new-badge {
    order: 3;
    flex: 0 0 auto;
    justify-content: flex-start;
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    font-size: 0.78em;
    min-width: 0;
    padding: 0.18em 0.9em;
    border-radius: 16px;
    background: #4fc3f7;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Bouton d'impression Premium */
.print-story-btn {
    position: fixed;
    right: 2.5rem;
    bottom: 2.5rem;
    z-index: 1000;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 1.2rem 2.8rem;
    font-size: 1.4rem;
    font-weight: 700;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: floatIn 0.8s cubic-bezier(.68,-0.55,.27,1.55);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@keyframes floatIn {
    from { 
        transform: translateY(80px) scale(0.7); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

.print-story-btn i {
    font-size: 1.8rem;
    vertical-align: middle;
    margin-left: 0.7rem;
}

.print-story-btn:hover, .print-story-btn:focus {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 20px 60px rgba(79, 172, 254, 0.4);
}

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

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .story-title {
        font-size: 2.6rem; /* Élargi aussi sur tablet */
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .story-article {
        padding: 2rem 1.5rem;
    }
    
    .story-header {
        padding: 2rem 1.5rem;
    }
    
    .story-text {
        font-size: 1.1rem;
        padding: 1.5rem;
    }
    
    .admin-tools-grid {
        flex-direction: column;
        gap: 0.8rem;
        align-items: stretch;
    }
    
    .admin-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        min-width: auto;
        width: 100%;
    }
    
    .status-select {
        min-width: auto;
        width: 100%;
    }
    
    .status-badge {
        font-size: 0.9rem; /* Légèrement réduit sur tablet */
        padding: 0.7rem 1.3rem;
        letter-spacing: 0.6px;
    }
    
    .admin-tools-section {
        padding: 1.5rem;
        margin: 2rem 0;
    }
    
    .admin-tools-title {
        font-size: 1.4rem;
    }
    
    .confirm-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .confirm-message {
        font-size: 0.95rem;
        text-align: center;
    }
    
    .admin-tools-grid {
        gap: 0.8rem;
    }
    
    .status-badge {
        font-size: 0.85rem; /* Adapté pour mobile tout en restant lisible */
        padding: 0.6rem 1.1rem;
        letter-spacing: 0.5px;
    }
    
    .print-story-btn {
        right: 1.5rem;
        bottom: 1.5rem;
        padding: 1rem 2rem;
        font-size: 1.2rem;
    }
    
    .related-stories .stories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .related-stories .story-title {
        font-size: 1.1rem; /* Style de la page index */
    }
    
    .related-stories .story-meta {
        font-size: 0.87rem; /* Style de la page index */
        gap: 0.2rem;
    }
    
    .related-stories .story-meta .date {
        margin: 0 0.2rem; /* Style de la page index */
    }
    
    .related-stories .story-content {
        padding: 1.2rem 0.7rem 0.7rem 0.7rem; /* Style de la page index */
    }
    
    .related-stories {
        padding: 40px 2rem; /* Padding confortable sur tablet avec marge interne */
        margin-bottom: 4rem; /* Espace suffisant avec le footer */
    }
    
    .related-stories .stories-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        margin-bottom: 30px; /* Réduit */
    }
    
    .related-stories .stories-title {
        font-size: 2rem;
        white-space: normal;
    }
    
    .related-stories .stories-grid {
        gap: 1.8rem; /* Gap confortable sur tablet */
        margin-bottom: 1.5rem;
    }
    
    .comments-section {
        padding: 2rem 1.5rem;
    }
    
    .comment {
        padding: 1.5rem;
    }
    
    .comment-form {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .story-title {
        font-size: 2.2rem; /* Élargi de 1.8rem à 2.2rem sur mobile */
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }
    
    .story-text {
        font-size: 1rem;
        padding: 1.2rem;
    }
    
    .meta-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .story-tags-bottom .tag {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
    
    .print-story-btn {
        right: 1rem;
        bottom: 1rem;
        padding: 0.8rem 1.5rem;
        font-size: 1.1rem;
    }
    
    /* Responsive des histoires similaires - style page index */
    .related-stories {
        padding: 30px 1.5rem; /* Padding adapté mobile avec marge interne */
        margin-bottom: 3rem; /* Espace suffisant avec footer mobile */
    }
    
    .related-stories .stories-title {
        font-size: 1.4rem; /* Style exact page index mobile */
    }
    
    .related-stories .stories-header {
        gap: 12px; /* Style exact page index mobile */
        margin-bottom: 25px; /* Réduit */
    }
    
    .related-stories .story-content {
        padding: 1rem 0.5rem 0.7rem 0.5rem; /* Style exact page index mobile */
    }
    
    .related-stories .stories-grid {
        gap: 1.5rem; /* Gap confortable sur mobile */
        margin-bottom: 1rem;
    }
}

/* Styles d'impression - masquer interface web */
@media print {
    .admin-tools-section,
    .print-story-btn,
    .comments-section,
    .related-stories {
        display: none !important;
    }
    
    body::before {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .story-article {
        box-shadow: none !important;
        background: white !important;
        border: 1px solid #ccc !important;
    }
    
    .story-rating-container {
        display: none !important;
    }
}

/* ===============================================
   SYSTÈME D'ÉTOILES - DESIGN PREMIUM AMÉLIORÉ
   =============================================== */

/* Container principal du système d'étoiles - Version améliorée */
.story-rating-intelligent {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
    border-radius: 25px;
    padding: 30px 25px;
    margin: 30px 0;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 0 40px rgba(255, 215, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 215, 0, 0.15);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.story-rating-intelligent::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.1),
        transparent
    );
    transition: left 0.8s ease-in-out;
    pointer-events: none;
}

.story-rating-intelligent:hover::before {
    left: 100%;
}

.story-rating-intelligent:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.12),
        0 0 60px rgba(255, 215, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 215, 0, 0.3);
}

/* Bordure animée supérieure */
.story-rating-intelligent::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        #ffd700 0%, 
        #ffed4e 25%, 
        #ff8c00 50%, 
        #ffed4e 75%, 
        #ffd700 100%
    );
    background-size: 200% 100%;
    animation: starsGlow 4s ease-in-out infinite;
    border-radius: 25px 25px 0 0;
}

@keyframes starsGlow {
    0%, 100% { 
        background-position: 0% 50%;
        opacity: 0.8;
    }
    50% { 
        background-position: 100% 50%;
        opacity: 1;
    }
}

/* Container des étoiles amélioré */
.story-rating-intelligent .rating-stars {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    position: relative;
    direction: ltr;
    margin-bottom: 20px;
    padding: 10px 0;
}

/* Effet de particules autour des étoiles */
.story-rating-intelligent .rating-stars::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.15) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(255, 140, 0, 0.12) 1.5px, transparent 1.5px),
        radial-gradient(circle at 40% 80%, rgba(255, 215, 0, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 90% 20%, rgba(255, 140, 0, 0.08) 2px, transparent 2px);
    background-size: 80px 80px, 120px 120px, 100px 100px, 150px 150px;
    animation: particleFloat 15s ease-in-out infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.story-rating-intelligent:hover .rating-stars::before {
    opacity: 1;
}

@keyframes particleFloat {
    0%, 100% { 
        transform: translate(0, 0) rotate(0deg);
    }
    25% { 
        transform: translate(5px, -8px) rotate(1deg);
    }
    50% { 
        transform: translate(-3px, -12px) rotate(-1deg);
    }
    75% { 
        transform: translate(7px, -5px) rotate(0.5deg);
    }
}

/* Étoiles individuelles améliorées */
.story-rating-intelligent .star {
    font-size: 3rem;
    color: #e5e7eb;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    display: inline-block;
    user-select: none;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.05));
    transform-origin: center;
}

/* Effet de brillance sur l'étoile */
.story-rating-intelligent .star::before {
    content: '★';
    position: absolute;
    top: 0;
    left: 0;
    color: transparent;
    background: linear-gradient(135deg, #ffd700, #ffed4e, #ff8c00);
    -webkit-background-clip: text;
    background-clip: text;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: scale(1.1);
}

.story-rating-intelligent .star:hover::before {
    opacity: 0.8;
}

/* Étoiles remplies - Design amélioré */
.story-rating-intelligent .star.filled {
    color: #ffd700;
    text-shadow: 
        0 0 15px rgba(255, 215, 0, 0.7),
        0 0 30px rgba(255, 215, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.2);
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
    animation: starGlow 3s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% {
        text-shadow: 
            0 0 15px rgba(255, 215, 0, 0.7),
            0 0 30px rgba(255, 215, 0, 0.4),
            0 3px 6px rgba(0, 0, 0, 0.2);
    }
    50% {
        text-shadow: 
            0 0 20px rgba(255, 215, 0, 0.9),
            0 0 40px rgba(255, 215, 0, 0.6),
            0 3px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Étoiles notées par l'utilisateur */
.story-rating-intelligent .star.user-rated {
    color: #ff8c00;
    text-shadow: 
        0 0 20px rgba(255, 140, 0, 0.9),
        0 0 35px rgba(255, 140, 0, 0.5),
        0 3px 8px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 6px rgba(255, 140, 0, 0.6));
    animation: userStarPulse 2.5s ease-in-out infinite;
    position: relative;
}

.story-rating-intelligent .star.user-rated::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: radial-gradient(circle, rgba(255, 140, 0, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: userAura 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes userStarPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

@keyframes userAura {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Effets de survol améliorés */
.story-rating-intelligent .star:hover {
    transform: scale(1.25) rotate(10deg);
    color: #ffd700;
    text-shadow: 
        0 0 25px rgba(255, 215, 0, 0.9),
        0 0 45px rgba(255, 215, 0, 0.6),
        0 4px 12px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    z-index: 10;
    position: relative;
}

.story-rating-intelligent .star:active {
    transform: scale(1.15) rotate(5deg);
    transition: all 0.1s ease;
}

/* Effet en cascade pour les étoiles précédentes au survol */
.story-rating-intelligent .star.hover-highlight {
    color: #ffd700;
    transform: scale(1.12) rotate(3deg);
    text-shadow: 
        0 0 18px rgba(255, 215, 0, 0.8),
        0 0 35px rgba(255, 215, 0, 0.4);
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
    transition: all 0.2s ease;
}

/* Zone d'informations améliorée */
.story-rating-intelligent .rating-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: 'Rubik', 'Alef', Arial, sans-serif;
    direction: rtl;
    position: relative;
}

.story-rating-intelligent .rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 600;
}

.story-rating-intelligent .average-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ff8c00;
    text-shadow: 0 2px 4px rgba(255, 140, 0, 0.3);
    background: linear-gradient(135deg, #ff8c00, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.story-rating-intelligent .rating-context {
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
}

.story-rating-intelligent .no-ratings {
    color: #9ca3af;
    font-style: italic;
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Messages de feedback améliorés */
.story-rating-intelligent .rating-message {
    text-align: center;
    padding: 18px 25px;
    border-radius: 20px;
    margin-top: 20px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    direction: rtl;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
}

.story-rating-intelligent .rating-message.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(34, 197, 94, 0.05));
    border-color: rgba(16, 185, 129, 0.3);
    color: #059669;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.1);
}

.story-rating-intelligent .rating-message.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.05));
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.1);
}

.story-rating-intelligent .rating-message.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
    border-color: rgba(59, 130, 246, 0.3);
    color: #2563eb;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.1);
}

/* Animation d'apparition du message */
.story-rating-intelligent .rating-message.show {
    animation: messageSlideInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes messageSlideInBounce {
    0% {
        transform: translateY(-30px) scale(0.8);
        opacity: 0;
    }
    60% {
        transform: translateY(5px) scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* État de chargement amélioré */
.story-rating-intelligent.loading {
    pointer-events: none;
}

.story-rating-intelligent.loading .rating-stars {
    opacity: 0.6;
    filter: blur(1px);
}

.story-rating-intelligent.loading .rating-stars::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #ffd700;
    border-radius: 50%;
    animation: starLoadingEnhanced 1s linear infinite;
}

@keyframes starLoadingEnhanced {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) rotate(180deg) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) scale(1);
    }
}

/* Responsive design amélioré */
@media (max-width: 768px) {
    .story-rating-intelligent {
        padding: 25px 20px;
        margin: 25px 0;
        border-radius: 20px;
    }
    
    .story-rating-intelligent .star {
        font-size: 2.4rem;
    }
    
    .story-rating-intelligent .rating-stars {
        gap: 10px;
        margin-bottom: 18px;
    }
    
    .story-rating-intelligent .average-value {
        font-size: 1.4rem;
    }
    
    .story-rating-intelligent .rating-display {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .story-rating-intelligent {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .story-rating-intelligent .star {
        font-size: 2rem;
    }
    
    .story-rating-intelligent .rating-stars {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .story-rating-intelligent .rating-info {
        gap: 6px;
    }
    
    .story-rating-intelligent .average-value {
        font-size: 1.3rem;
    }
    
    .story-rating-intelligent .rating-display {
        font-size: 1rem;
        flex-direction: column;
        gap: 4px;
    }
    
    .story-rating-intelligent .rating-message {
        padding: 15px 20px;
        font-size: 1rem;
    }
}

/* Animation de mise à jour intelligente */
.story-rating-intelligent .rating-info.updating {
    opacity: 0.6;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.story-rating-intelligent .rating-info.updated {
    opacity: 1;
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* Effet spécial pour nouvelle notation */
.story-rating-intelligent .star.new-rating {
    animation: newStarSparkleEnhanced 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes newStarSparkleEnhanced {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
        filter: brightness(2) hue-rotate(180deg);
    }
    30% {
        transform: scale(1.4) rotate(180deg);
        opacity: 0.8;
        filter: brightness(1.5) hue-rotate(90deg);
    }
    60% {
        transform: scale(0.9) rotate(270deg);
        opacity: 1;
        filter: brightness(1.2) hue-rotate(45deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
        filter: brightness(1) hue-rotate(0deg);
    }
}

/* Effet de brillance périodique */
.story-rating-intelligent .star.filled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: starShimmer 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes starShimmer {
    0%, 100% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}