/* ===== ADMIN DASHBOARD STYLES - ADE MENSA ===== */

:root {
    --primary: #007AFF;
    --primary-gradient: linear-gradient(135deg, #007AFF, #00C6FF);
    --dark-bg: #0f172a;
    --dark-card: #1e293b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-red: #ef4444;
    --accent-green: #22c55e;
    --accent-orange: #f59e0b;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    padding: 20px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: fadeInScale 0.6s ease-out;
}

.login-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    border-radius: 50%;
    padding: 5px;
    background: var(--primary-gradient);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.btn-primary {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 122, 255, 0.4);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1900;
    display: none;
    opacity: 0;
    transition: var(--transition);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 10px;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1800;
}

.mobile-nav-toggle button {
    background: var(--primary-gradient);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.mobile-nav-toggle button:hover {
    transform: rotate(45deg);
}

.mobile-nav-toggle span {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-layout {
    display: block; /* Change from grid to block for full-width content */
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--dark-card);
    border-right: 1px solid var(--glass-border);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: -280px; /* Hidden by default on all screens */
    height: 100vh;
    width: 260px;
    z-index: 2000;
    overflow-y: auto;
    transition: var(--transition);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar.active {
    left: 0;
}

/* Style de la barre de défilement pour la sidebar */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
}

.sidebar-title {
    font-weight: 700;
    font-size: 18px;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-header {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 24px 16px 12px;
    opacity: 0.6;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-link i {
    width: 20px;
}

.nav-link:hover, .nav-link.active {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
}

/* Content Area */
.main-content {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

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

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
}

.page-title p {
    color: var(--text-muted);
}

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

.stat-card {
    background: var(--dark-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-top: 8px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
}

/* Data Table */
.data-card {
    background: var(--dark-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

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

th {
    text-align: left;
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
    font-size: 14px;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-edit { background: rgba(0, 122, 255, 0.1); color: var(--primary); }
.btn-delete { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }

.btn-icon:hover { transform: scale(1.1); }

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.show { display: flex; }

.modal-content {
    background: var(--dark-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body { padding: 24px; }

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* Animations */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 2000;
        transition: var(--transition);
        width: 260px;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .main-content {
        padding: 20px;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .btn-primary {
        width: 100%;
    }
}
