/* ============================================
   DRAS v2 - Styles Interface Admin
   ============================================ */

/* Layout admin */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: var(--text);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar h1 {
    font-size: 1.2rem;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.admin-sidebar h1 span {
    display: block;
    font-size: 0.75rem;
    font-weight: normal;
    opacity: 0.7;
    margin-top: 5px;
}

.admin-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
}

.admin-nav li a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-nav li a.active {
    background: var(--primary);
    color: var(--text);
}

.admin-nav li a .badge-notif {
    margin-left: auto;
    background: #ef5350;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Bouton retour */
.btn-retour {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 25px;
    background: var(--white);
    border: 2px solid var(--primary);
    box-shadow: 0 2px 6px var(--shadow);
    transition: all 0.2s;
}

.btn-retour:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateX(-3px);
}

/* Main content */
.admin-main {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
    background: var(--background);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h2 {
    font-size: 1.5rem;
    color: var(--text);
}

.admin-header-actions {
    display: flex;
    gap: 10px;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 8px var(--shadow);
}

.stat-card.alert {
    border-left: 4px solid #ef5350;
}

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.stat-card .stat-icon.users { background: #e3f2fd; }
.stat-card .stat-icon.activites { background: #e8f5e9; }
.stat-card .stat-icon.partages { background: #fff3e0; }
.stat-card .stat-icon.reports { background: #ffebee; }

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

.stat-card .stat-trend {
    font-size: 0.8rem;
    margin-top: 10px;
}

.stat-card .stat-trend.up { color: #4caf50; }
.stat-card .stat-trend.down { color: #ef5350; }

/* Tables */
.admin-table-container {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
}

.admin-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.admin-table-header h3 {
    font-size: 1rem;
    margin: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.admin-table .user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-table .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.admin-table .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.admin-table .badge-pending { background: #fff3e0; color: #e65100; }
.admin-table .badge-reviewed { background: #e8f5e9; color: #2e7d32; }
.admin-table .badge-dismissed { background: #eceff1; color: #607d8b; }
.admin-table .badge-admin { background: #e3f2fd; color: #1565c0; }
.admin-table .badge-enseignant { background: #f3e5f5; color: #7b1fa2; }

.admin-table .actions {
    display: flex;
    gap: 8px;
}

.admin-table .btn-action {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-small);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-table .btn-action.view { background: #e3f2fd; color: #1565c0; }
.admin-table .btn-action.view:hover { background: #bbdefb; }

.admin-table .btn-action.approve { background: #e8f5e9; color: #2e7d32; }
.admin-table .btn-action.approve:hover { background: #c8e6c9; }

.admin-table .btn-action.reject { background: #ffebee; color: #c62828; }
.admin-table .btn-action.reject:hover { background: #ffcdd2; }

.admin-table .btn-action.depublish { background: #fff3e0; color: #e65100; }
.admin-table .btn-action.depublish:hover { background: #ffe0b2; }

/* Filters */
.admin-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-filters select,
.admin-filters input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--radius-small);
    font-size: 0.9rem;
}

.admin-filters select:focus,
.admin-filters input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Activity preview card */
.activity-preview {
    background: #f8f9fa;
    border-radius: var(--radius-small);
    padding: 15px;
    margin: 10px 0;
}

.activity-preview .preview-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.activity-preview .preview-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

.activity-preview .preview-phrase {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: var(--radius-small);
    font-style: italic;
}

/* Report detail */
.report-detail {
    padding: 20px;
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    margin: 10px 0;
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.report-detail .report-motif {
    font-weight: 600;
    margin-bottom: 8px;
}

.report-detail .report-comment {
    font-style: italic;
    color: var(--text-light);
}

.report-detail .report-info {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 10px;
}

/* Pagination */
.admin-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 20px;
}

.admin-pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: var(--radius-small);
    cursor: pointer;
    transition: all 0.2s;
}

.admin-pagination button:hover {
    border-color: var(--primary);
}

.admin-pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
}

.admin-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text);
}

/* Modal admin */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.admin-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.admin-modal {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-header h3 {
    margin: 0;
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.admin-modal-body {
    padding: 20px;
}

.admin-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 200px;
    }

    .admin-main {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .admin-sidebar-footer {
        position: relative;
    }

    .admin-main {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-table-container {
        overflow-x: auto;
    }
}
