* {
    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;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.content {
    padding: 30px;
}

.setup-screen, .quiz-screen, .result-screen {
    display: none;
}

.setup-screen.active, .quiz-screen.active, .result-screen.active {
    display: block;
}

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

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

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

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

.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.mode-card {
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.mode-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

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

.mode-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.mode-card p {
    font-size: 14px;
    opacity: 0.8;
}

.mode-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #868f96 0%, #596164 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

.question-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.5;
}

.ata-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 15px;
}

.mode-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 15px;
    margin-left: 10px;
}

.mode-badge.exam {
    background: #dc3545;
}

.mode-badge.wrong-only {
    background: #ff6b6b;
}

.multi-answer-hint {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
    color: #856404;
}

.multi-answer-hint strong {
    color: #d39e00;
}

.question-image-container {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    display: none;
}

.question-image-container.show {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

.question-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.question-image-container img:hover {
    transform: scale(1.02);
}

.image-caption {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.image-badge {
    display: inline-block;
    background: #17a2b8;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 11px;
    margin-bottom: 10px;
}

.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 10px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.image-modal-close:hover {
    color: #bbb;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.answers {
    margin-bottom: 30px;
}

.answer {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 15px 20px;
    margin-bottom: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    padding-left: 50px;
}

.answer:hover:not(.disabled) {
    background: #e8e9ea;
    border-color: #667eea;
}

.answer.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.answer.correct {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.answer.incorrect {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.answer.correct-not-selected {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
    border-style: dashed;
}

.answer.disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.answer::before {
    content: attr(data-letter);
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    background: white;
    color: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.answer.selected::before {
    background: white;
    color: #667eea;
}

.answer.correct::before {
    background: white;
    color: #28a745;
    content: "✓";
}

.answer.incorrect::before {
    background: white;
    color: #dc3545;
    content: "✗";
}

.answer.correct-not-selected::before {
    background: #28a745;
    color: white;
    content: "✓";
}

.feedback-box {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    display: none;
}

.feedback-box.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.feedback-box.correct {
    background: #d4edda;
    border-left-color: #28a745;
}

.feedback-box.incorrect {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.feedback-box h4 {
    margin-bottom: 10px;
    font-size: 18px;
}

.feedback-box.correct h4 {
    color: #28a745;
}

.feedback-box.incorrect h4 {
    color: #dc3545;
}

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

.quiz-controls {
    display: flex;
    gap: 15px;
    justify-content: space-between;
}

.result-summary {
    text-align: center;
    margin-bottom: 40px;
}

.result-score {
    font-size: 72px;
    font-weight: 700;
    margin: 20px 0;
}

.result-score.pass {
    color: #28a745;
}

.result-score.fail {
    color: #dc3545;
}

.result-message {
    font-size: 24px;
    margin-bottom: 10px;
}

.statistics {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-weight: 600;
    color: #666;
}

.stat-value {
    font-weight: 700;
    color: #333;
}

.question-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
}

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

.question-item.answered {
    border-left-color: #667eea;
}

.question-item.correct {
    border-left-color: #28a745;
}

.question-item.incorrect {
    border-left-color: #dc3545;
}

.question-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.question-item-text {
    font-size: 13px;
    color: #666;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
}

.info-box strong {
    color: #1976D2;
}

.login-screen {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
}

.login-card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

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

.login-card input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}

.login-card .btn {
    width: 100%;
    margin-top: 10px;
}

.user-info {
    background: #e7f3ff;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info span {
    font-weight: 600;
    color: #1976D2;
}

.logout-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 14px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #dc3545;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.setup-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.setup-tab {
    padding: 15px 30px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.setup-tab:hover {
    color: #667eea;
}

.setup-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.setup-tab-content {
    display: none;
}

.setup-tab-content.active {
    display: block;
}

.ata-progress-item {
    margin-bottom: 20px;
}

.ata-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.ata-progress-label {
    font-weight: 600;
    color: #333;
}

.ata-progress-value {
    color: #667eea;
    font-weight: 700;
}

.ata-progress-bar-container {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.ata-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
}

.ata-progress-bar-fill.low {
    background: linear-gradient(90deg, #dc3545 0%, #c82333 100%);
}

.ata-progress-bar-fill.medium {
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
}

.ata-progress-bar-fill.high {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.question-filter-info {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }

    .question-text {
        font-size: 18px;
    }

    .result-score {
        font-size: 56px;
    }

    .quiz-controls {
        flex-direction: column;
    }

    .mode-selector {
        grid-template-columns: 1fr;
    }

    .image-modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }

    .setup-tabs {
        flex-direction: column;
        gap: 0;
    }

    .setup-tab {
        border-bottom: 1px solid #e0e0e0;
        border-left: 3px solid transparent;
    }

    .setup-tab.active {
        border-left-color: #667eea;
        border-bottom-color: #e0e0e0;
    }
 /* ATA Checkbox Container */
.ata-checkbox-container {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.ata-checkbox-item {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.ata-checkbox-item:last-child {
    border-bottom: none;
}

.ata-checkbox-item.select-all {
    background: #e7f3ff;
    padding: 14px 12px;
    margin: -20px -20px 15px -20px;
    border-bottom: 2px solid #667eea;
    border-radius: 8px 8px 0 0;
}

.ata-checkbox-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.ata-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.ata-checkbox-item span {
    font-size: 14px;
    color: #333;
    user-select: none;
    line-height: 1.4;
}

.ata-checkbox-item.select-all span {
    color: #1976D2;
}

.ata-checkbox-item:not(.select-all):hover {
    background: #f0f0f0;
}

.ata-checkbox-item.select-all:hover {
    background: #d4e9ff;
}

/* Scrollbar Styling für ATA Container */
.ata-checkbox-container::-webkit-scrollbar {
    width: 8px;
}

.ata-checkbox-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ata-checkbox-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.ata-checkbox-container::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}
}