:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --background-color: #f0f4ff;
    --font-family: 'Poppins', sans-serif;
    --border-radius: 12px;
}

body {
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    color: var(--dark-color);
}

#app-container {
    width: 90%;
    max-width: 800px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    overflow: hidden;
    position: relative;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fade-in 0.5s ease-in-out;
}

.screen.active {
    display: flex;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo {
    max-width: 150px;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.start-image, .results-image {
    max-width: 300px;
    margin: 1rem 0;
}

.instructions {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.main-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 1rem;
}

.main-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.main-btn:disabled {
    background-color: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
}

#test-screen {
    width: 100%;
}

#test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
}

#timer, #question-counter {
    font-size: 1rem;
    font-weight: 600;
    background-color: #e9ecef;
    padding: 8px 16px;
    border-radius: var(--border-radius);
}

#progress-container {
    flex-grow: 1;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    margin: 0 1rem;
    overflow: hidden;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--success-color);
    transition: width 0.3s ease;
}

#question-content {
    width: 100%;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#question-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.question-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
}

.option-btn {
    background-color: var(--light-color);
    border: 2px solid #ddd;
    padding: 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    text-align: center;
}

.option-btn:hover {
    background-color: #e2e6ea;
    border-color: #b9c1cb;
}

.option-btn.selected {
    background-color: #cce5ff;
    border-color: var(--primary-color);
    font-weight: 600;
}
.option-btn.correct {
    background-color: #d4edda;
    border-color: var(--success-color);
}
.option-btn.incorrect {
    background-color: #f8d7da;
    border-color: var(--danger-color);
}
.option-btn:disabled {
    cursor: not-allowed;
}

#navigation-buttons {
    margin-top: 1.5rem;
    width: 100%;
    text-align: right;
}

/* Listening & Speaking styles */
.audio-player {
    margin: 1rem 0;
}

#record-btn {
    background-color: var(--danger-color);
    position: relative;
    padding-left: 40px;
}
#record-btn.recording {
    background-color: #c82333;
}
#record-btn::before {
    content: '●';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    line-height: 1;
}
#record-btn.recording::before {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

#recording-status {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

/* Results Screen */
#results-screen p {
    font-size: 1.2rem;
    margin: 0.5rem 0;
}
.result-box {
    font-size: 2rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    background-color: #e9ecef;
}
#cefr-level-result {
    color: var(--primary-color);
}
#score-result {
    color: var(--success-color);
}
#feedback-text {
    font-size: 1rem;
    color: var(--secondary-color);
    max-width: 80%;
}

@media (max-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
    #test-header {
        flex-direction: column;
        gap: 1rem;
    }
}

