/* RAIN LMS Stylesheet */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #333;
}

.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* Flash Messages */
.flash-messages { position: fixed; top: 20px; right: 20px; z-index: 1000; }
.flash { padding: 15px 25px; border-radius: 8px; margin-bottom: 10px; animation: slideIn 0.3s ease; }
.flash.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.flash.info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Home Page */
.home-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; text-align: center; color: white; }
.home-logo { font-size: 80px; margin-bottom: 20px; }
.home-page h1 { font-size: 3rem; margin-bottom: 10px; background: linear-gradient(90deg, #00d4ff, #7b2cbf); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.home-page .subtitle { font-size: 1.2rem; opacity: 0.8; margin-bottom: 40px; }
.home-buttons { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.home-btn { padding: 15px 40px; border-radius: 30px; text-decoration: none; font-weight: 600; transition: all 0.3s; }
.home-btn.student { background: linear-gradient(90deg, #00d4ff, #0099ff); color: white; }
.home-btn.admin { background: transparent; border: 2px solid #00d4ff; color: #00d4ff; }
.home-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3); }

/* Login Pages */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { background: white; padding: 40px; border-radius: 20px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-card h2 { text-align: center; margin-bottom: 30px; color: #1a1a2e; }
.login-card .icon { font-size: 60px; text-align: center; display: block; margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #444; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 15px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 1rem; transition: border-color 0.3s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #00d4ff; }
.btn { padding: 12px 24px; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.btn-primary { background: linear-gradient(90deg, #00d4ff, #0099ff); color: white; width: 100%; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(0, 153, 255, 0.4); }
.btn-secondary { background: #6c757d; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-warning { background: #ffc107; color: #333; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.login-card .back-link { display: block; text-align: center; margin-top: 20px; color: #666; }

/* Dashboard Layout */
.dashboard { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: #1a1a2e; padding: 20px; color: white; position: fixed; height: 100vh; overflow-y: auto; }
.sidebar-header { text-align: center; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px; }
.sidebar-header .logo { font-size: 40px; }
.sidebar-header h2 { font-size: 1.2rem; margin-top: 10px; }
.sidebar-header .role { font-size: 0.8rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 1px; }
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 5px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 15px; color: rgba(255,255,255,0.7); text-decoration: none; border-radius: 8px; transition: all 0.3s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(0, 212, 255, 0.2); color: white; }
.sidebar-nav .icon { font-size: 20px; }
.main-content { flex: 1; margin-left: 260px; padding: 30px; background: #f5f7fa; min-height: 100vh; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.page-header h1 { font-size: 1.8rem; color: #1a1a2e; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: white; padding: 25px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 20px; }
.stat-icon { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.stat-icon.blue { background: linear-gradient(135deg, #00d4ff, #0099ff); }
.stat-icon.green { background: linear-gradient(135deg, #28a745, #20c997); }
.stat-icon.purple { background: linear-gradient(135deg, #7b2cbf, #9d4edd); }
.stat-icon.orange { background: linear-gradient(135deg, #fd7e14, #ffc107); }
.stat-info h3 { font-size: 2rem; color: #1a1a2e; }
.stat-info p { color: #666; font-size: 0.9rem; }

/* Cards & Tables */
.card { background: white; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); overflow: hidden; margin-bottom: 20px; }
.card-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 1.2rem; color: #1a1a2e; }
.card-body { padding: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f8f9fa; font-weight: 600; color: #444; }
tr:hover { background: #f8f9fa; }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* Forms */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 15px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; }
.checkbox-item input[type="checkbox"] { width: 18px; height: 18px; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: white; padding: 30px; border-radius: 15px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 1.3rem; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #666; }

/* Student Dashboard */
.exam-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.exam-card { background: white; border-radius: 15px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-left: 4px solid #00d4ff; }
.exam-card h4 { font-size: 1.1rem; color: #1a1a2e; margin-bottom: 10px; }
.exam-card .course-code { font-size: 0.85rem; color: #666; margin-bottom: 15px; }
.exam-card .exam-info { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 15px; font-size: 0.9rem; color: #666; }
.exam-card .exam-info span { display: flex; align-items: center; gap: 5px; }
.result-card { border-left-color: #28a745; }
.result-card.failed { border-left-color: #dc3545; }

/* Exam Interface */
.exam-page { background: white; min-height: 100vh; }
.exam-header { background: linear-gradient(90deg, #1a1a2e, #16213e); color: white; padding: 15px 25px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; }
.exam-header h1 { font-size: 1.2rem; }
.timer { background: rgba(255,255,255,0.1); padding: 10px 20px; border-radius: 8px; font-size: 1.2rem; font-weight: 600; }
.timer.warning { background: #ffc107; color: #333; }
.timer.danger { background: #dc3545; color: white; animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.exam-body { display: flex; }
.exam-nav { width: 280px; background: #f8f9fa; padding: 20px; border-right: 1px solid #e0e0e0; position: sticky; top: 70px; height: calc(100vh - 70px); overflow-y: auto; }
.exam-nav h3 { font-size: 1rem; margin-bottom: 15px; color: #666; }
.nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.nav-btn { width: 40px; height: 40px; border: 2px solid #e0e0e0; background: white; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.nav-btn:hover { border-color: #00d4ff; }
.nav-btn.current { background: #00d4ff; color: white; border-color: #00d4ff; }
.nav-btn.answered { background: #d4edda; border-color: #28a745; color: #155724; }
.exam-questions { flex: 1; padding: 30px; max-width: 900px; margin: 0 auto; }
.question-card { display: none; }
.question-card.active { display: block; }
.question-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.question-num { font-size: 0.9rem; color: #666; }
.section-badge { padding: 5px 12px; background: #e9ecef; border-radius: 20px; font-size: 0.85rem; }
.question-text { font-size: 1.1rem; margin-bottom: 20px; line-height: 1.6; }
.code-block { background: #1e1e1e; color: #d4d4d4; padding: 15px 20px; border-radius: 8px; font-family: 'Consolas', monospace; margin-bottom: 20px; overflow-x: auto; white-space: pre-wrap; }
.options-list { display: flex; flex-direction: column; gap: 12px; }
.option-item { display: flex; align-items: center; padding: 15px 20px; border: 2px solid #e0e0e0; border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.option-item:hover { border-color: #00d4ff; background: #f8f9ff; }
.option-item.selected { border-color: #28a745; background: #d4edda; }
.option-item input { display: none; }
.option-letter { width: 35px; height: 35px; background: #f0f0f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; margin-right: 15px; }
.option-item.selected .option-letter { background: #28a745; color: white; }
.question-footer { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; }

/* Results Page */
.result-header { text-align: center; padding: 40px 20px; background: linear-gradient(135deg, #1a1a2e, #16213e); color: white; }
.score-circle { width: 180px; height: 180px; margin: 0 auto 20px; position: relative; }
.score-circle svg { transform: rotate(-90deg); }
.score-circle circle { fill: none; stroke-width: 12; }
.score-circle .bg { stroke: rgba(255,255,255,0.2); }
.score-circle .progress { stroke: #00d4ff; stroke-linecap: round; transition: stroke-dasharray 1s ease; }
.score-circle.passed .progress { stroke: #28a745; }
.score-circle.failed .progress { stroke: #dc3545; }
.score-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.score-text .percentage { font-size: 2.5rem; font-weight: 700; }
.score-text .label { font-size: 0.9rem; opacity: 0.8; }
.result-status { font-size: 1.5rem; font-weight: 600; }
.result-status.passed { color: #28a745; }
.result-status.failed { color: #dc3545; }
.result-stats { display: flex; justify-content: center; gap: 40px; margin-top: 20px; }
.result-stat { text-align: center; }
.result-stat .value { font-size: 1.5rem; font-weight: 600; }
.result-stat .label { font-size: 0.85rem; opacity: 0.8; }
.result-body { padding: 30px; max-width: 900px; margin: 0 auto; }
.review-card { background: white; border-radius: 10px; margin-bottom: 15px; border-left: 4px solid #e0e0e0; overflow: hidden; }
.review-card.correct { border-left-color: #28a745; }
.review-card.wrong { border-left-color: #dc3545; }
.review-header { padding: 15px 20px; background: #f8f9fa; display: flex; justify-content: space-between; align-items: center; }
.review-body { padding: 20px; }
.review-option { padding: 10px 15px; border-radius: 6px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.review-option.correct-answer { background: #d4edda; }
.review-option.wrong-answer { background: #f8d7da; }
.explanation { background: #fff3cd; padding: 15px; border-radius: 6px; margin-top: 15px; font-size: 0.9rem; }

/* Responsive */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .exam-nav { display: none; }
    .exam-body { flex-direction: column; }
}

/* Button outline style */
.btn-outline {
    background: transparent;
    border: 1px solid #ccc;
    color: #666;
}
.btn-outline:hover {
    background: #f0f0f0;
}

