@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(226, 232, 240, 0.8);
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);
    --secondary: #8b5cf6;
    --success: #10b981;
    --info: #06b6d4;
    --warning: #f59e0b;
    --danger: #f43f5e;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: rgba(99, 102, 241, 0.15);
    --sidebar-active-text: #6366f1;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism effects */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* App Wrapper Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.sidebar {
    background: var(--sidebar-bg);
    width: 260px;
    min-width: 260px;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
    z-index: 100;
    transition: var(--transition);
}

.sidebar .brand {
    font-weight: 800;
    font-size: 1.25rem;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    padding: 0.5rem 1rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.4rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    transition: var(--transition);
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.sidebar .nav-link.active i {
    color: var(--sidebar-active-text);
}

.sidebar .nav-link.text-danger:hover {
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger) !important;
}

/* Main Content Layout */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 100%;
    overflow-y: auto;
}

/* Heading Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

/* Card Styling */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px -15px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    transform: translate(20px, -20px);
}

.stat-card.bg-primary { background: linear-gradient(135deg, #4f46e5, #6366f1) !important; }
.stat-card.bg-success { background: linear-gradient(135deg, #059669, #10b981) !important; }
.stat-card.bg-info { background: linear-gradient(135deg, #0891b2, #06b6d4) !important; }
.stat-card.bg-warning { background: linear-gradient(135deg, #d97706, #f59e0b) !important; }

/* Buttons */
.btn {
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.4);
}

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

.btn-success:hover, .btn-success:focus {
    background-color: #0d9488;
    border-color: #0d9488;
    box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.4);
}

/* Forms & Inputs */
.form-control, .form-select {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background-color: #ffffff;
}

/* Tables */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid var(--card-border);
}

.table td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    color: var(--text-primary);
    border-bottom: 1px solid var(--card-border);
}

.table-hover tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.5);
}

/* Alert styling */
.alert {
    border-radius: 12px;
    border: none;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.alert-success { background-color: #d1fae5; color: #065f46; }
.alert-danger { background-color: #fee2e2; color: #991b1b; }

/* Welcome Screen */
.welcome-hero {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

/* Modals */
.modal-content {
    border-radius: var(--border-radius);
    border: 1px solid var(--card-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid var(--card-border);
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--card-border);
    padding: 1.25rem 1.5rem;
}

/* File Upload Drag-and-Drop Lookalike */
.file-upload-wrapper {
    border: 2px dashed #cbd5e1;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    text-align: center;
    background: rgba(248, 250, 252, 0.5);
    transition: var(--transition);
    cursor: pointer;
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload-wrapper i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.file-upload-wrapper:hover i {
    color: var(--primary);
    transform: translateY(-4px);
}

/* User Management Page */
.page-header {
    padding: 0.25rem 0.25rem 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.page-title {
    font-size: 1.7rem;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.search-panel {
    overflow: hidden;
}

.search-panel .card-body {
    padding: 1.25rem 1.5rem;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-badge.role-admin {
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
}

.role-badge.role-lecturer {
    background: rgba(6, 182, 212, 0.12);
    color: var(--info);
}

.role-badge.role-student {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4338ca, #6366f1);
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
}

.users-table-card .table-responsive {
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
}

.users-table-card .table {
    margin-bottom: 0;
}

.users-table-card .table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(226, 232, 240, 1);
}

.users-table-card {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 24px !important;
}

.users-table-card .table-responsive {
    border-radius: 24px !important;
    overflow: hidden !important;
    background: white !important;
}

.users-table-card .table {
    margin-bottom: 0 !important;
}

.users-table-card .table thead th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid rgba(226, 232, 240, 1) !important;
}

.users-table-card {
    background: transparent !important;
    border: none !important;
}

.users-table-card .table-responsive {
    border-radius: 20px !important;
    overflow: hidden !important;
    border: 1px solid #eef2f7 !important;
    background: white !important;
}

.users-table-card .table {
    margin-bottom: 0 !important;
}

.users-table-card .table thead th {
    background: #f8fafc !important;
    color: #64748b !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    font-size: 0.78rem !important;
    border-bottom: none !important;
    padding: 1.25rem 1.5rem !important;
}

.users-table-card .table tbody tr {
    background: white !important;
    border-bottom: 1px solid #eef2f7 !important;
}

.users-table-card .table tbody tr:last-child {
    border-bottom: none !important;
}

.users-table-card .table td {
    padding: 1.25rem 1.5rem !important;
    vertical-align: middle !important;
}

.users-table-card .table tbody tr:hover {
    background-color: #f8fafc !important;
}

.users-table-card .user-name-cell .user-email {
    display: none !important;
}

.users-table-card .user-name-text {
    color: #111827 !important;
}

.users-table-card .avatar-circle {
    width: 40px !important;
    height: 40px !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08) !important;
}

.users-table-card .btn-outline-warning {
    color: #f59e0b !important;
    border-color: #f59e0b !important;
    padding: 0.5rem 0.9rem !important;
    border-radius: 12px !important;
}

.users-table-card .btn-outline-danger {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    padding: 0.5rem 0.9rem !important;
    border-radius: 12px !important;
    min-width: 108px !important;
}

.users-table-card .btn-outline-danger:hover,
.users-table-card .btn-outline-danger:focus {
    background-color: rgba(239, 68, 68, 0.08) !important;
}

.users-table-card .role-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    padding: 0.55rem 1rem !important;
    border-radius: 999px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    text-transform: none !important;
    color: #fff !important;
}

.users-table-card .role-admin {
    background: #0f172a !important;
}

.users-table-card .role-lecturer {
    background: #06b6d4 !important;
}

.users-table-card .role-student {
    background: #16a34a !important;
}

/* Responsive sidebar */
@media (max-width: 991.98px) {
    .app-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-width: 100%;
        min-height: auto;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        padding: 1rem;
    }
    .sidebar .brand {
        margin-bottom: 1rem;
    }
    .sidebar .nav {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .sidebar .nav-link {
        margin-bottom: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    .main-content {
        padding: 1.5rem 1rem;
    }
}