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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Login Page */
.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    margin: 80px auto;
    text-align: center;
}

.login-box h1 {
    color: #1e3c72;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.login-box h2 {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 30px;
    font-weight: normal;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #2a5298;
}

/* Login Footer */
.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85em;
    color: #666;
}

.login-footer p {
    margin-bottom: 8px;
}

.login-footer a {
    color: #2a5298;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Home Footer */
.home-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.85em;
    color: #666;
}

.home-footer p {
    margin-bottom: 8px;
}

.home-footer a {
    color: #2a5298;
    text-decoration: none;
}

.home-footer a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #2a5298;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #1e3c72;
}

.btn-large {
    padding: 30px 50px;
    font-size: 1.3em;
    min-width: 280px;
    text-align: center;
}

.btn-ecrite {
    background: #3498db;
    color: white;
}

.btn-ecrite:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-orale {
    background: #9b59b6;
    color: white;
}

.btn-orale:hover {
    background: #8e44ad;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

.btn-logout {
    background: #95a5a6;
    color: white;
    padding: 8px 20px;
    font-size: 0.9em;
}

.btn-logout:hover {
    background: #7f8c8d;
}

.btn-back {
    background: #3498db;
    color: white;
    padding: 8px 20px;
    font-size: 0.9em;
}

.btn-back:hover {
    background: #2980b9;
}

/* Header */
.header {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #1e3c72;
    font-size: 1.5em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
}

.nav-links {
    display: flex;
    gap: 10px;
}

/* Main Content */
.main-content {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.main-content h2 {
    color: #1e3c72;
    margin-bottom: 40px;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.placeholder-content {
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    color: #666;
}

/* Series Grid */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 20px;
}

.series-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    background: #2a5298;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.series-btn:hover {
    background: #1e3c72;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.4);
}

/* Series Question Page */
.series-page {
    display: flex;
    min-height: 100vh;
}

.question-sidebar {
    width: 200px;
    background: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 20px;
}

.sidebar-header h3 {
    color: #1e3c72;
    margin-bottom: 10px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8em;
}

.question-nav-grouped {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.difficulty-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.difficulty-label {
    font-weight: 600;
    color: #666;
    font-size: 0.85em;
}

.difficulty-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.question-nav-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9em;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-nav-btn:hover {
    border-color: #2a5298;
    background: #f0f4ff;
}

.question-nav-btn.active {
    background: #2a5298;
    color: white;
    border-color: #2a5298;
}

.question-main {
    flex: 1;
    margin-left: 200px;
    padding: 30px;
}

.question-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.question-number {
    font-size: 1.2em;
    font-weight: 600;
    color: #1e3c72;
}

.question-difficulty {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.difficulty-A1 { background: #d4edda; color: #155724; }
.difficulty-A2 { background: #cce5ff; color: #004085; }
.difficulty-B1 { background: #fff3cd; color: #856404; }
.difficulty-B2 { background: #ffeeba; color: #856404; }
.difficulty-C1 { background: #f8d7da; color: #721c24; }
.difficulty-C2 { background: #f5c6cb; color: #721c24; }

.audio-section {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.audio-label {
    font-weight: 500;
    color: #666;
    min-width: 60px;
}

.audio-item audio {
    flex: 1;
}

.image-section {
    margin: 20px 0;
    text-align: center;
}

.image-section img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.text-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2a5298;
}

.french-text {
    font-size: 1.05em;
    line-height: 1.8;
    color: #333;
}

.question-content {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
}

.options-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.option-btn {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.option-btn:hover {
    border-color: #2a5298;
    background: #f8faff;
}

.option-btn.selected {
    border-color: #2a5298;
    background: #e8f0ff;
}

.option-btn.correct {
    border-color: #28a745;
    background: #d4edda;
}

.option-btn.wrong {
    border-color: #dc3545;
    background: #f8d7da;
}

.option-label {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: 600;
}

.option-btn.selected .option-label {
    background: #2a5298;
    color: white;
}

.option-btn.correct .option-label {
    background: #28a745;
    color: white;
}

.option-btn.wrong .option-label {
    background: #dc3545;
    color: white;
}

.option-text {
    flex: 1;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-answer {
    background: #17a2b8;
    color: white;
    flex: 1;
}

.btn-answer:hover {
    background: #138496;
}

.btn-prev {
    background: #6c757d;
    color: white;
    flex: 0 0 auto;
    padding: 10px 15px;
    font-size: 0.9em;
}

.btn-prev:hover {
    background: #5a6268;
}

.btn-prev:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-next {
    background: #28a745;
    color: white;
    flex: 0 0 auto;
    padding: 10px 15px;
    font-size: 0.9em;
}

.btn-next:hover {
    background: #218838;
}

.btn-next:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-answer {
    flex: 1;
}

.translation-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-translation {
    background: #6c757d;
    color: white;
    flex: 1;
    padding: 10px;
}

.btn-translation:hover {
    background: #5a6268;
}

.btn-vocabulary {
    background: #ffc107;
    color: #333;
}

.btn-vocabulary:hover {
    background: #e0a800;
}

.translation-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.translation-panel h4 {
    color: #1e3c72;
    margin-bottom: 15px;
}

.transcript-content {
    line-height: 1.8;
    margin-bottom: 15px;
}

.reason-content {
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    line-height: 1.6;
}

.rtl {
    direction: rtl;
    text-align: right;
}

/* Vocabulary Section */
.vocabulary-section {
    background: #fff8e1;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border-left: 4px solid #ffc107;
}

.vocabulary-section h4 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.vocabulary-content {
    line-height: 1.8;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
}

.vocabulary-content:last-child {
    margin-bottom: 0;
}

/* Score Section */
.score-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.score-display {
    font-size: 1.1em;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 5px;
}

.answered-count {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
}

.btn-results {
    width: 100%;
    background: #9b59b6;
    color: white;
    padding: 10px;
}

.btn-results:hover {
    background: #8e44ad;
}

/* Answered question nav buttons */
.question-nav-btn.answered-correct {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.question-nav-btn.answered-wrong {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Results Page */
.results-container {
    text-align: center;
}

.results-container h2 {
    color: #1e3c72;
    margin-bottom: 30px;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.result-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.result-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.result-value {
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
}

.result-score {
    background: #e8f4fd;
}

.result-clb {
    background: #1e3c72;
}

.result-clb .result-label {
    color: rgba(255,255,255,0.8);
}

.result-clb .result-value {
    color: white;
}

.clb-level {
    font-size: 2em !important;
}

.results-detail {
    text-align: left;
    margin: 30px 0;
}

.results-detail h3 {
    color: #1e3c72;
    margin-bottom: 15px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.result-question {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background: #f0f0f0;
}

.result-question.correct {
    background: #d4edda;
}

.result-question.wrong {
    background: #f8d7da;
}

.result-question.not-answered {
    background: #e9ecef;
    opacity: 0.6;
}

.rq-num {
    font-weight: 600;
    font-size: 1.1em;
}

.rq-points {
    font-size: 0.8em;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .question-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .question-main {
        margin-left: 0;
    }

    .series-page {
        flex-direction: column;
    }

    .question-nav-grouped {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .difficulty-group {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .difficulty-label {
        min-width: 25px;
    }
}

/* Alerts */
.alert {
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: left;
}

.alert-error {
    background: #fee;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        min-width: 100%;
    }
}
