/* University Portal - Custom Styles */
/* Built with Bootstrap 5 */

:root {
    /* Primary Colors */
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    
    /* Accent Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* UI Colors */
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-hover: #334155;
    --sidebar-active: #667eea;
    
    /* Spacing */
    --sidebar-width: 260px;
    --navbar-height: 64px;
}

/* Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

/* Dark Mode */
[data-bs-theme="dark"] {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
}

[data-bs-theme="dark"] body {
    background-color: #1e293b;
    color: #e2e8f0;
}

/* Wrapper */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand i {
    font-size: 1.75rem;
    color: var(--primary);
}

.sidebar-toggle {
    display: none;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav {
    flex-direction: column;
}

.sidebar-nav .nav-item {
    margin: 0;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--sidebar-hover);
    border-left-color: var(--sidebar-active);
}

.sidebar-nav .nav-link i {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

.nav-section {
    padding: 1.25rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(148, 163, 184, 0.6);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
}

/* Navbar Enhancements */
.navbar {
    height: var(--navbar-height);
}

.avatar-placeholder {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.avatar-placeholder-sm {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.avatar-placeholder-lg {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* Cards */
.card {
    border-radius: 0.75rem;
}

.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 0.75rem 1rem;
}

/* Stat Cards */
.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

/* Role Badges */
.badge.bg-admin, .bg-admin {
    background-color: #dc3545 !important;
}

.badge.bg-teacher, .bg-teacher {
    background-color: #0dcaf0 !important;
}

.badge.bg-student, .bg-student {
    background-color: #198754 !important;
}

/* Badge variations for action types */
.badge.bg-login, .badge.bg-logout { background-color: #6c757d !important; }
.badge.bg-create { background-color: #198754 !important; }
.badge.bg-update { background-color: #0d6efd !important; }
.badge.bg-delete { background-color: #dc3545 !important; }

/* Material type badges */
.badge.bg-lecture { background-color: #0dcaf0 !important; }
.badge.bg-assignment { background-color: #ffc107 !important; color: #000 !important; }
.badge.bg-resource { background-color: #6c757d !important; }

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom-width: 1px;
}

.table tbody td {
    vertical-align: middle;
    padding: 1rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    border-color: #e2e8f0;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-control-lg {
    padding: 0.875rem 1rem;
    font-size: 1rem;
}

/* Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    transform: translateY(-1px);
}

/* List Groups */
.list-group-item {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Pagination */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border-radius: 0.5rem;
    border: none;
    color: #64748b;
    padding: 0.5rem 0.875rem;
}

.page-link:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.page-item.active .page-link {
    background: var(--primary);
    color: #fff;
}

/* Alerts */
.alert {
    border-radius: 0.75rem;
    border: none;
}

.alert-danger { background-color: #fef2f2; color: #991b1b; }
.alert-success { background-color: #ecfdf5; color: #065f46; }
.alert-warning { background-color: #fffbeb; color: #92400e; }
.alert-info { background-color: #eff6ff; color: #1e40af; }

/* Auth Wrapper */
.auth-wrapper {
    min-height: 100vh;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.5rem;
    }
    
    .main-content {
        margin-left: 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
}
