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

* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: 'Inter', sans-serif;
    background: #f6f9fc;
    color: #1e293b;
    min-height: 100vh;
}

body:has(.landing-hero),
body:has(.auth-page) {
    display: block;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
    border-right: 1px solid #e9eef5;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    box-shadow: 2px 0 12px rgba(0,0,0,0.04);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: #4a6cf7;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9eef5;
    flex-shrink: 0;
    margin-bottom: 20px;
}
.sidebar-brand span { color: #6c63ff; }

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    padding-bottom: 12px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.sidebar-nav a i { 
    font-size: 18px; 
    width: 22px; 
    text-align: center; 
    flex-shrink: 0; 
}
.sidebar-nav a:hover { background: #eef2ff; color: #4a6cf7; }
.sidebar-nav a.active {
    background: #4a6cf7;
    color: #fff;
    box-shadow: 0 4px 12px rgba(74,108,247,0.3);
}

.sidebar-footer {
    border-top: 1px solid #e9eef5;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    width: 100%;
}
.notification-bell:hover {
    background: #e9eef5;
}
.bell-icon {
    font-size: 18px;
    flex-shrink: 0;
}
.badge {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 6px;
    border-radius: 40px;
    line-height: 18px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    background: #fff;
    min-width: 300px;
    max-width: 360px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    border: 1px solid #e9eef5;
    padding: 8px 0;
    z-index: 1001;
    max-height: 320px;
    overflow-y: auto;
}
.notification-dropdown.show {
    display: block;
}
.notification-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f8faff;
    padding: 4px 8px 4px 14px;
}
.notification-item-wrapper:hover {
    background: #f8faff;
}
.notification-item {
    flex: 1;
    text-decoration: none;
    color: #1e293b;
    padding: 6px 0;
}
.noti-message {
    font-size: 13px;
    font-weight: 500;
}
.noti-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}
.dismiss-btn {
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    padding: 0 6px;
    transition: color 0.2s;
    flex-shrink: 0;
}
.dismiss-btn:hover {
    color: #ef4444;
}

.sidebar-footer .user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f1f5f9;
    min-width: 0;
}
.sidebar-footer .user-card img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    flex-shrink: 0;
}
.sidebar-footer .user-card .user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.sidebar-footer .user-card .name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-footer .user-card .email {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-footer .user-card .role-badge {
    font-size: 9px;
    color: #4a6cf7;
    background: #eef2ff;
    padding: 1px 8px;
    border-radius: 40px;
    display: inline-block;
    margin-top: 1px;
}

.sidebar-footer .sign-out {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 10px;
    color: #ef4444;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}
.sidebar-footer .sign-out:hover { background: #fef2f2; }

.hamburger { display: none; }

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 260px;
    padding: 24px 32px;
    flex: 1;
    min-height: 100vh;
    width: calc(100% - 260px);
    overflow-x: auto;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b, #4a6cf7);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-header .subtitle {
    color: #64748b;
    font-size: 13px;
    margin-top: 2px;
}

/* ===== CARDS ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid #f0f4fa;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(74,108,247,0.12); }
.stat-card .icon { font-size: 24px; margin-bottom: 6px; }
.stat-card .number { font-size: 28px; font-weight: 700; color: #1e293b; }
.stat-card .label { color: #64748b; font-size: 13px; font-weight: 500; }

.section-card {
    background: #fff;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid #f0f4fa;
    margin-bottom: 24px;
    overflow-x: auto;
}
.section-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 4px; color: #334155; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dce3ec;
    border-radius: 10px;
    font-size: 14px;
    transition: border 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 4px rgba(74,108,247,0.12);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary { background: #4a6cf7; color: #fff; box-shadow: 0 4px 12px rgba(74,108,247,0.3); }
.btn-primary:hover { background: #3a5cd9; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74,108,247,0.4); }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 2px solid #4a6cf7; color: #4a6cf7; }
.btn-outline:hover { background: #4a6cf7; color: #fff; }
.btn-sm { padding: 5px 14px; font-size: 11px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #f0f4fa; font-size: 14px; }
th { font-weight: 600; color: #475569; }
tr:hover { background: #f8faff; }

/* ===== AUTH PAGES ===== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #eef2ff 0%, #f8faff 100%);
    padding: 20px;
}
.auth-card {
    background: #fff;
    padding: 36px;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    max-width: 400px;
    width: 100%;
}
.auth-card h2 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.auth-card .sub { color: #64748b; margin-bottom: 20px; font-size: 14px; }
.auth-card .btn { width: 100%; }
.auth-card .extra { text-align: center; margin-top: 14px; font-size: 13px; color: #64748b; }
.auth-card .extra a { color: #4a6cf7; font-weight: 600; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9eef5;
    border-radius: 40px;
    overflow: hidden;
    margin: 6px 0 4px;
}
.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #4a6cf7, #6c63ff);
    border-radius: 40px;
    transition: width 0.6s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { 
        transform: translateX(-100%); 
        width: 280px; 
        padding: 20px 14px;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { 
        margin-left: 0; 
        padding: 16px; 
        width: 100%; 
    }
    .hamburger {
        display: block;
        background: none;
        border: none;
        font-size: 26px;
        cursor: pointer;
        color: #1e293b;
        position: fixed;
        top: 14px;
        left: 14px;
        z-index: 1001;
    }
    .page-header h1 { font-size: 22px; }
    .card-grid { grid-template-columns: 1fr 1fr; }
    .stat-card .number { font-size: 22px; }
}
.hamburger { display: none; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease forwards; }

/* ===== MESSAGES ===== */
.error { color: #e74c3c; margin:10px 0; background:#fde8e8; padding:8px 12px; border-radius:6px; font-size:14px; }
.success { color: #2ecc71; background:#e8f8ed; padding:8px 12px; border-radius:6px; margin:10px 0; font-size:14px; }

/* ===== TASK CHECKBOX ===== */
.task-done {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4a6cf7;
}

/* ===== ASSIGNMENT STYLES ===== */
.assignment-box {
    background: #f8faff;
    padding: 14px 16px;
    border-radius: 12px;
    margin-top: 10px;
    border-left: 4px solid #4a6cf7;
}
.assignment-box .assignment-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}
.assignment-box .assignment-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}
.assignment-box .assignment-meta .points {
    color: #4a6cf7;
    font-weight: 600;
}
.assignment-box .assignment-meta .due {
    color: #ef4444;
}
.assignment-box .assignment-file {
    margin-top: 6px;
}
.assignment-box .assignment-file a {
    color: #4a6cf7;
    font-size: 13px;
}
.assignment-box .submission-status {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 40px;
    display: inline-block;
}
.assignment-box .submission-status.status-submitted {
    background: #d1fae5;
    color: #065f46;
}
.assignment-box .submission-status.status-pending {
    background: #fef3c7;
    color: #92400e;
}
.assignment-box .submission-status.status-graded {
    background: #eef2ff;
    color: #4a6cf7;
}
.assignment-box .submission-status.status-late {
    background: #fee2e2;
    color: #991b1b;
}
.assignment-box .assignment-actions {
    margin-top: 10px;
}
.assignment-box .assignment-actions .btn {
    margin-right: 6px;
}

/* ===== MATERIAL ITEMS ===== */
.material-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f4fa;
}
.material-item:last-child { border-bottom: none; }
.material-item .material-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.material-item .material-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.material-item .material-name a {
    color: #4a6cf7;
    text-decoration: none;
}
.material-item .material-name a:hover {
    text-decoration: underline;
}
.material-item .material-desc {
    font-size: 11px;
    color: #64748b;
}
.material-item .material-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.view-only-badge {
    font-size: 10px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 1px 8px;
    border-radius: 40px;
    margin-left: 6px;
}

/* ===== UPLOAD FORM ===== */
.upload-form {
    background: #f8faff;
    padding: 14px;
    border-radius: 12px;
    margin-top: 10px;
}
.upload-form .form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
}
@media (max-width: 768px) {
    .upload-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== STUDENT LIST ===== */
.student-list {
    max-height: 350px;
    overflow-y: auto;
}
.student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f0f4fa;
}
.student-item .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-active { background: #10b981; }
.status-inactive { background: #94a3b8; }
/* Task Done Styles */
.task-done-row {
    opacity: 0.6;
    background: #f8fafc;
}
.task-completed {
    text-decoration: line-through;
    color: #94a3b8;
}
.btn-done-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.btn-done-toggle:hover {
    background: #f1f5f9;
    transform: scale(1.1);
}
.btn-delete-task {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 6px;
    transition: all 0.2s;
}
.btn-delete-task:hover {
    background: #fef2f2;
    transform: scale(1.1);
}
.notification-banner {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}