/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background-color: #343a40;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header .logo {
    font-size: 24px;
    font-weight: bold;
}

header .user-info {
    text-align: right;
}

/* Login/Register Forms */
.login-container, .register-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0069d9;
}

.btn-block {
    display: block;
    width: 100%;
}

.alert {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Exam Styles */
.exam-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.timer {
    font-size: 24px;
    font-weight: bold;
    color: #dc3545;
    background: #f8d7da;
    padding: 5px 15px;
    border-radius: 4px;
}

.question-box {
    display: none;
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.question-content {
    margin-bottom: 20px;
}

.question-image img {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
}

.question-options {
    margin-bottom: 20px;
}

.form-check {
    margin-bottom: 10px;
}

.form-check-input {
    margin-right: 10px;
}

.question-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* Results Styles */
.results-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.summary-card {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.summary-item {
    text-align: center;
}

.summary-item h4 {
    margin-bottom: 5px;
    color: #6c757d;
}

.summary-item p {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.answer-item {
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.answer-item.correct {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.answer-item.incorrect {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.answer-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.status {
    font-weight: bold;
}

.answer-item.correct .status {
    color: #28a745;
}

.answer-item.incorrect .status {
    color: #dc3545;
}

/* Instructor/Admin Styles */
.instructor-dashboard, .admin-dashboard {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.05);
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    width: 30%;
}

.stat-card h3 {
    margin-bottom: 10px;
    color: #6c757d;
}

.stat-card p {
    font-size: 28px;
    font-weight: bold;
    margin: 0;
}

.quick-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Dashboard Styles */
.student-dashboard, .instructor-dashboard {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.card {
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    margin: 0;
    font-size: 18px;
}

.card-body {
    padding: 15px;
}

.stat-item {
    margin-bottom: 15px;
}

.stat-item h4 {
    margin-bottom: 5px;
    font-size: 14px;
    color: #6c757d;
}

.stat-item p {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.upcoming-exams {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upcoming-exams li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.upcoming-exams li:last-child {
    border-bottom: none;
}

.recent-results {
    width: 100%;
    border-collapse: collapse;
}

.recent-results th, .recent-results td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.recent-results th {
    font-size: 14px;
    color: #6c757d;
}

.quick-actions {
    display: flex;
    gap: 10px;
}

.progress {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #28a745;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .exam-header, .question-header, .summary-card {
        flex-direction: column;
    }
    
        .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }

    .timer {
        margin-top: 10px;
    }
    
    .stats-container {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-card {
        width: 80%;
        margin-bottom: 15px;
    }
    
    .quick-links {
        flex-direction: column;
    }
}