/* === Admin Stories Page === */
body {
    background-color: #1a1a1a;
    color: #eee;
    font-family: 'Arial', sans-serif;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #990000;
}

/* Container des histoires */
.admin-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Chaque histoire */
.admin-story {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.admin-story:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.admin-story h2 {
    margin-top: 0;
    color: #ff5555;
}

.admin-story .meta {
    font-size: 0.9em;
    color: #aaa;
    margin-bottom: 10px;
}

/* Boutons de modération */
.admin-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.admin-buttons button {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.admin-buttons button.approve {
    background-color: #4caf50;
    color: #fff;
}

.admin-buttons button.approve:hover {
    background-color: #45a049;
}

.admin-buttons button.reject {
    background-color: #f44336;
    color: #fff;
}

.admin-buttons button.reject:hover {
    background-color: #e53935;
}

.admin-buttons button.delete {
    background-color: #777;
    color: #fff;
}

.admin-buttons button.delete:hover {
    background-color: #555;
}

/* Messages d'erreur / succès */
.errors, .success {
    max-width: 800px;
    margin: 0 auto 20px auto;
    padding: 10px 15px;
    border-radius: 8px;
}

.errors {
    background-color: #ff3333;
    color: #fff;
}

.success {
    background-color: #4caf50;
    color: #fff;
    text-align: center;
}

/* ==== Table Modération Histoires ==== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-family: 'Arial', sans-serif;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
}

table th {
    background-color: #222;
    color: #ff5555;
    font-weight: bold;
    border-bottom: 2px solid #ff5555;
}

table td {
    background-color: #111;
    color: #fff;
    border-bottom: 1px solid #333;
    vertical-align: top;
}

table tr:hover td {
    background-color: #1a1a1a;
}

/* Limite le texte et ajoute un style "Lire en entier" */
td a {
    display: inline-block;
    margin-top: 5px;
    color: #ff5555;
    text-decoration: underline;
    font-size: 0.9em;
}

td a:hover {
    color: #ff8888;
}

/* Boutons d'action */
form button {
    margin: 3px 0;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    font-weight: bold;
    transition: background 0.2s;
}

button[name="action"][value="approve"] {
    background-color: #28a745;
}
button[name="action"][value="approve"]:hover {
    background-color: #3cd064;
}

button[name="action"][value="reject"] {
    background-color: #dc3545;
}
button[name="action"][value="reject"]:hover {
    background-color: #e76c75;
}

button[name="action"][value="delete"] {
    background-color: #6c757d;
}
button[name="action"][value="delete"]:hover {
    background-color: #888;
}

/* Messages succès / erreur */
.success, .errors {
    padding: 12px;
    margin-top: 15px;
    border-radius: 8px;
}

.success { background-color: #1e3c1e; color: #28a745; }
.errors { background-color: #3c1e1e; color: #dc3545; }

/* ==== Responsive ==== */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    table tr {
        margin-bottom: 15px;
        border-bottom: 2px solid #333;
    }

    table th {
        display: none;
    }

    table td {
        padding: 10px;
        text-align: right;
        position: relative;
    }

    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 10px);
        font-weight: bold;
        color: #ff5555;
        text-align: left;
    }

    td a {
        display: block;
        margin-top: 5px;
    }

    form button {
        width: 100%;
        margin: 5px 0;
    }
}
