﻿/* ================================================
   Bedaya Exams System - Styles
   ================================================ */

:root {
    --primary-color: #764ba2;
    --primary-gradient: linear-gradient(135deg, #764ba2, #667eea);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ================================================
   Base Styles
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    direction: rtl;
    background: var(--gray-50);
}

.exam-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ================================================
   Common Components
   ================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

    .btn-primary:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
    }

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

    .btn-secondary:hover:not(:disabled) {
        background: var(--gray-300);
    }

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

    .btn-success:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    }

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--gray-200);
}

    .btn-outline:hover:not(:disabled) {
        border-color: var(--primary-color);
        background: rgba(118, 75, 162, 0.05);
    }

.btn-danger-outline {
    background: white;
    color: var(--danger-color);
    border: 2px solid var(--gray-200);
}

    .btn-danger-outline:hover:not(:disabled) {
        border-color: var(--danger-color);
        background: rgba(239, 68, 68, 0.05);
    }

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

    .btn-back:hover {
        gap: 0.75rem;
    }

/* Loading & Empty States */
.loading-container,
.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.empty-state i,
.error-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-state h3,
.error-state h3 {
    font-size: 1.5rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p,
.error-state p {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.1);
    }

.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: var(--gray-700);
    }

    .form-group small {
        display: block;
        margin-top: 0.25rem;
        color: var(--gray-500);
        font-size: 0.875rem;
    }

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

/* Checkbox & Radio */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: rgba(118, 75, 162, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-public {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-private {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-overlay.large-modal .modal-content {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 2px solid var(--gray-100);
}

    .modal-header h3 {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--gray-900);
    }

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray-400);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

    .modal-close:hover {
        background: var(--gray-100);
        color: var(--gray-700);
    }

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 2px solid var(--gray-100);
}

/* ================================================
   Manage Exams Page
   ================================================ */

.exam-manage-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f2fa 100%);
    padding: 2rem 0;
}

.exam-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 2rem;
}

.exam-page-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.exam-page-subtitle {
    color: var(--gray-600);
    font-size: 1.1rem;
}

.exam-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.filter-group {
    flex: 1;
}

    .filter-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 600;
        color: var(--gray-700);
        font-size: 0.875rem;
    }

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .filter-select:focus {
        outline: none;
        border-color: var(--primary-color);
    }

.exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 3.5rem;
}

.exam-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

    .exam-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-lg);
        border-color: var(--primary-color);
    }

.exam-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
}

.exam-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.exam-category {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 600;
}

.exam-card-body {
    padding: 1.5rem;
}

.exam-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.exam-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.exam-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

    .stat-item i {
        color: var(--primary-color);
    }

.exam-card-footer {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 2px solid var(--gray-100);
}

/* ================================================
   Manage Questions Page
   ================================================ */

.questions-manage-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f2fa 100%);
    padding: 2rem 0;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.question-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

    .question-card:hover {
        box-shadow: var(--shadow-md);
    }

.question-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 2px solid var(--gray-100);
}

.question-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.question-type-badge {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.question-marks {
    margin-right: auto;
    font-weight: 600;
    color: var(--success-color);
}

.question-body {
    padding: 1.5rem;
}

.question-text {
    font-size: 1.1rem;
    color: var(--gray-900);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.question-image {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-100);
    transition: all 0.3s ease;
}

    .option-item.correct-option {
        background: rgba(16, 185, 129, 0.1);
        border-color: var(--success-color);
    }

.option-indicator i {
    color: var(--gray-400);
}

.option-item.correct-option .option-indicator i {
    color: var(--success-color);
}

.correct-answer-box {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    border-right: 4px solid var(--info-color);
}

    .correct-answer-box strong {
        display: block;
        color: var(--info-color);
        margin-bottom: 0.5rem;
    }

.question-footer {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-top: 2px solid var(--gray-100);
}

/* Options Section in Modal */
.options-section {
    margin-top: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

    .section-header h4 {
        font-size: 1.1rem;
        color: var(--gray-900);
    }

.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.option-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.tf-options {
    display: flex;
    gap: 1rem;
}

.radio-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

    .radio-option:hover {
        border-color: var(--primary-color);
    }

    .radio-option input[type="radio"] {
        width: 18px;
        height: 18px;
    }

/* ================================================
   Take Exam Page
   ================================================ */

.take-exam-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f2fa 100%);
}

/* Start Screen */
.exam-start-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.exam-info-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 3rem;
    max-width: 700px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.exam-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.exam-info-card .exam-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.exam-info-card .exam-description {
    color: var(--gray-600);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.exam-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    text-align: right;
}

    .detail-item i {
        font-size: 2rem;
        color: var(--primary-color);
    }

    .detail-item strong {
        display: block;
        color: var(--gray-900);
        margin-bottom: 0.25rem;
    }

    .detail-item span {
        color: var(--gray-600);
        font-size: 0.9rem;
    }

.exam-instructions {
    text-align: right;
    padding: 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-lg);
    border-right: 4px solid var(--info-color);
    margin-bottom: 2rem;
}

    .exam-instructions h3 {
        color: var(--info-color);
        margin-bottom: 1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .exam-instructions ul {
        list-style: none;
        padding: 0;
    }

    .exam-instructions li {
        padding: 0.5rem 0;
        color: var(--gray-700);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

        .exam-instructions li::before {
            content: "•";
            color: var(--info-color);
            font-weight: bold;
            font-size: 1.5rem;
        }

.password-section {
    margin-bottom: 1.5rem;
}

.start-button-container {
    margin-top: 2rem;
}

/* Taking Screen */
.exam-taking-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.exam-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.exam-header-info h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.exam-header-info p {
    color: var(--gray-600);
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    font-weight: 700;
}

.exam-progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.question-nav-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--gray-200);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .question-nav-btn:hover {
        border-color: var(--primary-color);
        background: rgba(118, 75, 162, 0.1);
    }

    .question-nav-btn.active {
        background: var(--primary-gradient);
        color: white;
        border-color: var(--primary-color);
    }

    .question-nav-btn.answered {
        background: rgba(16, 185, 129, 0.1);
        border-color: var(--success-color);
        color: var(--success-color);
    }

.question-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

    .question-container .question-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.5rem;
        background: var(--gray-50);
        border-bottom: 2px solid var(--gray-100);
    }

.question-content {
    padding: 2rem;
}

    .question-content .question-text {
        font-size: 1.3rem;
        line-height: 1.8;
        color: var(--gray-900);
        margin-bottom: 2rem;
    }

.answer-section {
    margin-top: 2rem;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--gray-50);
    border: 3px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

    .option-label:hover {
        border-color: var(--primary-color);
        background: rgba(118, 75, 162, 0.05);
    }

    .option-label.selected {
        background: rgba(118, 75, 162, 0.1);
        border-color: var(--primary-color);
    }

    .option-label input[type="radio"],
    .option-label input[type="checkbox"] {
        display: none;
    }

.option-indicator {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.option-label.checkbox .option-indicator {
    border-radius: var(--radius-sm);
}

.option-label.selected .option-indicator {
    border-color: var(--primary-color);
    background: var(--primary-gradient);
}

.option-text {
    flex: 1;
    font-size: 1.1rem;
    color: var(--gray-800);
}

.essay-textarea {
    min-height: 300px;
}

.question-navigation {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 1.5rem;
    background: var(--gray-50);
    border-top: 2px solid var(--gray-100);
}

/* Submit Modal */
.submit-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

    .summary-item i {
        font-size: 1.5rem;
    }

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.warning-text {
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-md);
    color: var(--gray-700);
}

/* ================================================
   Exam Results Page
   ================================================ */

.exam-results-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e8f2fa 100%);
    padding: 2rem 0;
}

.results-header {
    text-align: center;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.result-status {
    display: inline-block;
    padding: 2rem 4rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

    .result-status.passed {
        background: linear-gradient(135deg, #10b981, #059669);
        color: white;
    }

    .result-status.failed {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        color: white;
    }

.status-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.result-status h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.result-status .exam-title {
    font-size: 1.25rem;
    opacity: 0.9;
}

.score-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.score-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

    .score-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-md);
    }

    .score-card.main-score {
        grid-column: 1 / -1;
        background: var(--primary-gradient);
        color: white;
    }

.score-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.score-card:not(.main-score) .score-icon {
    background: var(--primary-gradient);
    color: white;
}

.score-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.score-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.performance-section,
.answers-section {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

    .performance-section h2,
    .answers-section h2 {
        font-size: 1.75rem;
        color: var(--gray-900);
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

.performance-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.performance-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.performance-bar {
    height: 30px;
    background: var(--gray-100);
    border-radius: 9999px;
    overflow: hidden;
}

.performance-item.correct .bar-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

.performance-item.incorrect .bar-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.performance-item.unanswered .bar-fill {
    background: linear-gradient(90deg, #6b7280, #4b5563);
}

.bar-fill {
    height: 100%;
    transition: width 1s ease;
}

.performance-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--gray-700);
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.answer-card {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 3px solid var(--gray-200);
}

    .answer-card.correct {
        border-color: var(--success-color);
        background: rgba(16, 185, 129, 0.05);
    }

    .answer-card.incorrect {
        border-color: var(--danger-color);
        background: rgba(239, 68, 68, 0.05);
    }

    .answer-card.unanswered {
        border-color: var(--gray-300);
    }

    .answer-card .answer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        background: white;
        border-bottom: 2px solid var(--gray-200);
    }

.answer-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.answer-card.correct .answer-status {
    color: var(--success-color);
}

.answer-card.incorrect .answer-status {
    color: var(--danger-color);
}

.answer-card.unanswered .answer-status {
    color: var(--gray-500);
}

.answer-body {
    padding: 1.5rem;
}

    .answer-body h4 {
        font-size: 1.1rem;
        color: var(--gray-900);
        margin-bottom: 1.5rem;
        line-height: 1.7;
    }

.options-review {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-review {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-200);
}

    .option-review.correct-option {
        background: rgba(16, 185, 129, 0.1);
        border-color: var(--success-color);
    }

    .option-review.user-selected:not(.correct-option) {
        background: rgba(239, 68, 68, 0.1);
        border-color: var(--danger-color);
    }

.text-answer-review {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
}

.user-text-answer {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    line-height: 1.7;
}

.instructor-feedback {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    border-right: 4px solid var(--info-color);
}

    .instructor-feedback strong {
        display: block;
        color: var(--info-color);
        margin-bottom: 0.5rem;
    }

.model-answer {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-md);
    border-right: 4px solid var(--success-color);
}

    .model-answer strong {
        display: block;
        color: var(--success-color);
        margin-bottom: 0.5rem;
    }

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 2rem 0;
}

/* ================================================
   Responsive Design
   ================================================ */

@media (max-width: 768px) {
    .exam-container {
        padding: 1rem;
    }

    .exam-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .exam-filters {
        flex-direction: column;
    }

    .exams-grid {
        grid-template-columns: 1fr;
    }

    .form-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .exam-details {
        grid-template-columns: 1fr;
    }

    .score-summary {
        grid-template-columns: 1fr;
    }

    .exam-header {
        flex-direction: column;
        gap: 1rem;
    }

    .question-navigation {
        flex-direction: column;
    }

    .modal-content {
        max-width: 95%;
    }
}

@media print {
    .exam-taking-container .exam-header,
    .question-navigation,
    .results-actions {
        display: none;
    }
}
