/* Styles élégants pour le Quiz de Cybersécurité */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Header élégant */
header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    color: white;
    text-align: center;
    gap: 25px;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    z-index: -1;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-placeholder {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 10px 25px rgba(0, 0, 0, 0.2),
        0 0 0 2px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.logo-placeholder:hover {
    transform: scale(1.05) rotate(2deg);
}

.logo-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: rotate(45deg) translateX(-100%); }
    100% { transform: rotate(45deg) translateX(100%); }
}

.logo-placeholder span {
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header-text {
    text-align: left;
}

.header-text h1 {
    margin: 0 0 8px 0;
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(to right, #fff, #e0e0ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-text h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0.9;
}

/* Container principal élégant */
.container {
    max-width: 900px;
    margin: 30px auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    z-index: 10;
}

/* Footer élégant */
footer {
    text-align: center;
    padding: 25px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 400;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

/* Écrans avec animations */
#login-screen, #difficulty-screen, #quiz-screen, #score-screen {
    padding: 50px 40px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

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

.hidden {
    display: none !important;
}

/* Titres élégants */
h2 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin: 15px auto;
    border-radius: 2px;
}

h3 {
    color: #7f8c8d;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 25px;
}

/* Inputs élégants */
input[type="text"] {
    width: 100%;
    max-width: 350px;
    padding: 18px 20px;
    margin: 25px 0;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        0 5px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

input[type="text"]::placeholder {
    color: #95a5a6;
}

/* Boutons élégants */
.btn-level, button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    margin: 12px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    min-width: 180px;
}

.btn-level:hover, button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-level:active, button:active {
    transform: translateY(-1px);
}

.btn-level:disabled, button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-level::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;
}

.btn-level:hover::before {
    left: 100%;
}

/* Options du quiz élégantes */
.option {
    display: block;
    width: 100%;
    padding: 18px 20px;
    margin: 12px 0;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 16px;
    font-weight: 500;
    color: #2d3748;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.option:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option.correct {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    color: #155724;
    animation: correctPulse 0.6s ease-in-out;
}

.option.incorrect {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
    color: #721c24;
    animation: incorrectShake 0.6s ease-in-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(5px); }
    25% { transform: translateX(0px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(0px); }
}

/* Feedback élégant */
.feedback {
    padding: 20px;
    margin: 25px 0;
    border-radius: 12px;
    font-weight: 500;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.correct {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.feedback.incorrect {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.feedback strong {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
}

.feedback em {
    font-style: italic;
    opacity: 0.9;
}

/* Compteur de questions élégant */
#question-counter {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section des récompenses élégante */
#reward-section {
    margin: 40px 0;
    padding: 30px;
    border-radius: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #dee2e6;
    animation: rewardAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes rewardAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#reward-medal {
    width: 100px;
    height: 100px;
    margin: 15px auto;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

#reward-medal:hover {
    transform: scale(1.1) rotate(5deg);
}

#reward-message {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 20px 0;
    text-align: center;
    line-height: 1.5;
}

/* Responsive élégant */
@media (max-width: 768px) {
    body {
        background: linear-gradient(135deg, #1a2a6c, #b21f1f);
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        padding: 20px 15px;
    }
    
    .header-text {
        text-align: center;
    }
    
    .header-text h1 {
        font-size: 1.8rem;
    }
    
    .header-text h2 {
        font-size: 1.1rem;
    }
    
    .logo-placeholder {
        width: 60px;
        height: 60px;
    }
    
    .logo-placeholder span {
        font-size: 1.5rem;
    }
    
    .container {
        margin: 15px;
        border-radius: 15px;
    }
    
    #login-screen, #difficulty-screen, #quiz-screen, #score-screen {
        padding: 30px 20px;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .btn-level, button {
        width: 100%;
        margin: 10px 0;
        padding: 15px;
        min-width: auto;
    }
    
    .option {
        padding: 15px;
        font-size: 15px;
    }
    
    #reward-medal {
        width: 80px;
        height: 80px;
    }
    
    #reward-message {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .logo-placeholder {
        width: 50px;
        height: 50px;
    }
    
    .logo-placeholder span {
        font-size: 1.3rem;
    }
    
    .header-text h1 {
        font-size: 1.5rem;
    }
    
    .header-text h2 {
        font-size: 1rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h2::after {
        width: 40px;
        height: 2px;
    }
    
    input[type="text"] {
        padding: 15px;
        font-size: 15px;
    }
    
    .btn-level, button {
        padding: 14px;
        font-size: 15px;
        margin: 8px 0;
    }
}

/* Animations pour les transitions */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Effets de survol pour tous les éléments interactifs */
*:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Barre de progression élégante */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Badges de niveau */
.difficulty-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-beginner {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: white;
}

.badge-intermediate {
    background: linear-gradient(135deg, #FF9800, #FFC107);
    color: white;
}

.badge-expert {
    background: linear-gradient(135deg, #F44336, #E91E63);
    color: white;
}

/* Styles pour le bouton À propos */
.about-section {
    margin-top: 30px;
    text-align: center;
}

.btn-about {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-about:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.info-icon {
    font-size: 16px;
}

/* Styles pour le popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.popup-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: popupAppear 0.3s ease-out;
}

@keyframes popupAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.popup-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    position: relative;
}

.popup-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-popup:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.popup-body {
    padding: 25px;
}

.tech-info h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

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

.tech-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
    font-size: 14px;
}

.tech-item strong {
    color: #2c3e50;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.features-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.features-list li:before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
}

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

.popup-footer {
    padding: 20px;
    text-align: right;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
}

/* Responsive pour le popup */
@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        margin: 20px;
        max-height: 85vh;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
    }
    
    .popup-header {
        padding: 15px;
    }
    
    .popup-header h3 {
        font-size: 1.3rem;
    }
    
    .popup-body {
        padding: 20px;
    }
}

/* Styles pour les boutons supplémentaires */
.extra-buttons {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.btn-ia, .btn-about {
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    min-width: 220px;
}

.btn-ia {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.3);
}

.btn-ia:hover {
    background: linear-gradient(135deg, #ff5252, #ff6b6b);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.btn-ia:active {
    transform: translateY(-1px);
}

.btn-about {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.btn-about:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.ia-icon, .info-icon {
    font-size: 18px;
}

/* Styles pour le popup de chargement */
.loading-content {
    text-align: center;
    padding: 40px 30px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(102, 126, 234, 0.3);
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.loading-content p {
    color: #7f8c8d;
    margin: 10px 0;
    line-height: 1.6;
}

/* Responsive pour les boutons */
@media (max-width: 768px) {
    .extra-buttons {
        gap: 12px;
    }
    
    .btn-ia, .btn-about {
        width: 100%;
        max-width: 280px;
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .loading-content {
        padding: 30px 20px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
}
