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

body{
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

header{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap:15px;
    padding:20px;
    background: #2c3e50;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.header-branding{
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.header-nav button{
    margin: 0;
    white-space: nowrap;
}

.logo{
    height:70px;
}

h1{
    margin:0;
    font-size:24px;
    font-weight: 600;
}

main, section{
    max-width:900px;
    margin:20px auto;
    background: white;
    padding:30px;
    border-radius:8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h2{
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 22px;
    font-weight: 600;
}

button{
    padding:12px 24px;
    background: #3498db;
    border:0;
    border-radius:4px;
    margin:8px;
    color:white;
    font-size:16px;
    cursor:pointer;
    transition: background 0.3s, transform 0.1s;
    font-weight: 500;
}

button:hover{
    background: #2980b9;
    transform: translateY(-1px);
}

button:active{
    transform: translateY(0);
}

.back-btn{
    background: #95a5a6;
    margin-bottom: 20px;
}

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

.chapter-btn{
    display: block;
    width: 100%;
    text-align: left;
    margin: 10px 0;
    background: #ecf0f1;
    color: #2c3e50;
}

.chapter-btn:hover{
    background: #bdc3c7;
    color: #2c3e50;
}

.hidden{display:none;}

.question{
    font-size:20px;
    margin-bottom:20px;
    font-weight: 500;
    color: #2c3e50;
}

.answer{
    padding:15px;
    background: #ecf0f1;
    border-radius:6px;
    margin:10px 0;
    cursor:pointer;
    transition: background 0.2s, transform 0.1s;
    color: #2c3e50;
    font-size: 16px;
}

.answer:hover{
    background: #bdc3c7;
    transform: translateX(5px);
}

.correct{
    background: #27ae60 !important;
    color: white !important;
}

.wrong{
    background: #e74c3c !important;
    color: white !important;
}

img.pictogram{
    max-height:120px;
    margin:10px 0;
    border-radius: 4px;
}

/* Chapter Review Styles */
.chapter-content{
    margin-top: 20px;
}

.qa-item{
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.qa-number{
    font-size: 20px;
    font-weight: 700;
    color: #3498db;
    min-width: 35px;
}

.qa-details{
    flex: 1;
}

.qa-question{
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.qa-answers{
    margin-top: 10px;
}

.qa-answer{
    padding: 10px 15px;
    margin: 8px 0;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    color: #555;
}

.qa-answer.qa-correct{
    background: #d4edda;
    border-color: #27ae60;
    color: #155724;
    font-weight: 600;
}

/* Result Page */
#result{
    text-align: center;
}

#result p{
    font-size: 24px;
    margin: 30px 0;
    color: #2c3e50;
    font-weight: 600;
}

/* Incorrect Questions Review */
.incorrect-section{
    margin-top: 40px;
    text-align: left;
}

.incorrect-section h3{
    color: #e74c3c;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.incorrect-questions{
    margin-top: 20px;
}

.incorrect-item{
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: #fff5f5;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
}

.incorrect-number{
    font-size: 20px;
    font-weight: 700;
    color: #e74c3c;
    min-width: 35px;
}

.incorrect-details{
    flex: 1;
}

.incorrect-question{
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.incorrect-answers{
    margin-top: 10px;
}

.incorrect-answer{
    padding: 10px 15px;
    margin: 8px 0;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    color: #555;
}

.answer-correct-review{
    background: #d4edda !important;
    border-color: #27ae60 !important;
    color: #155724 !important;
    font-weight: 600;
}

.answer-wrong-review{
    background: #f8d7da !important;
    border-color: #e74c3c !important;
    color: #721c24 !important;
    font-weight: 600;
}

/* Welcome Section */
.welcome-section{
    max-width: 1000px;
    margin: 30px auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.welcome-container h2{
    text-align: center;
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 30px;
}

.welcome-content{
    line-height: 1.8;
    color: #555;
}

.welcome-content > p{
    font-size: 18px;
    margin-bottom: 30px;
    text-align: center;
    color: #444;
}

.welcome-content h3{
    color: #2c3e50;
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.quick-start{
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.instruction-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.instruction-item{
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.instruction-item strong{
    display: block;
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 10px;
}

.instruction-item p{
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

.social-links{
    background: #ecf9ff;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.social-links > p{
    text-align: center;
    color: #555;
    margin-bottom: 20px;
}

.links-grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.social-link{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    font-weight: 500;
}

.social-link:hover{
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

.link-icon{
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.link-text{
    font-size: 16px;
}

.app-features{
    background: #f0f4f8;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.app-features ul{
    list-style: none;
    margin-top: 15px;
}

.app-features li{
    padding: 12px 0;
    color: #555;
    font-size: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.app-features li:last-child{
    border-bottom: none;
}

.start-training{
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.start-training p{
    margin: 10px 0;
    font-size: 18px;
}

.start-training strong{
    font-size: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header{
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-nav{
        width: 100%;
        flex-direction: column;
    }
    
    .header-nav button{
        width: 100%;
        margin: 5px 0;
    }
    
    main, section{
        margin: 10px;
        padding: 20px;
    }
    
    h1{
        font-size: 20px;
    }
    
    button{
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .qa-item{
        flex-direction: column;
        gap: 10px;
    }
    
    .qa-number{
        min-width: auto;
    }
    
    /* Welcome section mobile */
    .welcome-section{
        margin: 10px;
        padding: 20px;
    }
    
    .welcome-container h2{
        font-size: 22px;
    }
    
    .instruction-grid{
        grid-template-columns: 1fr;
    }
    
    .links-grid{
        grid-template-columns: 1fr;
    }
}
