* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

header {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.lang-switcher {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 4px;
}

.lang-btn {
    padding: 4px 10px;
    font-size: 13px;
    border: 1px solid #cbd5e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    color: #4a5568;
}

.lang-btn:hover {
    background: #edf2f7;
}

.lang-btn.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

header h1 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.exam-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 20px;
    background: #f7fafc;
    border-radius: 10px;
    font-weight: 600;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #e6fffa;
    border-radius: 10px;
    border-left: 4px solid #38b2ac;
}

.user-info p {
    margin: 0;
    font-weight: 600;
    color: #234e52;
}

#logout-btn {
    background: #f56565;
    padding: 8px 16px;
    font-size: 14px;
}

#logout-btn:hover {
    background: #e53e3e;
}

.exam-info-display {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.exam-info-display h3 {
    margin: 0 0 10px 0;
    color: #2d3748;
}

.exam-info-display p {
    margin: 5px 0;
    color: #4a5568;
}

.exam-completed {
    color: #38a169;
    font-weight: 600;
}

.exam-available {
    color: #3182ce;
    font-weight: 600;
}

.time-limit-message {
    background: #fed7d7;
    color: #c53030;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #f56565;
    text-align: center;
}

.assigned-exams-list {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.exam-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.exam-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.exam-card.completed {
    background: #f0fff4;
    border-color: #38a169;
}

.exam-card.completed:hover {
    border-color: #2f855a;
}

.exam-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.exam-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.exam-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

.exam-status.available {
    background: #bee3f8;
    color: #2b6cb0;
}

.exam-status.completed {
    background: #c6f6d5;
    color: #22543d;
}

.exam-card-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.exam-detail {
    text-align: center;
}

.exam-detail-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.exam-detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
}

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

.exam-card-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exam-card-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.exam-card-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.exam-card-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.exam-card-btn.secondary:hover:not(:disabled) {
    background: #cbd5e0;
}

.exam-card-btn:disabled {
    background: #a0aec0;
    color: #718096;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.completed-info {
    background: #e6fffa;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #234e52;
    text-align: center;
}

/* Admin Interface Styles */
.admin-controls {
    margin-top: 20px;
}

.user-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .user-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .user-selector select {
        width: 100%;
    }
    
    .user-selector button {
        width: 100%;
    }
}

.user-selector label {
    font-weight: 600;
    color: #4a5568;
}

.user-selector select {
    flex: 1;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
}

.user-selector button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.user-selector button:hover {
    background: #5a67d8;
}

.exam-matrix-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    flex-wrap: wrap;
}

.exam-matrix-selector label {
    font-weight: 600;
    color: #4a5568;
}

.exam-matrix-selector select {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
}

.exam-matrix-selector button {
    padding: 10px 20px;
    background: #38b2ac;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.exam-matrix-selector button:hover {
    background: #319795;
}

.answer-matrix-container {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.answer-matrix-container h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.answer-matrix-wrapper {
    overflow-x: auto;
    max-width: 100%;
}

.answer-matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.answer-matrix-table th,
.answer-matrix-table td {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    text-align: center;
    min-width: 36px;
}

.answer-matrix-table th {
    background: #4a5568;
    color: white;
    font-weight: 600;
}

.answer-matrix-table td.user-cell {
    text-align: left;
    font-weight: 600;
    background: #edf2f7;
    min-width: 100px;
    position: sticky;
    left: 0;
    z-index: 1;
}

.answer-matrix-table td.answer-cell.wrong {
    background: #fed7d7 !important;
}

.answer-matrix-table tbody tr:hover td.answer-cell.wrong {
    background: #fed7d7 !important;
}

.answer-matrix-table td.total-cell,
.answer-matrix-table th:last-child {
    min-width: 120px;
}

.answer-matrix-table td.total-cell {
    font-weight: 700;
    background: #e6fffa;
    color: #234e52;
}

.answer-matrix-table tr.pct-row td {
    font-weight: 700;
    background: #e2e8f0;
}

.answer-matrix-table tr.pct-row td.pct-label {
    background: #cbd5e0;
}

.answer-matrix-table tbody tr.pct-row:hover td {
    background: #e2e8f0;
}

.answer-matrix-table tbody tr:hover {
    background: #f7fafc;
}

.answer-matrix-table tbody tr:hover td.user-cell {
    background: #e2e8f0;
}

.admin-logs-container {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.admin-logs-container h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.exam-log {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.exam-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 768px) {
    .exam-log-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.exam-log-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.exam-log-score {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.exam-log-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .exam-log-details {
        grid-template-columns: 1fr;
    }
}

.exam-log-detail {
    text-align: center;
}

.exam-log-detail-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.exam-log-detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.question-log {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 3px solid #e2e8f0;
}

.question-log.correct {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.question-log.incorrect {
    border-left-color: #f56565;
    background: #fed7d7;
}

.question-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.question-number {
    font-weight: 600;
    color: #2d3748;
}

.question-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.question-status.correct {
    background: #c6f6d5;
    color: #22543d;
}

.question-status.incorrect {
    background: #fed7d7;
    color: #c53030;
}

.question-text {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 10px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-line;
}

.question-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .question-answers {
        grid-template-columns: 1fr;
    }
}

.answer-item {
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    border: 2px solid transparent;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.answer-item.user-answer {
    background: #bee3f8;
    color: #2b6cb0;
    font-weight: 600;
    border-color: #90cdf4;
}

.answer-item.correct-answer {
    background: #c6f6d5;
    color: #22543d;
    font-weight: 600;
    border-color: #9ae6b4;
}

.question-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #718096;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 768px) {
    .question-stats {
        flex-direction: column;
        align-items: flex-start;
    }
}

.question-time, .question-views {
    font-weight: 600;
}

.question-review {
    font-weight: 600;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.question-review.marked {
    color: #ed8936;
    font-weight: 700;
}

.answer-changes {
    margin-top: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.answer-changes-header {
    font-weight: bold;
    color: #856404;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.answer-change {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 2px 0;
    font-size: 0.85em;
    flex-wrap: wrap;
}

.change-from {
    background-color: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.change-to {
    background-color: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.change-time {
    color: #6c757d;
    font-style: italic;
}

.section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.section > h2 {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

button:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.question-container {
    max-width: 600px;
    margin: 0 auto;
}

.question-header h3 {
    margin-bottom: 20px;
    color: #2d3748;
    line-height: 1.6;
    font-size: 1.3rem;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-line;
}

.image-container {
    margin: 20px 0;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.options-container {
    margin: 30px 0;
}

.option {
    display: block;
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    text-align: left;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    hyphens: auto;
}

.option:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.option.selected {
    background: #e6fffa;
    border-color: #38b2ac;
    color: #234e52;
}

.option input[type="radio"] {
    margin-right: 10px;
}

/* Handle very long text in options */
.option label {
    display: inline;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
    white-space: pre-line;
}

/* For very long options, use a monospace font for better readability */
.option.long-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.3;
}

.question-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.question-controls button {
    flex: 1;
}

.results-container {
    text-align: center;
}

.score-display {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.score-display h3 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.score-display p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.detailed-results {
    display: none; /* Hidden for users */
}

.question-detail {
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #e2e8f0;
}

.question-detail.correct {
    border-left-color: #48bb78;
}

.question-detail.incorrect {
    border-left-color: #f56565;
}

.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    font-weight: 600;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.connected {
    background: #48bb78;
}

.status-indicator.disconnected {
    background: #f56565;
}

.status-indicator.connecting {
    background: #ed8936;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .exam-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .question-controls {
        flex-direction: column;
    }
    
    .connection-status {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 20px;
        text-align: center;
    }
}

.resume-message {
    background: #e6fffa;
    border: 2px solid #38b2ac;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #234e52;
    font-weight: 500;
    text-align: center;
    animation: fadeInOut 5s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

.previous-answer-info {
    background: #e6fffa;
    border: 2px solid #38b2ac;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
}

.previous-answer-message {
    color: #234e52;
    font-weight: 500;
    font-size: 0.9rem;
}

.option.selected {
    background: #e6fffa;
    border-color: #38b2ac;
    font-weight: 600;
}

.option.selected label {
    color: #234e52;
}

.question-navigation {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
}

.question-navigation h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.question-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 10px;
}

.question-btn {
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #4a5568;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 50px;
}

.question-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.question-btn.current {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.question-btn.answered {
    border-color: #38a169;
    background: #c6f6d5;
    color: #22543d;
}

.question-btn.answered.current {
    border-color: #38a169;
    background: #38a169;
    color: white;
}

.question-btn.marked-for-review {
    border-color: #ed8936;
    background: #fed7aa;
    color: #9a3412;
}

.question-btn.marked-for-review.current {
    border-color: #ed8936;
    background: #ed8936;
    color: white;
}


.question-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.question-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.question-buttons button {
    flex: 1;
    min-width: 0;
}

.question-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.question-actions .nav-btn,
.question-actions .finish-btn {
    flex: 1;
    width: calc(50% - 7.5px);
}

@media (max-width: 768px) {
    .question-buttons {
        flex-direction: column;
    }
    
    .question-buttons button {
        width: 100%;
    }
    
    .question-actions {
        flex-direction: column;
    }
    
    .question-actions .nav-btn,
    .question-actions .finish-btn {
        width: 100%;
    }
}


.review-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #4a5568;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.review-btn.marked {
    border-color: #ed8936;
    background: #fed7aa;
    color: #9a3412;
}

.no-answer-btn {
    padding: 8px 16px;
    border: 2px solid #e53e3e;
    border-radius: 6px;
    background: white;
    color: #e53e3e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.no-answer-btn:hover {
    background: #e53e3e;
    color: white;
}

.nav-btn {
    padding: 10px 20px;
    border: 2px solid #4299e1;
    border-radius: 6px;
    background: white;
    color: #4299e1;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 5px;
}

.nav-btn:hover {
    background: #4299e1;
    color: white;
}

.nav-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

.finish-btn {
    padding: 12px 24px;
    border: 2px solid #38a169;
    border-radius: 6px;
    background: #38a169;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.finish-btn:hover {
    background: #2f855a;
    border-color: #2f855a;
}


/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

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

.modal-header h2 {
    margin: 0;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #4a5568;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Exam Rules Modal Styles */
.exam-rules-content {
    max-width: 600px;
    max-height: 80vh;
    margin: auto;
}

.exam-rules-content .modal-body {
    max-height: 60vh;
}

.exam-rules-section {
    margin-bottom: 25px;
}

.exam-rules-section h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.exam-description {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
    font-size: 1.1rem;
    line-height: 1.6;
}

.exam-instructions {
    background: #f0fff4;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #48bb78;
}

.exam-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.exam-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.exam-warnings {
    background: #fed7d7;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #f56565;
}

.exam-warnings ul {
    margin: 0;
    padding-left: 20px;
}

.exam-warnings li {
    margin-bottom: 8px;
    line-height: 1.5;
    font-weight: 500;
}

.rules-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.start-exam-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.start-exam-btn:hover {
    background: #38a169;
}

.cancel-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cancel-btn:hover {
    background: #cbd5e0;
}

.all-questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.question-card {
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.question-card:hover {
    border-color: #4299e1;
    background: #f7fafc;
}

.question-card.current {
    border-color: #4299e1;
    background: #ebf8ff;
}

.question-card.answered {
    border-color: #38a169;
    background: #f0fff4;
}

.question-card.marked-for-review {
    border-color: #ed8936;
    background: #fffaf0;
}


.question-number {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.question-status {
    font-size: 12px;
    color: #4a5568;
}

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