﻿/* ===========================
   ADMIN - STYLE GENERAL
=========================== */

body {
    background-color: #f4f6f9;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

.admin-container {
    max-width: 950px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 15px;
}

    .admin-header h1 {
        margin: 0;
        font-size: 1.8rem;
        color: #1f3c88;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 12px;
    }

        .admin-header h1 i {
            color: #2563eb;
        }

/* ===========================
   FORMULAIRE
=========================== */

.article-form {
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

    .form-group label {
        font-weight: 600;
        margin-bottom: 8px;
        color: #444;
    }

        .form-group label i {
            width: 22px;
            color: #2563eb;
        }

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    transition: all .3s ease;
    box-sizing: border-box;
}

    .form-control:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37,99,235,.15);
    }

textarea.form-control {
    resize: vertical;
    min-height: 180px;
}

/* ===========================
   LIGNE A DEUX COLONNES
=========================== */

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ===========================
   CHECKBOX
=========================== */

.form-group input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
    vertical-align: middle;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===========================
   AIDE
=========================== */

.form-help {
    margin-top: 6px;
    color: #6c757d;
    font-size: .9rem;
}

/* ===========================
   BOUTONS
=========================== */

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    transition: .25s;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

    .btn-primary:hover {
        background: #1d4ed8;
    }

.btn-secondary {
    background: #6b7280;
    color: white;
}

    .btn-secondary:hover {
        background: #4b5563;
    }

.btn-danger {
    background: #dc3545;
    color: white;
}

    .btn-danger:hover {
        background: #bb2d3b;
    }

.btn-sm {
    padding: 8px 12px;
    font-size: 14px;
}

/* ===========================
   VALIDATION
=========================== */

.text-danger {
    margin-top: 5px;
    color: #dc3545;
    font-size: .9rem;
}

/* ===========================
   INPUT FILE
=========================== */

input[type=file] {
    padding: 8px;
    background: #fff;
}

/* =====================================
   TABLEAU DE BORD ADMINISTRATION
===================================== */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,.08);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .dashboard-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 25px rgba(0,0,0,.12);
    }

    .dashboard-card i {
        font-size: 32px;
        color: #2563eb;
        margin-bottom: 10px;
    }

    .dashboard-card h2 {
        margin: 10px 0 5px;
        font-size: 2rem;
        color: #1f3c88;
    }

    .dashboard-card p {
        margin: 0;
        color: #666;
        font-weight: 500;
    }

/* =====================================
   TABLEAU DES ARTICLES
===================================== */

.admin-table-container {
    overflow-x: auto;
    border: 1px solid #ececec;
    border-radius: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

    .admin-table thead {
        background: #2563eb;
        color: #fff;
    }

    .admin-table th {
        padding: 16px 20px;
        text-align: left;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: .5px;
        font-weight: 600;
    }

        .admin-table th:nth-child(1) {
            width: 30%;
        }

        .admin-table th:nth-child(2) {
            width: 18%;
        }

        .admin-table th:nth-child(3) {
            width: 14%;
        }

        .admin-table th:nth-child(4) {
            width: 14%;
        }

        .admin-table th:nth-child(5) {
            width: 24%;
        }

    .admin-table td {
        padding: 16px 20px;
        border-bottom: 1px solid #ececec;
        vertical-align: middle;
    }

    .admin-table tbody tr {
        transition: background .2s;
    }

        .admin-table tbody tr:hover {
            background: #f7faff;
        }

        .admin-table tbody tr:last-child td {
            border-bottom: none;
        }

/* =====================================
   COLONNES
===================================== */

.article-title {
    font-weight: 600;
    color: #1f3c88;
}

.article-date {
    color: #666;
}

.article-media {
    text-align: center;
    font-size: 18px;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inline-form {
    display: inline-flex;
}

/* =====================================
   BADGES
===================================== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

    .badge.success {
        background: #dcfce7;
        color: #16a34a;
    }

    .badge.muted {
        background: #f1f1f1;
        color: #aaa;
    }

/* =====================================
   ETAT VIDE
===================================== */

.empty-state,
.empty-table {
    text-align: center;
    padding: 50px 20px;
}

    .empty-state i,
    .empty-table i {
        font-size: 48px;
        color: #c0c0c0;
        margin-bottom: 15px;
    }

    .empty-state h3,
    .empty-table h3 {
        margin: 15px 0 8px;
        color: #444;
    }

    .empty-table p {
        color: #777;
        margin-bottom: 20px;
    }

/* =====================================
   ICÔNES
===================================== */

.text-success {
    color: #22c55e;
}

.text-muted {
    color: #b0b0b0;
}

/* =====================================
   APERÇU IMAGE / FICHIER
===================================== */

.current-media {
    margin-bottom: 15px;
}

.image-preview-container {
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.preview-image {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    object-fit: contain;
}

.current-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 10px;
}

    .current-file:hover {
        text-decoration: underline;
    }

.remove-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* ===========================
   RESPONSIVE
=========================== */

@media (max-width: 768px) {

    .admin-container {
        margin: 15px;
        padding: 20px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .admin-table th,
    .admin-table td {
        padding: 12px;
        font-size: 14px;
    }

    .actions {
        flex-direction: column;
    }

    .image-preview-container,
    .preview-image {
        max-width: 100%;
    }
}
