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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    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, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.level-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.global-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 10px 20px;
    font-size: 1em;
    border: 2px solid white;
    border-radius: 20px;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: white;
    color: #667eea;
}

.control-btn.active {
    background: white;
    color: #667eea;
}

.test-selection {
    padding: 30px;
}

.classification-section {
    margin-bottom: 40px;
}

.classification-section h2 {
    font-size: 1.8em;
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

.test-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.test-btn {
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: bold;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.test-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.test-btn:disabled:hover {
    transform: none;
    background: white;
    color: #667eea;
}

.questions-container {
    padding: 30px;
}

.questions-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    background: #5a6fd8;
}

#questionsTitle {
    font-size: 1.8em;
    color: #333;
}

.questions-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.question-item {
    padding: 25px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.question-item:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.1);
}

.question-item.group {
    background: #fff3cd;
    border-color: #ffc107;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.question-number {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

.question-text-wrapper {
    flex: 1;
}

.question-content {
    font-size: 1.1em;
    line-height: 1.8;
    color: #333;
}

.question-content u {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: #667eea;
}

.question-translation {
    color: #555;
    font-size: 0.95em;
    margin-top: 10px;
    padding: 12px;
    background-color: #f0f4ff;
    border-left: 4px solid #667eea;
    border-radius: 0 4px 4px 0;
    line-height: 1.6;
}

.audio-player {
    margin: 15px 0;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 10px;
    border: 1px solid #2196f3;
}

.audio-iframe {
    width: 100%;
    height: 80px;
    border: none;
    border-radius: 5px;
}

.question-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.toggle-btn {
    padding: 8px 15px;
    font-size: 0.9em;
    border: 1px solid #667eea;
    border-radius: 20px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #667eea;
    color: white;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
}

.translation-content,
.reading-content {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    display: none;
}

.translation-content.active,
.reading-content.active {
    display: block;
}

.translation-content h4,
.reading-content h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1em;
}

.translation-content p,
.reading-content p,
.translation-content > div,
.reading-content > div {
    line-height: 1.8;
    color: #555;
}

.translation-content > div,
.reading-content > div {
    white-space: pre-wrap;
}

.choices {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-item {
    padding: 12px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.choice-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.choice-item.correct {
    background: #c8e6c9;
    border-color: #4caf50;
    transition: all 0.3s ease;
}

.choice-item.incorrect {
    background: #ffcdd2;
    border-color: #f44336;
}

.choice-number {
    font-weight: bold;
    color: #667eea;
    margin-right: 10px;
}

.choice-translation {
    color: #555;
    font-size: 0.9em;
    margin-top: 8px;
    padding: 10px;
    background-color: #f0f4ff;
    border-left: 3px solid #667eea;
    border-radius: 0 4px 4px 0;
    line-height: 1.6;
}

.answer-toggle-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.answer-info {
    padding: 10px 15px;
    background: #e8f5e9;
    border-radius: 8px;
    font-weight: bold;
    color: #2e7d32;
}

.answer-toggle {
    align-self: flex-start;
}

.highlight-number {
    color: #667eea;
    font-weight: bold;
}

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

    .level-tabs {
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 20px;
        font-size: 1em;
    }

    .test-buttons {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .test-btn {
        padding: 12px 15px;
        font-size: 1em;
    }

    .question-header {
        flex-direction: column;
    }

    .questions-container {
        padding: 20px;
    }
}

