html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gradient-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: rgba(44, 62, 80, 0.95) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color) !important;
}

.navbar-brand i {
    margin-right: 8px;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    background-color: rgba(76, 175, 80, 0.1);
    border-radius: 5px;
}

/* Cards */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px 20px 0 0 !important;
    font-weight: bold;
    text-align: center;
    padding: 20px;
}

/* Buttons */
.btn {
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-success:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(79, 175, 80, 0.4);
    background: linear-gradient(135deg, #43a047 0%, #388e3c 100%);
}

.btn-warning {
    background: var(--gradient-secondary);
    color: white;
}

.btn-warning:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(255, 152, 0, 0.4);
    background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.btn-danger:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(220, 53, 69, 0.4);
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Test Cards */
.test-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.test-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.test-card:hover::before {
    left: 100%;
}

.test-card .card-body {
    padding: 30px;
}

.test-card h5 {
    color: var(--dark-color);
    font-weight: bold;
    margin-bottom: 15px;
}

.test-card .badge {
    font-size: 0.8rem;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.test-card .badge:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Question Styles */
.question-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 25px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
}

.question-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.question-number {
    background: var(--gradient-primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Fill in the Blank */
.fill-blank {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 8px 15px;
    margin: 0 8px;
    min-width: 120px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.fill-blank:focus {
    border-color: var(--primary-color);
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.fill-blank.correct {
    border-color: var(--success-color);
    background: #d4edda;
}

.fill-blank.incorrect {
    border-color: var(--danger-color);
    background: #f8d7da;
}

/* Highlight Feature */
.highlight {
    background-color: transparent;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.highlight:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.highlight.active {
    background-color: var(--accent-color);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.5);
}

/* Audio Player (Listening Section) */
/* Đã loại bỏ toàn bộ CSS .audio-player và .audio-player audio để kiểm tra hiển thị audio mặc định */

/* Progress Bar */
.progress-container {
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 3px;
    margin: 20px 0;
}

.progress-bar {
    height: 12px;
    border-radius: 8px;
    background: var(--gradient-success);
    transition: width 0.3s ease;
}

/* Timer */
.timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--danger-color);
    text-align: center;
    padding: 15px;
    background: rgba(255,255,255,0.9);
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.timer.warning {
    color: var(--warning-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Writing Section */
.writing-editor {
    border: 2px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    min-height: 300px;
    font-size: 12px;
    line-height: 1.8;
    transition: border-color 0.3s ease;
}

.writing-editor:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

/* Results Page */
.results-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.score-card {
    text-align: center;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
    color: white;
    transition: all 0.3s ease;
}

.score-card:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.score-card.reading {
    background: var(--gradient-primary);
}

.score-card.listening {
    background: var(--gradient-secondary);
}

.score-card.writing {
    background: var(--gradient-success);
}

.score-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-body {
        padding: 20px;
    }
    
    .question-container {
        padding: 20px;
    }
    
    .fill-blank {
        min-width: 80px;
        margin: 5px;
    }
    
    .timer {
        font-size: 1.2rem;
    }
    
    .score-number {
        font-size: 2rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.alert {
    border-radius: 15px;
    border: none;
    padding: 15px 20px;
    margin: 20px 0;
}

.alert-success {
    background: var(--gradient-success);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.alert-warning {
    background: var(--gradient-secondary);
    color: white;
} 

/* Đồng bộ nút logout với nav-link */
.logout-link {
    color: #fff;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline;
}
.logout-link:hover, .logout-link:focus {
    color: var(--accent-color);
    text-decoration: underline;
    background-color: rgba(255, 152, 0, 0.1);
    border-radius: 5px;
    padding: 5px 10px;
} 