/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --primary-dark: #357abd;
    --secondary-color: #50c878;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #27ae60;
    --info-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #333;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
    direction: rtl;
}

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

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.admin-nav {
    display: flex;
    gap: 1rem;
}

.admin-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.admin-nav a:hover {
    background: rgba(255,255,255,0.2);
}

/* Footer */
.main-footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.copyright {
    margin: 0;
}

.copyright a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.copyright a:hover {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 0;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.hero-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #666;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #2980b9;
}

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

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Exams Grid */
.exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.exam-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.exam-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.exam-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.8;
}

.exam-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light-color);
    border-radius: 5px;
}

.info-item {
    color: #555;
    font-size: 0.9rem;
}

/* Exam Form */
.exam-header {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
}

.exam-header h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.exam-timer {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--warning-color);
}

.student-info {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.questions-container {
    margin-bottom: 2rem;
}

.question-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-color);
}

.question-header h3 {
    color: var(--primary-color);
}

.question-type {
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.question-answer {
    margin-top: 1rem;
}

.true-false-options {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.1);
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.chronological-options {
    margin-top: 1rem;
}

.sortable-list {
    list-style: none;
    padding: 0;
}

.sortable-item {
    background: var(--light-color);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background 0.3s;
}

.sortable-item:hover {
    background: #d5dbdb;
}

.sortable-item.dragging {
    opacity: 0.5;
}

.drag-handle {
    font-size: 1.2rem;
    color: #999;
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Result Page */
.result-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    max-width: 1000px;
    margin: 2rem auto;
}

.result-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid rgba(74, 144, 226, 0.2);
}

.result-header h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.result-header h3 {
    color: #555;
    font-size: 1.5rem;
    font-weight: normal;
}

.result-summary {
    margin-bottom: 3rem;
}

.score-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transition: transform 0.3s ease;
}

.score-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    animation: ripple 2s ease-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes ripple {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

.score-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    font-size: 1.2rem;
}

.score-details p {
    margin: 0;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border-radius: 10px;
    border-right: 4px solid var(--primary-color);
}

.score-details strong {
    color: var(--primary-color);
    font-size: 1.1em;
}

.answers-review {
    margin-top: 3rem;
}

.answers-review h3 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(74, 144, 226, 0.2);
}

.answer-item {
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 15px;
    border-right: 5px solid;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.answer-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.answer-item.correct {
    background: linear-gradient(135deg, #d5f4e6 0%, #a8e6cf 100%);
    border-color: #27ae60;
}

.answer-item.incorrect {
    background: linear-gradient(135deg, #fadbd8 0%, #f5b7b1 100%);
    border-color: #e74c3c;
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.answer-header h4 {
    color: var(--dark-color);
    font-size: 1.3rem;
    margin: 0;
}

.answer-status {
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.answer-item.correct .answer-status {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.answer-item.incorrect .answer-status {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.question-text {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    border-right: 3px solid var(--primary-color);
}

.answer-details {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255,255,255,0.6);
    border-radius: 10px;
}

.answer-details p {
    margin: 0.75rem 0;
    font-size: 1.05rem;
    line-height: 1.8;
}

.answer-details strong {
    color: var(--primary-color);
    font-size: 1.1em;
}

.correct-answer {
    color: #27ae60;
    font-weight: bold;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(39, 174, 96, 0.1);
    border-radius: 8px;
    border-right: 3px solid #27ae60;
}

.result-actions {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(74, 144, 226, 0.2);
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.result-actions .btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.result-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.exams-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.exams-section h3 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--light-color);
    font-weight: bold;
    color: var(--dark-color);
}

.data-table tr:hover {
    background: #f8f9fa;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.dashboard-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Form Container */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.questions-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--light-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.section-hint {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f0f7ff;
    border-radius: 5px;
    border-right: 3px solid var(--primary-color);
}

#scroll-top-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    animation: fadeIn 0.3s;
}

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

.question-editor {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.question-editor:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}

.question-actions .btn {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.question-header-editor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-header-editor h4 {
    color: var(--primary-color);
}

.question-options-container {
    margin-top: 1rem;
}

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-form select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.result-details-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.result-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-color);
    border-radius: 10px;
}

.info-item {
    padding: 0.5rem 0;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fadbd8;
    color: #c0392b;
    border-right: 4px solid var(--danger-color);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.empty-state a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-section h2 {
        font-size: 1.8rem;
    }
    
    .exams-grid {
        grid-template-columns: 1fr;
    }
    
    .student-info {
        grid-template-columns: 1fr;
    }
    
    .score-card {
        flex-direction: column;
    }
    
    .dashboard-header,
    .results-header {
        flex-direction: column;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .answer-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .main-content {
        padding: 1rem 0;
    }
    
    .exam-card,
    .question-card,
    .form-container {
        padding: 1rem;
    }
    
    .login-box {
        padding: 2rem 1.5rem;
    }
}

/* Exam Enhancements Styles */
.exam-navigation {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    width: 200px;
    max-height: 70vh;
    overflow-y: auto;
    transition: all 0.3s;
}

.exam-navigation.collapsed {
    width: 50px;
}

.exam-navigation.collapsed .nav-questions {
    display: none;
}

.nav-header {
    padding: 1rem;
    border-bottom: 2px solid var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--primary-color);
}

.nav-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

.nav-questions {
    padding: 0.5rem;
}

.nav-question-item {
    margin-bottom: 0.5rem;
}

.nav-question-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-question-item a:hover {
    background: var(--light-color);
}

.nav-number {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
}

.nav-status {
    font-size: 1.2rem;
}

.question-mark-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.3s;
    padding: 0.5rem;
}

.question-mark-btn:hover {
    opacity: 0.7;
}

.question-mark-btn.marked {
    opacity: 1;
    color: #f39c12;
}

.question-card.highlight {
    animation: highlight 2s ease-in-out;
}

@keyframes highlight {
    0%, 100% { background: white; }
    50% { background: #fff3cd; }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-info {
    background: var(--info-color);
    color: white;
}

.notification-success {
    background: var(--success-color);
    color: white;
}

.notification-warning {
    background: var(--warning-color);
    color: white;
}

.notification-danger {
    background: var(--danger-color);
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 2px solid var(--light-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.preview-summary h4 {
    margin: 1rem 0;
    color: var(--dark-color);
}

.preview-item {
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--light-color);
    border-radius: 5px;
    border-right: 3px solid var(--primary-color);
}

.question-image {
    margin-top: 1rem;
}

.question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: var(--shadow);
}

.attachment-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.attachment-link:hover {
    background: var(--primary-dark);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .header, .footer, .main-header, .main-footer, .result-actions, .header-actions,
    .result-header, .btn, button, .actions, .grading-actions, .question-actions,
    .no-print, .share-link-box, .admin-nav {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
        margin: 0;
    }
    
    .result-container, .result-details-container, .grade-exam-container {
        box-shadow: none;
        border: none;
        padding: 0;
    }
    
    .result-header h2, .grade-header h2 {
        color: black;
        page-break-after: avoid;
    }
    
    .score-card {
        page-break-inside: avoid;
    }
    
    .answer-item, .grading-question-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    @page {
        margin: 2cm;
    }
}

@media (max-width: 768px) {
    .exam-navigation {
        left: 10px;
        width: 150px;
    }
    
    .exam-navigation.collapsed {
        width: 40px;
    }
    
    .nav-number {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

