* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background: linear-gradient(135deg, #1e3a8a 0%, #dc2626 50%, #1e3a8a 100%);
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.union-jack-mini {
    width: 40px;
    height: 24px;
    background: linear-gradient(45deg, #dc2626 0%, #dc2626 33%, #ffffff 33%, #ffffff 66%, #1e3a8a 66%);
    border: 2px solid white;
    border-radius: 4px;
    position: relative;
}

.union-jack-mini::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
    transform: translateY(-50%);
}

.union-jack-mini::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: white;
    transform: translateX(-50%);
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.screen {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: none;
    position: relative;
    overflow: hidden;
}

.screen.active {
    display: block;
}

/* Welcome Screen */
.welcome-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.union-jack-bg {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 120px;
    background: linear-gradient(45deg, #dc2626 0%, #dc2626 33%, #ffffff 33%, #ffffff 66%, #1e3a8a 66%);
    opacity: 0.05;
    transform: rotate(15deg);
    z-index: 1;
}

.welcome-content h2 {
    color: #1a202c;
    margin-bottom: 15px;
    font-size: 2rem;
    font-weight: 700;
}

.subtitle {
    color: #4a5568;
    font-size: 1.1rem;
    margin-bottom: 40px;
    font-weight: 400;
}

.test-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.info-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.info-card h3 {
    color: #1e3a8a;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-card p {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-record {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-record {
    background: #48bb78;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px auto;
    font-size: 1.1rem;
}

.btn-record:hover {
    background: #38a169;
}

.btn-record:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.btn-record.recording {
    background: #e53e3e;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Test Screen */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #667eea;
    transition: width 0.3s ease;
    width: 0%;
}

.question-counter {
    text-align: center;
    color: #718096;
    margin-bottom: 30px;
    font-weight: 600;
}

#question-container {
    margin-bottom: 30px;
}

#question-title {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

#question-text {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    font-size: 1.1rem;
    line-height: 1.8;
}

.timer {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #e53e3e;
    margin: 20px 0;
}

#recording-container {
    text-align: center;
    margin: 30px 0;
}

.recording-status {
    margin: 15px 0;
    font-weight: 600;
    min-height: 24px;
}

.recording-status.recording {
    color: #e53e3e;
}

.recording-status.completed {
    color: #48bb78;
}

.visualizer {
    height: 60px;
    background: #f7fafc;
    border-radius: 10px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #cbd5e0;
}

.controls {
    text-align: center;
    margin-top: 30px;
}

/* Results Screen */
.cefr-result {
    text-align: center;
    margin-bottom: 40px;
}

.level-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.feedback-sections {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.feedback-section h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.score-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    transition: width 1s ease;
    border-radius: 10px;
}

.feedback-section p {
    color: #4a5568;
    line-height: 1.6;
}

.actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .screen {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .cefr-levels {
        flex-direction: column;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary, .btn-record {
        width: 100%;
    }
}
/
* Instructions Screen */
.instructions-content {
    text-align: center;
}

.instructions-content h2 {
    color: #1a202c;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 600;
}

.audio-instructions {
    margin: 30px 0;
}

.btn-audio {
    background: #1e3a8a;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.btn-audio:hover {
    background: #1e40af;
    transform: translateY(-2px);
}

.instructions-text {
    background: #f8fafc;
    padding: 25px;
    border-radius: 15px;
    border-left: 4px solid #1e3a8a;
    margin: 30px 0;
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #2d3748;
}

.countdown-container {
    margin: 40px 0;
}

.countdown-circle {
    width: 120px;
    height: 120px;
    border: 6px solid #dc2626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    animation: countdown-pulse 1s infinite;
}

.countdown-circle span {
    font-size: 3rem;
    font-weight: 700;
    color: #dc2626;
}

@keyframes countdown-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Test Screen Updates */
.test-header {
    margin-bottom: 30px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e3a8a, #dc2626);
    transition: width 0.5s ease;
}

.part-indicator {
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

#question-display {
    text-align: center;
    margin-bottom: 30px;
}

#question-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 20px;
    padding: 25px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 15px;
    border: 2px solid #0ea5e9;
}

/* Picture Container */
#picture-container {
    text-align: center;
    margin: 30px 0;
}

#test-picture {
    max-width: 100%;
    max-height: 400px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.picture-instruction {
    font-size: 1.1rem;
    color: #4a5568;
    font-style: italic;
}

/* Headlines Container */
#headlines-container h4,
#statements-container h4 {
    color: #1a202c;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

#headlines-list,
#statements-list {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.headline-item,
.statement-item {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.headline-item:hover,
.statement-item:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
    transform: translateY(-2px);
}

.headline-item.selected,
.statement-item.selected {
    background: #dbeafe;
    border-color: #1e3a8a;
    color: #1e3a8a;
    font-weight: 600;
}

#notes-section {
    background: #f8fafc;
    padding: 25px;
    border-radius: 15px;
    margin-top: 25px;
}

#notes-area {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 15px;
}

#notes-area:focus {
    outline: none;
    border-color: #1e3a8a;
}

/* Recording Updates */
.recording-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #dc2626;
    background: #fee2e2;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #dc2626;
}

.max-time-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a5568;
}

#recording-time {
    color: #dc2626;
}

#max-time {
    color: #1e3a8a;
    font-weight: 700;
}

.btn-finish {
    background: #dc2626;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin: 20px auto;
    display: block;
    transition: all 0.3s ease;
}

.btn-finish:hover {
    background: #b91c1c;
    transform: translateY(-2px);
}

/* Results Screen Updates */
.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.union-jack-small {
    width: 60px;
    height: 36px;
    background: linear-gradient(45deg, #dc2626 0%, #dc2626 33%, #ffffff 33%, #ffffff 66%, #1e3a8a 66%);
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    margin: 0 auto 20px;
    position: relative;
}

.union-jack-small::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: white;
    transform: translateY(-50%);
}

.union-jack-small::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: white;
    transform: translateX(-50%);
}

.results-header h2 {
    color: #1a202c;
    font-size: 2rem;
    font-weight: 700;
}

.cefr-result {
    text-align: center;
    margin-bottom: 50px;
    padding: 30px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 20px;
    border: 1px solid #0ea5e9;
}

.level-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1e3a8a, #dc2626);
    color: white;
    padding: 25px 50px;
    border-radius: 60px;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.3);
}

#level-name {
    color: #1e3a8a;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

#level-description {
    color: #4a5568;
    font-size: 1.1rem;
    line-height: 1.6;
}

.results-breakdown h3 {
    color: #1a202c;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 30px;
    text-align: center;
}

.feedback-sections {
    display: grid;
    gap: 30px;
    margin-bottom: 50px;
}

.feedback-section {
    background: #f8fafc;
    padding: 25px;
    border-radius: 15px;
    border-left: 4px solid #1e3a8a;
}

.feedback-section h4 {
    color: #1a202c;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.score-bar {
    flex: 1;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e3a8a, #dc2626);
    transition: width 1.5s ease;
    border-radius: 6px;
}

.score-percent {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 1.1rem;
    min-width: 45px;
}

.feedback-section p {
    color: #4a5568;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Button Updates */
.btn-primary {
    background: linear-gradient(135deg, #1e3a8a, #dc2626);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 0 auto;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

.btn-record {
    background: #16a34a;
    color: white;
    padding: 18px 35px;
    font-size: 1.2rem;
    border-radius: 15px;
}

.btn-record:hover {
    background: #15803d;
}

.btn-record.recording {
    background: #dc2626;
    animation: record-pulse 1.5s infinite;
}

@keyframes record-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .screen {
        padding: 25px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .test-info {
        grid-template-columns: 1fr;
    }
    
    .progress-container {
        flex-direction: column;
        gap: 10px;
    }
    
    #question-text {
        font-size: 1.2rem;
        padding: 20px;
    }
    
    .level-badge {
        font-size: 2rem;
        padding: 20px 40px;
    }
    
    .score-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .score-percent {
        text-align: center;
    }
    
    .actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-primary, .btn-secondary, .btn-record, .btn-finish {
        width: 100%;
    }
}