/*
 * =========================================
 * STYLES GÉNÉRAUX DE LA SHOUTBOX
 * =========================================
 */
#cibistes-shoutbox {
    font-family: 'Oswald', sans-serif;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
    font-weight: 400;
}

#shoutbox-messages {
    height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    background-color: #e8f0fe;
    padding: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    scroll-behavior: smooth;
}

.shoutbox-loading,
.shoutbox-no-message,
.shoutbox-error {
    text-align: center;
    padding-top: 20px;
    color: #888;
}

/*
 * =========================================
 * STYLES DES MESSAGES INDIVIDUELS
 * =========================================
 */
.shoutbox-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* On retire la marge ici pour éviter les conflits */
.shoutbox-avatar {
    /* margin-right est maintenant géré par le padding du contenu */
}

.shoutbox-avatar img {
    border-radius: 5%;
    display: block; /* Empêche les espaces indésirables sous l'image */
}

/* CORRECTION : Ajout d'un espacement à gauche du contenu */
.message-content {
    flex-grow: 1; /* Prend toute la place restante */
    padding-left: 12px; /* Crée l'espace entre l'avatar et le texte */
}

.message-meta {
    font-size: 12px;
    color: #777;
    margin-bottom: 3px;
}

.message-user {
    font-weight: 400;
    color: #333;
}

.message-text {
    word-wrap: break-word;
}

.message-text a {
    color: #0073aa;
    text-decoration: underline;
}

.message-text a:hover {
    color: #00a0d2;
}


/*
 * =========================================
 * FORMULAIRE DE SOUMISSION
 * =========================================
 */
#shoutbox-form {
    display: flex;
    gap: 8px;
}

#shoutbox-form textarea {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 5px 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    resize: vertical;
}

#shoutbox-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#shoutbox-controls button {
    border: 1px solid #ccc;
    background-color: #e9e9e9;
    color: #333;
    cursor: pointer;
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 3px;
    font-size: 14px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#shoutbox-controls button:hover {
    background-color: #dcdcdc;
}

/*
 * =========================================
 * ACTIONS (ÉDITER, SUPPRIMER, SAUVEGARDER)
 * =========================================
 */

.message-actions {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.edit-message,
.delete-message {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    margin: 0 2px;
    font-size: 15px;
    line-height: 1;
    transition: transform 0.2s ease-in-out;
}

.edit-message:hover,
.delete-message:hover {
    transform: scale(1.2);
}

.edit-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
    margin-bottom: 5px;
    border: 1px solid #0073aa;
    border-radius: 3px;
    font-family: 'Oswald', sans-serif;
}

.edit-controls {
    text-align: right;
}

.save-edit,
.cancel-edit {
    font-size: 16px;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 4px;
    line-height: 1.2;
    background-color: #f7f7f7;
}

.save-edit:hover,
.cancel-edit:hover {
    border-color: #999;
    background-color: #f0f0f0;
}


/*
 * =========================================
 * ICÔNES DE SON & PIED DE PAGE
 * =========================================
 */

#cibistes-shoutbox .icon-sound-on { display: none; }
#cibistes-shoutbox .icon-sound-off { display: block; }

#cibistes-shoutbox.sound-on .icon-sound-on {
    display: block;
    color: #2ecc71;
}
#cibistes-shoutbox.sound-on .icon-sound-off { display: none; }

/* AMÉLIORATION : Style du pied de page et du copyright */
.shoutbox-footer {
    text-align: right;
    font-size: x-small; /* Taille pour "Envoyer, Activer Klaxon..." */
    color: #777;
    margin-top: 5px;
}

.shoutbox-footer .copyright {
    font-size: x-small; /* Taille spécifique pour le copyright */
    color: #aaa;
}

/* Style pour la mention @utilisateur dans le message final */
.shoutbox-mention {
    color: royalblue;
    font-weight: normal;
}

/* Style pour rendre le nom de l'utilisateur cliquable plus visible */
.reply-to-user {
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s;
}

.reply-to-user:hover {
    color: royalblue; /* Une couleur de survol, à ajuster selon votre thème */
}
