/* ==========================================================================
   PAGE DE GESTION DES ANNONCES DE GUILDE (guildannouncement.css)
   ========================================================================== */

/* --- Layout Général de la Page --- */
.manage-guild-announcements-page {
    max-width: 1800px; /* Cohérent avec les autres pages de guilde */
}

.manage-guild-announcements-page .page-header-actions {
    margin-bottom: 20px;
}

.manage-guild-announcements-page h1 {
    text-align: center;
    color: #4CAF50;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.content-actions {
    text-align: right;
    margin-bottom: 20px;
}

.content-actions .papel-pass-button .material-symbols-outlined {
    margin-right: 8px;
    vertical-align: text-bottom;
}


/* --- Section Principale (Carte de contenu) --- */
.announcements-list-section.card {
    background-color: #2e2e2e;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.announcements-list-section.card h3 {
    margin-top: 0;
    color: #e0e0e0;
    border-bottom: 1px solid #4a4a4a;
    padding-bottom: 10px;
    margin-bottom: 15px;
}


/* --- Tableau des Annonces (Desktop) --- */
.guild-announcements-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.guild-announcements-table th,
.guild-announcements-table td {
    padding: 10px 12px;
    /* text-align: left;*/
    border-bottom: 1px solid #444;
    vertical-align: middle;
}

.guild-announcements-table th {
    background-color: #383838;
    color: #4CAF50;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

/* Style spécifique pour la colonne titre */
.guild-announcements-table td[data-label="<?php echo _t('ANNOUNCEMENT_COL_TITLE'); ?>"] {
    font-weight: bold;
    color: #d0d0d0;
}

/* Style des émoticônes dans le tableau */
.guild-announcements-table td[data-label="<?php echo _t('ANNOUNCEMENT_COL_AUTHOR'); ?>"] .game-emoticon,
.guild-announcements-table td[data-label="<?php echo _t('ANNOUNCEMENT_COL_TITLE'); ?>"] .game-emoticon {
    height: 1.8em;
    vertical-align: middle;
}

.announcement-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.announcement-actions-cell .guild-action-button.small {
    margin-left: 5px;
}


/* ==========================================================================
   ÉDITEUR DE TEXTE & FORMULAIRE
   ========================================================================== */

/* --- Barre d'outils de l'éditeur --- */
.text-editor-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 8px; /* L'espace se fait ici */
    padding: 5px;
    background-color: #383838;
    border: 1px solid #444;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.text-editor-toolbar .format-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    background: #4f4f4f;
    color: #ddd;
    border: 1px solid #666;
    padding: 3px 6px;
    margin-right: 4px;
    cursor: pointer;
    border-radius: 3px;
}

.text-editor-toolbar .format-btn:hover {
    background: #5a5a5a;
}

.text-editor-toolbar .format-btn .material-symbols-outlined {
    font-size: 1.2em;
    vertical-align: middle;
    color: #ccc;
}

.text-editor-toolbar .format-btn:hover .material-symbols-outlined {
    color: #fff;
}

/* --- Sélecteur de couleur (CORRIGÉ) --- */
.text-editor-toolbar input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    margin-right: 4px; /* Espacement corrigé */
    padding: 0;
    border: 1px solid #666;
    border-radius: 3px;
    background-color: transparent;
    vertical-align: middle;
    cursor: pointer;
}

.text-editor-toolbar input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.text-editor-toolbar input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.text-editor-toolbar input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 2px;
}

/* --- Zone de sélection des émoticônes --- */
.emoticon-picker-area {
    padding: 5px;
    border: 1px solid #444;
    border-bottom: none; /* Collé au-dessus du textarea */
    border-radius: 0;
	min-height: 40px; 
    max-height: 80px;
    overflow-y: auto;
    background-color: #2f2f2f;
    scrollbar-width: thin;
    scrollbar-color: #555 #2a2a2a;
}

.emoticon-picker-area::-webkit-scrollbar { width: 8px; }
.emoticon-picker-area::-webkit-scrollbar-track { background: #2a2a2a; border-radius: 4px; }
.emoticon-picker-area::-webkit-scrollbar-thumb { background-color: #555; border-radius: 4px; border: 2px solid #2a2a2a; }
.emoticon-picker-area::-webkit-scrollbar-thumb:hover { background-color: #666; }

.emoticon-picker-item {
    display: inline-block; /* Assure un comportement correct */
    cursor: pointer;
    margin: 2px;
    padding: 1px;
    border: 1px solid transparent;
}

.emoticon-picker-item:hover {
    border-color: #666;
    background-color: #3e3e3e;
}

.emoticon-picker-item .game-emoticon {
    vertical-align: middle;
    height: 1.8em;
}

/* --- Zone de texte principale (Textarea) --- */
textarea#announcement_text {
    min-height: 150px;
    margin-top: -1px; /* Colle aux éléments du dessus (toolbar, emoticon-picker) */
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    width: 100%; /* S'assurer qu'il prend toute la largeur */
}

/* --- Aide (Compteur de caractères) --- */
.char-counter-help {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #aaa;
    margin-top: 5px;
}

.char-count {
    font-weight: bold;
}

/* Pour les boutons d'action dans les cellules de tableau */
.announcement-actions-cell .guild-action-button.small .material-symbols-outlined {
    /* Couleur par défaut si pas de thème spécifique */
}

/* Exemple de couleurs spécifiques */
.announcement-actions-cell .edit-announcement-btn .material-symbols-outlined {
    color: #2196F3; /* Bleu pour éditer */
}
.announcement-actions-cell .delete-announcement-btn .material-symbols-outlined {
    color: #f44336; /* Rouge pour supprimer */
}

/* Vous pouvez aussi faire varier la couleur au survol du bouton parent */
.announcement-actions-cell .edit-announcement-btn:hover .material-symbols-outlined {
    color: #fff; /* Ou une autre couleur de survol */
}

/* Style spécifique pour le bouton "Retour aux Annonces" */
.back-to-announcements-list {
    display: inline-flex;       /* Aligne l'icône et le texte */
    align-items: center;        /* Centre verticalement icône et texte */
    padding: 10px 20px;         /* Espace interne du bouton */
    margin-bottom: 20px;        /* Marge en dessous du bouton */
    background-color: #383838; /* Fond un peu plus clair que les cartes peut-être */
    color: #d0d0d0;     /* Texte légèrement plus clair */
    text-decoration: none;      /* Pas de soulignement pour le lien */
    border-radius: 5px;         /* Coins arrondis */
    font-size: 0.95em;          /* Taille de la police */
    font-weight: 500;
    border: 1px solid #5a6268; /* Bordure optionnelle */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Ombre optionnelle */
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

.back-to-announcements-list:hover {
    background-color: #5a6268;  /* Couleur au survol */
    color: white;
    text-decoration: none;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Ombre discrète */
    transform: translateY(-1px); /* Léger effet de soulèvement */
}

.back-to-announcements-list:active {
    transform: translateY(0px); /* Effet d'appui */
}

.back-to-announcements-list .material-symbols-outlined {
    margin-right: 8px;          /* Espace entre l'icône et le texte */
    font-size: 1.2em;           /* Taille de l'icône */
    line-height: 1;             /* Pour alignement */
}

/* ==========================================================================
   STYLES RESPONSIVE
   ========================================================================== */

/* --- TABLETTE & MOBILE - Affichage en "cartes" (max-width: 768px) --- */
@media screen and (max-width: 768px) {
    .content-actions {
        text-align: center;
    }
    .content-actions .papel-pass-button {
        width: 100%;
        max-width: 300px;
    }

    .guild-announcements-table thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    .guild-announcements-table tr {
        display: block;
        margin-bottom: 1em;
        border: 1px solid #444;
        border-radius: 6px;
        background-color: #333;
    }
    
    .guild-announcements-table td {
        display: block;
        text-align: right;
        font-size: 0.95em;
        border-bottom: 1px dotted #555;
        padding-left: 50%;
        position: relative;
    }

    .guild-announcements-table td:last-child {
        border-bottom: 0;
    }

    .guild-announcements-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #aaa;
    }

    .announcement-actions-cell {
        text-align: center;
        padding-top: 15px;
    }

    .announcement-actions-cell .guild-action-button.small {
        margin: 5px;
       /* min-width: 100px;*/
    }
}


/* --- PETIT MOBILE - Affichage vertical (max-width: 480px) --- */
@media screen and (max-width: 480px) {
    .guild-announcements-table td {
        padding-left: 10px;
        text-align: left;
    }

    .guild-announcements-table td::before {
        position: static;
        display: block;
        width: auto;
        margin-bottom: 3px;
        font-size: 0.8em;
        text-align: left; /* Conserver l'alignement */
    }
}