* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #1a1a2e; line-height: 1.6; }

/* Login */
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #0f3460 0%, #16213e 100%); }
.login-card { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); width: 100%; max-width: 420px; }
.login-card h1 { text-align: center; color: #0f3460; margin-bottom: 8px; font-size: 24px; }
.login-card .subtitle { text-align: center; color: #666; margin-bottom: 30px; font-size: 14px; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: #0f3460; color: #fff; position: fixed; height: 100vh; overflow-y: auto; transition: transform 0.3s; z-index: 1000; }
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h3 { font-size: 18px; }
.sidebar-toggle { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; display: none; }
.sidebar-nav { padding: 10px 0; }
.nav-link { display: block; padding: 12px 20px; color: rgba(255,255,255,0.8); text-decoration: none; transition: all 0.2s; font-size: 14px; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.1); color: #fff; }
.main-content { flex: 1; margin-left: 250px; }
.topbar { background: #fff; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 4px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; }
.menu-btn { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }
.topbar-right { display: flex; align-items: center; gap: 15px; }
.user-name { font-weight: 500; color: #333; }
.btn-logout { color: #e74c3c; text-decoration: none; font-size: 14px; font-weight: 500; }
.content { padding: 30px; }

/* Cards & Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-card .label { font-size: 13px; color: #666; margin-bottom: 5px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #0f3460; }
.stat-card.success .value { color: #27ae60; }
.stat-card.warning .value { color: #f39c12; }
.stat-card.danger .value { color: #e74c3c; }

/* Buttons */
.btn { display: inline-block; padding: 10px 20px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: none; transition: all 0.2s; }
.btn-primary { background: #0f3460; color: #fff; }
.btn-primary:hover { background: #1a4a8a; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #f39c12; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-outline { background: transparent; border: 1px solid #ddd; color: #333; }
.btn-outline:hover { background: #f5f5f5; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; color: #333; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: border-color 0.2s; }
.form-control:focus { outline: none; border-color: #0f3460; box-shadow: 0 0 0 3px rgba(15,52,96,0.1); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* Tables */
.table-container { background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; }
.table-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; flex-wrap: wrap; gap: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
th { background: #f8f9fa; font-weight: 600; color: #555; }
tr:hover { background: #f8f9fa; }
.table-responsive { overflow-x: auto; }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-secondary { background: #e2e3e5; color: #383d41; }

/* Alerts */
.alert { padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; justify-content: center; align-items: center; }
.modal { background: #fff; border-radius: 10px; width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #666; }
.modal-body { padding: 20px; }
.modal-footer { padding: 15px 20px; border-top: 1px solid #eee; display: flex; justify-content: flex-end; gap: 10px; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { font-size: 24px; color: #1a1a2e; }
.page-header h2 { font-size: 20px; color: #1a1a2e; }

/* Filters */
.filters { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filters .form-control { width: auto; min-width: 150px; }

/* Pagination */
.pagination { display: flex; gap: 5px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 6px; text-decoration: none; font-size: 14px; }
.pagination a { background: #fff; border: 1px solid #ddd; color: #333; }
.pagination a:hover { background: #0f3460; color: #fff; border-color: #0f3460; }
.pagination .active { background: #0f3460; color: #fff; border: 1px solid #0f3460; }

/* Exam Take */
.exam-container { display: grid; grid-template-columns: 250px 1fr; gap: 20px; }
.question-nav { background: #fff; border-radius: 10px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: sticky; top: 80px; }
.question-nav h4 { margin-bottom: 10px; font-size: 14px; }
.nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.nav-item { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid #ddd; cursor: pointer; font-size: 13px; background: #fff; transition: all 0.2s; }
.nav-item.answered { background: #27ae60; color: #fff; border-color: #27ae60; }
.nav-item.current { border-color: #0f3460; box-shadow: 0 0 0 2px rgba(15,52,96,0.3); }
.question-area { background: #fff; border-radius: 10px; padding: 30px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.question-number { font-size: 14px; color: #666; margin-bottom: 8px; }
.question-text { font-size: 18px; font-weight: 500; margin-bottom: 20px; line-height: 1.6; }
.question-marks { font-size: 13px; color: #0f3460; font-weight: 500; margin-bottom: 15px; }
.option-list { list-style: none; }
.option-item { padding: 12px 15px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 10px; }
.option-item:hover { border-color: #0f3460; background: #f8f9fa; }
.option-item.selected { border-color: #0f3460; background: rgba(15,52,96,0.05); }
.option-item input { margin: 0; }
.question-nav-bottom { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 15px; border-top: 1px solid #eee; }
.timer { background: #0f3460; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 16px; font-weight: 600; display: inline-block; }

/* Result */
.result-card { background: #fff; border-radius: 10px; padding: 30px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-align: center; margin-bottom: 20px; }
.result-card .pass { color: #27ae60; font-size: 32px; font-weight: 700; }
.result-card .fail { color: #e74c3c; font-size: 32px; font-weight: 700; }
.result-card .pending { color: #f39c12; font-size: 32px; font-weight: 700; }
.result-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin: 20px 0; }
.result-stat { text-align: center; }
.result-stat .label { font-size: 13px; color: #666; }
.result-stat .value { font-size: 24px; font-weight: 700; color: #0f3460; }
.answer-review { text-align: left; }
.answer-review .question-block { padding: 20px; border: 1px solid #eee; border-radius: 8px; margin-bottom: 15px; }
.answer-review .correct { border-left: 4px solid #27ae60; }
.answer-review .wrong { border-left: 4px solid #e74c3c; }
.answer-review .pending-eval { border-left: 4px solid #f39c12; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: #666; }
.empty-state h3 { margin-bottom: 10px; color: #333; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; }
    .menu-btn { display: block; }
    .form-row { grid-template-columns: 1fr; }
    .exam-container { grid-template-columns: 1fr; }
    .question-nav { position: static; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 15px; }
}

/* Course Card */
.course-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: box-shadow 0.2s; }
.course-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.course-card .course-thumb { width: 100%; height: 160px; object-fit: cover; }
.course-card .course-thumb-placeholder { width: 100%; height: 160px; background: linear-gradient(135deg, #0f3460 0%, #16213e 100%); display: flex; align-items: center; justify-content: center; }
.course-card .course-thumb-placeholder span { color: #fff; font-size: 32px; font-weight: 700; }
.course-card .course-body { padding: 20px; }

/* Tab Navigation */
.tab-nav { display: flex; border-bottom: 1px solid #eee; }
.tab-nav a { padding: 15px 25px; text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; color: #666; transition: all 0.2s; }
.tab-nav a:hover { color: #0f3460; }
.tab-nav a.active { border-bottom-color: #0f3460; color: #0f3460; }

/* Certificate Badge */
.certificate-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; background: #d4edda; color: #155724; }
.certificate-badge.locked { background: #e2e3e5; color: #383d41; }

/* Material Viewer Protection */
.material-viewer { position: relative; }
.material-viewer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; pointer-events: none; }

/* Course Stats */
.course-stat { text-align: center; padding: 15px; }
.course-stat .label { font-size: 13px; color: #666; margin-bottom: 5px; }
.course-stat .value { font-size: 24px; font-weight: 700; color: #0f3460; }

/* Enrollment Modal */
.enrollment-list { max-height: 300px; overflow-y: auto; }
.enrollment-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eee; cursor: pointer; }
.enrollment-item:hover { background: #f8f9fa; }
