/* ============================================
   FAMILLE ZIBLI - ADMIN PAGES STYLES
   Styles spécifiques pour les pages d'administration
   ============================================ */

/* Variables CSS pour les pages admin */
:root {
    --admin-primary: #4361ee;
    --admin-secondary: #3f37c9;
    --admin-accent: #4895ef;
    --admin-light: #f8f9fa;
    --admin-dark: #212529;
    --admin-success: #4cc9f0;
    --admin-warning: #f72585;
    --admin-danger: #e63946;
    --admin-info: #457b9d;
}

/* Container principal admin */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header admin */
.admin-header {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    border-left: 5px solid var(--admin-danger);
}

.admin-header h1 {
    font-size: 32px;
    margin: 0;
    color: var(--admin-danger);
}

.admin-header p {
    color: #6b7280;
    margin: 5px 0;
}

.admin-header .page-date {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Actions admin (boutons) */
.admin-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--admin-primary);
    color: white;
}

.btn-success {
    background: var(--admin-success);
    color: white;
}

.btn-info {
    background: var(--admin-info);
    color: white;
}

.btn-danger {
    background: var(--admin-danger);
    color: white;
}

.btn-warning {
    background: var(--admin-warning);
    color: white;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Conteneurs de logs */
.table-container,
.logs-container,
.security-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
}

/* Tableaux admin */
.logs-table,
.security-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table th,
.logs-table td,
.security-table th,
.security-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.logs-table th,
.security-table th {
    background: var(--admin-light);
    font-weight: 600;
    color: var(--admin-secondary);
}

.logs-table tr:hover,
.security-table tr:hover {
    background: #f8f9fa;
}

/* Badges pour niveaux/types */
.log-level,
.event-type,
.event-result {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: white;
    font-weight: bold;
}

/* Niveaux de log */
.level-erreur {
    background: var(--admin-danger);
}

.level-avertissement {
    background: var(--admin-warning);
    color: black;
}

.level-info {
    background: var(--admin-info);
}

.level-fatal {
    background: #000;
    color: white;
}

/* Types d'événements */
.type-tentative {
    background: var(--admin-danger);
}

.type-acces {
    background: var(--admin-warning);
    color: black;
}

.type-changement {
    background: var(--admin-info);
}

.type-telechargement {
    background: var(--admin-success);
}

/* Résultats d'événements */
.result-reussi {
    background: var(--admin-success);
}

.result-echec {
    background: var(--admin-danger);
}

.result-bloque {
    background: var(--admin-warning);
    color: black;
}

.result-surveille {
    background: var(--admin-info);
}

/* Styles de cellules */
.log-message {
    font-weight: 500;
}

.log-file,
.event-ip {
    font-family: monospace;
    font-size: 0.9rem;
    color: #6c757d;
}

.log-timestamp,
.event-timestamp {
    color: #6c757d;
    font-size: 0.9rem;
}

.event-user {
    font-weight: bold;
    color: var(--admin-secondary);
}

.event-details {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-details {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Cellules d'actions */
.action-cell {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
}

.view-btn {
    background: var(--admin-info);
    color: white;
}

.resolve-btn,
.investigate-btn {
    background: var(--admin-warning);
    color: white;
}

.delete-btn,
.block-btn {
    background: var(--admin-danger);
    color: white;
}

/* Section de filtres */
.filter-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.filter-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--admin-secondary);
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 2px solid var(--admin-primary);
    padding-bottom: 10px;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
    flex: 1;
}

.filter-group label {
    font-weight: 600;
    color: var(--admin-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.filter-group input::placeholder {
    color: #adb5bd;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    color: var(--admin-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination a:hover,
.pagination span:hover {
    background: var(--admin-primary);
    color: white;
    border-color: var(--admin-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.2);
}

.pagination .active {
    background: var(--admin-primary);
    color: white;
    border-color: var(--admin-primary);
    font-weight: 600;
}

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

.pagination .disabled:hover {
    background: white;
    color: var(--admin-secondary);
    border-color: #e9ecef;
    transform: none;
    box-shadow: none;
}

.pagination-info {
    text-align: center;
    color: #6c757d;
    margin: 10px 0;
    font-size: 0.9rem;
}

/* Boutons de pagination avec icônes */
.pagination .prev-page,
.pagination .next-page {
    font-weight: 600;
}

/* Tableau d'audit */
.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow-x: auto;
}

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

.audit-table thead {
    background: linear-gradient(135deg, var(--admin-secondary) 0%, var(--admin-primary) 100%);
    color: white;
}

.audit-table thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.audit-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.audit-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.audit-table tbody td {
    padding: 15px;
    color: var(--admin-dark);
}

.audit-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

/* Badges d'action */
.action-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-login {
    background: #d4edda;
    color: #155724;
}

.action-logout {
    background: #e2e3e5;
    color: #383d41;
}

.action-create {
    background: #cce5ff;
    color: #004085;
}

.action-update {
    background: #fff3cd;
    color: #856404;
}

.action-delete {
    background: #f8d7da;
    color: #721c24;
}

.action-view {
    background: #d1ecf1;
    color: #0c5460;
}

.action-export {
    background: #d6d8db;
    color: #1b1e21;
}

/* Tableau d'erreurs */
.error-table {
    width: 100%;
    border-collapse: collapse;
}

.error-table thead {
    background: linear-gradient(135deg, #e63946 0%, #d62839 100%);
    color: white;
}

.error-table thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.error-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.error-table tbody tr:hover {
    background: #fff5f5;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.1);
}

.error-table tbody td {
    padding: 15px;
    color: var(--admin-dark);
}

.error-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

/* Tableau de sécurité */
.security-table {
    width: 100%;
    border-collapse: collapse;
}

.security-table thead {
    background: linear-gradient(135deg, #f72585 0%, #b5179e 100%);
    color: white;
}

.security-table thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.security-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.security-table tbody tr:hover {
    background: #fff0f5;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(247, 37, 133, 0.1);
}

.security-table tbody td {
    padding: 15px;
    color: var(--admin-dark);
}

.security-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

/* Badges d'événements */
.event-type {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-tentative-de-connexion {
    background: #ffe5e5;
    color: #c41e3a;
}

.type-accès-non-autorisé {
    background: #fff3cd;
    color: #856404;
}

.type-changement-de-mot-de-passe {
    background: #d4edda;
    color: #155724;
}

.type-téléchargement-sensible {
    background: #f8d7da;
    color: #721c24;
}

.type-accès-admin {
    background: #cce5ff;
    color: #004085;
}

.event-result {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.result-réussi {
    background: #d4edda;
    color: #155724;
}

.result-échec {
    background: #f8d7da;
    color: #721c24;
}

.result-bloqué {
    background: #fff3cd;
    color: #856404;
}

.result-surveillé {
    background: #d1ecf1;
    color: #0c5460;
}

/* Informations de localisation */
.event-ip-location {
    padding: 8px !important;
}

.ip-address {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.location-icon {
    font-size: 1rem;
}

.location-text {
    color: var(--admin-dark);
}

.location-text strong {
    color: var(--admin-primary);
}

/* Date et heure séparées */
.event-datetime {
    padding: 8px !important;
}

.event-datetime .date {
    font-size: 0.9rem;
    color: var(--admin-dark);
    margin-bottom: 3px;
}

.event-datetime .time {
    font-size: 0.85rem;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}
    border-radius: 5px;
}

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

/* Grille de statistiques avec alignement horizontal forcé */
.stats-grid-horizontal {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .stats-grid-horizontal {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid-horizontal {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 10px 0;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Couleurs de statistiques */
.stat-error,
.stat-attempt {
    color: var(--admin-danger);
}

.stat-warning,
.stat-access {
    color: var(--admin-warning);
}

.stat-info,
.stat-change {
    color: var(--admin-info);
}

.stat-fatal,
.stat-download {
    color: var(--admin-success);
}

/* Footer admin */
.admin-footer {
    text-align: center;
    margin-top: 40px;
    color: #6b7280;
    font-size: 12px;
}

.admin-footer span {
    color: #999;
}

/* Responsive design */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }

    .admin-header {
        padding: 20px;
    }

    .admin-header h1 {
        font-size: 24px;
    }

    .admin-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

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

    .action-cell {
        flex-direction: column;
    }

    /* Tableaux scrollables sur mobile */
    .logs-container,
    .security-container {
        overflow-x: auto;
    }

    .logs-table,
    .security-table {
        min-width: 800px;
    }
}

/* Animation pour les actions */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* États désactivés/résolus */
.resolved {
    opacity: 0.5;
    text-decoration: line-through;
}

/* Badges Bootstrap personnalisés pour compatibilité */
.badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.bg-success {
    background-color: var(--admin-success);
    color: white;
}

.bg-danger {
    background-color: var(--admin-danger);
    color: white;
}

.bg-warning {
    background-color: var(--admin-warning);
    color: black;
}

.bg-info {
    background-color: var(--admin-info);
    color: white;
}

.bg-primary {
    background-color: var(--admin-primary);
    color: white;
}

.bg-secondary {
    background-color: #6b7280;
    color: white;
}

.bg-dark {
    background-color: var(--admin-dark);
    color: white;
}

.bg-light {
    background-color: var(--admin-light);
    color: var(--admin-dark);
}

/* ==========================================================================
   DARK LUXURY GLASSMORPHISM - MASTER OVERRIDES FOR ADMIN PAGES
   ========================================================================== */
body.dark-mode .admin-header,
:root[data-theme="dark"] .admin-header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95)) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    color: #f8fafc !important;
}

body.dark-mode .admin-header h1,
:root[data-theme="dark"] .admin-header h1 {
    color: #f59e0b !important;
    -webkit-text-fill-color: #f59e0b !important;
}

body.dark-mode .admin-header p,
:root[data-theme="dark"] .admin-header p {
    color: #cbd5e1 !important;
}

body.dark-mode .table-container,
body.dark-mode .logs-container,
body.dark-mode .security-container,
body.dark-mode .stat-card-clean,
body.dark-mode .filter-box,
body.dark-mode .stat-box,
body.dark-mode .card-modern-clean,
body.dark-mode .admin-card,
body.dark-mode .panel,
body.dark-mode .widget-box,
:root[data-theme="dark"] .table-container,
:root[data-theme="dark"] .logs-container,
:root[data-theme="dark"] .security-container {
    background: rgba(30, 41, 59, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
    color: #f8fafc !important;
    border-radius: 16px !important;
}

body.dark-mode .logs-table,
body.dark-mode .security-table,
body.dark-mode .admin-table,
:root[data-theme="dark"] .logs-table,
:root[data-theme="dark"] .security-table {
    color: #f8fafc !important;
}

body.dark-mode .logs-table th,
body.dark-mode .security-table th,
body.dark-mode .admin-table th,
:root[data-theme="dark"] .logs-table th,
:root[data-theme="dark"] .security-table th {
    background: rgba(15, 23, 42, 0.95) !important;
    color: #38bdf8 !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .logs-table td,
body.dark-mode .security-table td,
body.dark-mode .admin-table td,
:root[data-theme="dark"] .logs-table td,
:root[data-theme="dark"] .security-table td {
    color: #cbd5e1 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .logs-table tr:hover,
body.dark-mode .security-table tr:hover,
body.dark-mode .admin-table tr:hover,
:root[data-theme="dark"] .logs-table tr:hover,
:root[data-theme="dark"] .security-table tr:hover {
    background: rgba(51, 65, 85, 0.6) !important;
    color: #ffffff !important;
}

body.dark-mode .admin-container,
:root[data-theme="dark"] .admin-container {
    color: #f8fafc !important;
}

