/* Styles généraux - Harmonisés avec le logo Prépa-SSIAP */
:root {
    /* Couleurs du logo */
    --ssiap-blue: #2B5A9E;
    --ssiap-red: #C41E3A;
    --ssiap-gold: #D4AF37;
    --ssiap-navy: #1A3A5C;
    --ssiap-light-blue: #4A7AB8;
    
    /* Couleurs principales */
    --primary-color: #2B5A9E;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #D4AF37;
    --info-color: #4A7AB8;
    --danger-color: #C41E3A;
    --dark-color: #1A3A5C;
    --light-color: #f8f9fa;
    
    /* Couleurs thématiques */
    --fire-red: #C41E3A;
    --fire-gold: #D4AF37;
    
    /* Dégradés */
    --gradient-primary: linear-gradient(135deg, #2B5A9E 0%, #4A7AB8 100%);
    --gradient-fire: linear-gradient(135deg, #C41E3A 0%, #D4AF37 50%, #2B5A9E 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: white;
    position: relative;
}

/* Logo en filigrane sur toutes les pages */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    max-width: 800px;
    height: 60%;
    background-image: url('../images/logo-prepa-ssiap.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
}

/* Navigation */
.navbar {
    background: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid rgba(43, 90, 158, 0.1);
    z-index: 1050 !important;
}

.navbar .btn,
.navbar .nav-link,
.navbar .dropdown-toggle {
    position: relative;
    z-index: 1051;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #333 !important;
}

.navbar-brand img {
    height: 45px;
    width: auto;
}

/* Hamburger menu pour mobile */
.navbar-toggler {
    border-color: rgba(43, 90, 158, 0.3);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(43, 90, 158, 0.25);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(51, 51, 51, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    color: #333 !important;
}

.navbar-nav .nav-link:hover {
    color: var(--ssiap-blue) !important;
}

.navbar-nav .nav-link.active {
    color: var(--ssiap-blue) !important;
    font-weight: 600;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: var(--ssiap-blue);
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    background: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    margin-top: -76px;
    padding-top: 76px;
    position: relative;
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-section .display-4 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

/* Animation float supprimée */
.hero-image {
    /* Plus d'animation */
}

.hero-image img {
    filter: brightness(1) contrast(1);
    box-shadow: none !important;
    border: none !important;
}

/* Features Section */
.features-section {
    background-color: transparent;
    position: relative;
    z-index: 1;
}

.feature-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.feature-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    height: 100%;
    border: 2px solid rgba(43, 90, 158, 0.1);
    position: relative;
    z-index: 1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.feature-link:hover .feature-card {
    transform: translateY(-10px);
    box-shadow: 0 12px 35px rgba(43, 90, 158, 0.25);
    border-color: var(--ssiap-gold);
}

.feature-icon {
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.feature-link:hover .feature-icon {
    transform: scale(1.1);
}

.feature-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.feature-card-content p {
    flex: 1;
}

.feature-cta {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--ssiap-blue) 0%, #1A3A5C 100%);
    color: white;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-top: auto;
}

.feature-link:hover .feature-cta {
    background: linear-gradient(135deg, var(--ssiap-gold) 0%, #D4AF37 100%);
    color: #1A3A5C;
    transform: scale(1.05);
}

.feature-cta i {
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.feature-link:hover .feature-cta i {
    transform: translateX(5px);
}

/* How it works section */
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--ssiap-blue) 0%, #1A3A5C 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(43, 90, 158, 0.3);
}

/* SSIAP Level Selection Cards */
.ssiap-card {
    transition: all 0.4s ease;
    cursor: pointer;
    border: 3px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--gradient-fire) border-box;
    position: relative;
    z-index: 1;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.ssiap-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(43, 90, 158, 0.2);
    border-color: transparent;
}

.ssiap-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mode Selection Cards */
.mode-card {
    transition: all 0.4s ease;
    border: 2px solid rgba(43, 90, 158, 0.15);
    position: relative;
    overflow: hidden;
    background: white;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 0;
}

.mode-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(43, 90, 158, 0.25);
    border-color: var(--ssiap-gold);
}

.mode-card:hover::before {
    left: 0;
    opacity: 0.03;
}

.mode-card .card-body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mode-icon {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-details ul {
    list-style: none;
    padding: 0;
}

.mode-details ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.mode-details ul li:last-child {
    border-bottom: none;
}

/* Styles pour les boutons de mode */
.mode-card .btn-lg {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: auto;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

/* Masquer le retour à la ligne sur mobile */
@media (max-width: 991px) {
    .mode-card .btn-lg br {
        display: none;
    }
    
    .mode-card .btn-lg {
        min-height: 48px;
    }
}

/* Ribbon for recommended mode */
.ribbon {
    position: absolute;
    top: 15px;
    right: -5px;
    z-index: 1;
}

.ribbon span {
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: bold;
    position: relative;
    display: inline-block;
}

.ribbon span::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 0;
    border-top: 15px solid transparent;
    border-right: 10px solid var(--success-color);
    border-bottom: 15px solid transparent;
}

/* Stats Boxes */
.stat-box {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 2px solid rgba(43, 90, 158, 0.1);
    position: relative;
    z-index: 1;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(43, 90, 158, 0.2);
    border-color: var(--ssiap-gold);
}

.stat-box h3 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: bold;
}

/* Assurer que le contenu est au-dessus du filigrane */
main, .container, .row, .col {
    position: relative;
    z-index: 1;
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.question-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.timer-container {
    text-align: center;
    margin-bottom: 2rem;
}

.timer-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.timer-display.warning {
    color: var(--warning-color);
}

.timer-display.danger {
    color: var(--fire-red);
}

.progress-bar-container {
    margin-bottom: 2rem;
}

.options-container {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.option-btn {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
    line-height: 1.5;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.option-btn:hover {
    border-color: var(--ssiap-blue);
    background-color: rgba(43, 90, 158, 0.05);
    box-shadow: 0 2px 8px rgba(43, 90, 158, 0.1);
}

.option-btn.selected {
    border-color: var(--ssiap-blue);
    background-color: rgba(43, 90, 158, 0.1);
    box-shadow: 0 3px 10px rgba(43, 90, 158, 0.15);
}

.option-btn.correct {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    color: #155724;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.2);
}

.option-btn.incorrect {
    border-color: var(--fire-red);
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.1) 0%, rgba(196, 30, 58, 0.05) 100%);
    color: #721c24;
    box-shadow: 0 3px 10px rgba(196, 30, 58, 0.2);
}

/* Checkbox option styles for multiple choice questions */
.option-btn.checkbox-option {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
    line-height: 1.5;
    min-height: 60px;
    position: relative;
}

.option-btn.checkbox-option:hover {
    border-color: var(--ssiap-blue);
    background-color: rgba(43, 90, 158, 0.05);
    box-shadow: 0 2px 8px rgba(43, 90, 158, 0.1);
}

.option-btn.checkbox-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 15px;
    position: relative;
    z-index: 2;
    opacity: 1 !important;
    visibility: visible !important;
}

.option-btn.checkbox-option input[type="checkbox"]:checked {
    accent-color: var(--ssiap-blue);
    background-color: var(--ssiap-blue);
}

.option-btn.checkbox-option label {
    flex-grow: 1;
    cursor: pointer;
    margin: 0;
    padding-left: 10px;
    position: relative;
    z-index: 1;
}

.option-btn.checkbox-option.checked {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
    box-shadow: 0 3px 10px rgba(43, 90, 158, 0.15);
}

.option-btn.checkbox-option.checked input[type="checkbox"] {
    background-color: var(--ssiap-blue);
    border-color: var(--ssiap-blue);
}

/* Style spécial pour rendre la checkbox bien visible */
.option-btn.checkbox-option input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    position: relative;
    margin-right: 15px;
    flex-shrink: 0;
}

.option-btn.checkbox-option input[type="checkbox"]:checked {
    background: var(--ssiap-blue);
    border-color: var(--ssiap-blue);
}

.option-btn.checkbox-option input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.option-btn.checkbox-option:has(input:checked) {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
    box-shadow: 0 3px 10px rgba(43, 90, 158, 0.15);
}

.option-btn.checkbox-option.correct {
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    color: #155724;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.2);
}

.option-btn.checkbox-option.incorrect {
    border-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    color: #721c24;
    box-shadow: 0 3px 10px rgba(220, 53, 69, 0.2);
}

.option-btn.checkbox-option.selected {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
    box-shadow: 0 3px 10px rgba(43, 90, 158, 0.15);
}

/* SSIAP Level Selection Cards */
.ssiap-card {
    border: 2px solid #dee2e6;
    border-radius: 15px;
    transition: all 0.3s ease;
    height: 100%;
    cursor: pointer;
    max-width: 450px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.ssiap-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ssiap-card .card-body .btn {
    margin-top: auto;
    transition: all 0.3s ease;
}

/* Uniformisation des boutons Quiz - suppression des lisérés indésirables */
.ssiap-card .btn {
    outline: none !important;
}

.ssiap-card .btn:focus,
.ssiap-card .btn:active,
.ssiap-card .btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Suppression TOTALE de la bordure sur les boutons */
.ssiap-card .btn-primary,
.ssiap-card .btn-primary:hover,
.ssiap-card .btn-primary:focus,
.ssiap-card .btn-primary:active,
.ssiap-card .btn-primary.active {
    border: 2px solid #007bff !important;
    box-shadow: none !important;
}

.ssiap-card .btn-success,
.ssiap-card .btn-success:hover,
.ssiap-card .btn-success:focus,
.ssiap-card .btn-success:active,
.ssiap-card .btn-success.active {
    border: 2px solid #28a745 !important;
    box-shadow: none !important;
}

.ssiap-card .btn-warning,
.ssiap-card .btn-warning:hover,
.ssiap-card .btn-warning:focus,
.ssiap-card .btn-warning:active,
.ssiap-card .btn-warning.active {
    border: 2px solid #ffc107 !important;
    box-shadow: none !important;
}

/* Boutons de sélection Quiz avec couleurs par niveau SSIAP */
.ssiap-card[data-ssiap-level="1"] .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.ssiap-card[data-ssiap-level="1"] .btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4) !important;
}

.ssiap-card[data-ssiap-level="2"] .btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.ssiap-card[data-ssiap-level="2"] .btn-success:hover {
    background-color: #1e7e34;
    border-color: #1c7430;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
}

.ssiap-card[data-ssiap-level="3"] .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.ssiap-card[data-ssiap-level="3"] .btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4) !important;
}

.ssiap-card:hover {
    transform: translateY(-8px);
}

.ssiap-card[data-ssiap-level="1"]:hover {
    border-color: #007bff !important;
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.3);
}

.ssiap-card[data-ssiap-level="2"]:hover {
    border-color: #28a745 !important;
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.3);
}

.ssiap-card[data-ssiap-level="3"]:hover {
    border-color: #ffc107 !important;
    box-shadow: 0 12px 35px rgba(255, 193, 7, 0.3);
}

.ssiap-icon {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ssiap-card ul {
    list-style: none;
    padding-left: 0;
}

.ssiap-card ul li {
    padding: 5px 0;
    position: relative;
    padding-left: 25px;
}

.ssiap-card ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* Results Styles */
.results-container {
    text-align: center;
    padding: 2rem;
}

.score-display {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.score-details {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-top: 2rem;
}

/* ==========================================
   LEXIQUE SSIAP - STYLES
   ========================================== */

/* Catégories du lexique */
.lexique-category {
    margin-bottom: 2rem;
}

.lexique-category-title {
    color: var(--ssiap-blue);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ssiap-blue);
    display: flex;
    align-items: center;
}

.lexique-category-title i {
    color: var(--ssiap-gold);
}

.lexique-terms {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Items du lexique */
.lexique-item {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    transition: all 0.3s ease;
    border-left: 4px solid var(--ssiap-blue);
}

.lexique-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.lexique-item[data-ssiap-level="1"]:hover {
    border-left-color: #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.25);
}

.lexique-item[data-ssiap-level="2"]:hover {
    border-left-color: #28a745;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.25);
}

.lexique-item[data-ssiap-level="3"]:hover {
    border-left-color: #ffc107;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.25);
}

.lexique-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.lexique-term {
    color: var(--ssiap-navy);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.lexique-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.lexique-definition {
    color: #333;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* Highlight de recherche */
mark {
    background-color: var(--ssiap-gold);
    color: var(--ssiap-navy);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 600;
}

/* Responsive Lexique */
@media (max-width: 768px) {
    .lexique-item-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .lexique-badges {
        align-self: flex-start;
    }
    
    .lexique-term {
        font-size: 1.1rem;
    }
    
    .lexique-category-title {
        font-size: 1.3rem;
    }
}

/* ==========================================
   FICHES DE RÉVISION SSIAP - STYLES
   ========================================== */

/* Cartes de sélection SSIAP pour les fiches */
.ssiap-card-fiche {
    border: 2px solid #dee2e6;
    border-radius: 15px;
    transition: all 0.3s ease;
    height: 100%;
    cursor: pointer;
    background: white;
    display: flex;
    flex-direction: column;
}

.ssiap-card-fiche .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ssiap-card-fiche .card-body > *:last-child {
    margin-top: auto;
}

/* Uniformiser la taille des boutons dans les cartes SSIAP */
.ssiap-card-fiche .btn {
    font-size: 1.125rem;
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* Uniformisation des boutons - suppression des lisérés indésirables */
.ssiap-card-fiche .btn {
    outline: none !important;
}

.ssiap-card-fiche .btn:focus,
.ssiap-card-fiche .btn:active,
.ssiap-card-fiche .btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Suppression TOTALE de la bordure sur les boutons */
.ssiap-card-fiche .btn-primary,
.ssiap-card-fiche .btn-primary:hover,
.ssiap-card-fiche .btn-primary:focus,
.ssiap-card-fiche .btn-primary:active,
.ssiap-card-fiche .btn-primary.active {
    border: 2px solid #007bff !important;
    box-shadow: none !important;
}

.ssiap-card-fiche .btn-success,
.ssiap-card-fiche .btn-success:hover,
.ssiap-card-fiche .btn-success:focus,
.ssiap-card-fiche .btn-success:active,
.ssiap-card-fiche .btn-success.active {
    border: 2px solid #28a745 !important;
    box-shadow: none !important;
}

.ssiap-card-fiche .btn-warning,
.ssiap-card-fiche .btn-warning:hover,
.ssiap-card-fiche .btn-warning:focus,
.ssiap-card-fiche .btn-warning:active,
.ssiap-card-fiche .btn-warning.active {
    border: 2px solid #ffc107 !important;
    box-shadow: none !important;
}

/* Boutons de sélection avec couleurs par niveau SSIAP */
.ssiap-card-fiche[data-ssiap-level="1"] .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.ssiap-card-fiche[data-ssiap-level="1"] .btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4) !important;
}

.ssiap-card-fiche[data-ssiap-level="2"] .btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.ssiap-card-fiche[data-ssiap-level="2"] .btn-success:hover {
    background-color: #1e7e34;
    border-color: #1c7430;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4) !important;
}

.ssiap-card-fiche[data-ssiap-level="3"] .btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.ssiap-card-fiche[data-ssiap-level="3"] .btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4) !important;
}

.ssiap-card-fiche:hover {
    transform: translateY(-8px);
}

.ssiap-card-fiche[data-ssiap-level="1"]:hover {
    border-color: #007bff !important;
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.3);
}

.ssiap-card-fiche[data-ssiap-level="2"]:hover {
    border-color: #28a745 !important;
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.3);
}

.ssiap-card-fiche[data-ssiap-level="3"]:hover {
    border-color: #ffc107 !important;
    box-shadow: 0 12px 35px rgba(255, 193, 7, 0.3);
}

.ssiap-card-fiche[data-ssiap-level="3"]:hover {
    border-color: var(--ssiap-gold);
    box-shadow: 0 12px 35px rgba(212, 175, 55, 0.3);
}

.ssiap-card-fiche.ssiap-card-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ssiap-card-fiche.ssiap-card-disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #dee2e6;
}

/* Cartes de fiches individuelles */
.fiche-card {
    border: 2px solid #dee2e6;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
    height: 100%;
}

.fiche-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(212, 175, 55, 0.3);
    border-color: var(--ssiap-gold);
}

.fiche-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.fiche-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fiche-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.fiche-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Modal de fiche */
.fiche-icon-large {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fiche-introduction {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--ssiap-blue);
}

.fiche-section {
    padding: 1rem 0;
}

.fiche-section-title {
    color: var(--ssiap-blue);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.fiche-list {
    list-style: none;
    padding-left: 0;
}

.fiche-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.8;
}

.fiche-list li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--ssiap-blue);
    font-weight: bold;
    font-size: 1.2rem;
}

.fiche-list li strong {
    color: var(--ssiap-navy);
    font-weight: 600;
}

.fiche-resume {
    border-radius: 8px;
}

.fiche-points-cles {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.fiche-points-cles li {
    padding: 0.5rem 0;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .fiche-header {
        flex-direction: column;
    }
    
    .fiche-meta {
        align-items: flex-start;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .fiche-icon-large {
        width: 50px;
        height: 50px;
    }
}

.term {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.definition {
    color: #666;
    line-height: 1.6;
}

/* Fiches de révision */
.fiche-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.fiche-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.fiche-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

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

/* ==========================================
   RESPONSIVE MOBILE - OPTIMISATIONS
   ========================================== */

@media (max-width: 768px) {
    /* Navbar mobile */
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-brand img {
        height: 35px;
    }
    
    .navbar-nav {
        padding-top: 1rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding: 2rem 0;
        margin-top: 80px;
    }
    
    .hero-section .display-4,
    .hero-section h1 {
        font-size: 1.75rem !important;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .hero-section .btn {
        font-size: 0.95rem;
        padding: 0.65rem 1.25rem;
    }
    
    /* Cartes SSIAP de sélection */
    .ssiap-card-fiche {
        margin-bottom: 1.5rem;
    }
    
    .ssiap-card-fiche .card-body {
        padding: 1.5rem !important;
    }
    
    .ssiap-card-fiche h3 {
        font-size: 1.5rem;
    }
    
    .ssiap-card-fiche h5 {
        font-size: 1rem;
    }
    
    .ssiap-card-fiche .ssiap-icon i {
        font-size: 3rem !important;
    }
    
    .ssiap-card-fiche ul {
        font-size: 0.9rem;
    }
    
    .ssiap-card-fiche .btn {
        font-size: 1rem;
        padding: 0.65rem 1.25rem;
    }
    
    /* Cartes de fonctionnalités */
    .feature-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem;
    }
    
    .feature-card .feature-icon {
        font-size: 2.5rem;
    }
    
    .feature-card h3 {
        font-size: 1.3rem;
    }
    
    /* Quiz container */
    .quiz-container {
        padding: 1rem;
        margin-top: 20px;
    }
    
    .question-card {
        padding: 1.5rem;
    }
    
    .question-number {
        font-size: 0.9rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .option-btn {
        font-size: 0.95rem;
        padding: 0.875rem;
        border-width: 2px;
        border-radius: 8px;
        min-height: 50px;
        display: flex;
        align-items: center;
    }
    
    .option-btn:active {
        transform: scale(0.98);
    }
    
    /* Options multiples (checkboxes) sur mobile */
    .option-btn.checkbox-option {
        padding: 0.875rem;
        min-height: 50px;
    }
    
    /* Timer mobile */
    .timer-container {
        font-size: 1.2rem;
        padding: 0.75rem 1rem;
    }
    
    /* Score display */
    .score-display {
        font-size: 2.5rem;
    }
    
    /* Fiches de révision */
    .fiche-card {
        padding: 1.25rem;
    }
    
    .fiche-card h5 {
        font-size: 1.1rem;
    }
    
    .fiche-card .card-text {
        font-size: 0.9rem;
    }
    
    /* Lexique mobile */
    .lexique-category-title {
        font-size: 1.2rem;
    }
    
    .lexique-term {
        font-size: 1.1rem;
    }
    
    .lexique-definition {
        font-size: 0.9rem;
    }
    
    .lexique-item {
        padding: 1rem;
    }
    
    /* Barre de recherche */
    .input-group-lg .form-control {
        font-size: 1rem;
    }
    
    /* Boutons mobiles */
    .btn-lg {
        font-size: 1rem;
        padding: 0.65rem 1.25rem;
    }
    
    /* Modals mobile */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        font-size: 0.95rem;
        padding: 1rem;
    }
    
    /* Titres des pages */
    main h1 {
        font-size: 1.75rem;
    }
    
    main h2 {
        font-size: 1.5rem;
    }
    
    /* Container général */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Marges mobiles */
    main {
        margin-top: 80px !important;
    }
    
    /* Footer mobile */
    footer {
        font-size: 0.9rem;
        padding: 1.5rem 0 !important;
    }
}

/* Extra small devices (phones < 576px) */
@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 30px;
    }
    
    .hero-section h1,
    .hero-section .display-4 {
        font-size: 1.5rem !important;
    }
    
    .ssiap-card-fiche h3 {
        font-size: 1.3rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    main h1 {
        font-size: 1.5rem;
    }
    
    main h2 {
        font-size: 1.3rem;
    }
    
    .lexique-term {
        font-size: 1rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    /* Options de quiz encore plus compactes sur petit mobile */
    .option-btn {
        font-size: 0.9rem;
        padding: 0.75rem;
        min-height: 48px;
        border-radius: 8px;
    }
    
    .options-container {
        gap: 0.75rem;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Navigation active state */
.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: bold;
}

/* Quiz Mode Selection */
.quiz-mode-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    text-align: center;
}

.quiz-mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.mode-icon {
    margin-bottom: 1rem;
}

.mode-description {
    color: #666;
    margin: 1rem 0;
    min-height: 60px;
}

.timer-info {
    color: #999;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

/* Options avec 7 choix */
.options-container {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.option-btn.selected {
    border-color: #17a2b8;
    background-color: #d1ecf1;
}

/* Detailed Results for Speed Run */
.detailed-results {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    background: #f8f9fa;
}

.result-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
}

.result-item.correct-answer {
    border-left-color: var(--success-color);
}

/* ========================================
   FLÈCHE DE SCROLL ANIMÉE
   ======================================== */

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    cursor: pointer;
    transition: opacity 0.5s ease, transform 0.3s ease;
    opacity: 1;
}

.scroll-indicator:hover {
    transform: translateX(-50%) translateY(-5px);
}

.scroll-arrow {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, var(--ssiap-blue) 0%, var(--ssiap-light-blue) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(43, 90, 158, 0.4);
    animation: bounce 2s infinite;
    position: relative;
}

.scroll-arrow::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ssiap-blue) 0%, var(--ssiap-light-blue) 100%);
    opacity: 0.3;
    animation: pulse-ring 2s infinite;
}

.scroll-arrow i {
    color: white;
    font-size: 1.5rem;
    animation: arrow-bounce 2s infinite;
}

.scroll-text {
    color: var(--ssiap-navy);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-10px);
    }
}

@keyframes arrow-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Masquer la flèche sur mobile pour éviter de cacher du contenu */
@media (max-width: 768px) {
    .scroll-indicator {
        display: none;
    }
}

/* ========================================
   SECTION STATISTIQUES - PAGE D'ACCUEIL
   ======================================== */

.stats-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(43, 90, 158, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.stats-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(196, 30, 58, 0.03) 0%, transparent 70%);
    border-radius: 50%;
}

.section-title {
    font-weight: 700;
    color: var(--ssiap-navy);
    font-size: 2rem;
}

/* Carte de statistique */
.stat-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(43, 90, 158, 0.15);
    border-color: var(--ssiap-blue);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    font-size: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--ssiap-navy);
    line-height: 1;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ssiap-navy);
    margin-bottom: 0.3rem;
}

.stat-sublabel {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

/* Progress Circles */
.content-progress {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid rgba(43, 90, 158, 0.1);
}

.progress-item {
    position: relative;
}

.progress-circle {
    position: relative;
    display: inline-block;
    margin: 0 auto;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-bar-circle {
    transition: stroke-dashoffset 2s ease-in-out;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ssiap-navy);
}

.progress-percent {
    display: block;
}

/* Animation d'entrée pour les stats */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: countUp 0.6s ease-out forwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-icon {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .progress-circle svg {
        width: 100px;
        height: 100px;
    }
    
    .progress-text {
        font-size: 1.2rem;
    }
}

.result-item.incorrect-answer {
    border-left-color: #dc3545;
}

/* Button styles */
.btn-primary {
    background: var(--gradient-primary);
    border: 2px solid var(--ssiap-blue);
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(43, 90, 158, 0.2);
}

.btn-primary:hover {
    background: var(--ssiap-navy);
    border-color: var(--ssiap-gold);
    color: var(--ssiap-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(43, 90, 158, 0.3);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.2);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(40, 167, 69, 0.3);
}

.btn-danger {
    background-color: var(--fire-red);
    border-color: var(--fire-red);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(196, 30, 58, 0.2);
}

.btn-danger:hover {
    background-color: #A01830;
    border-color: #A01830;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(196, 30, 58, 0.3);
}

.btn-info {
    background-color: var(--ssiap-light-blue);
    border-color: var(--ssiap-light-blue);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(74, 122, 184, 0.2);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 122, 184, 0.3);
}

.btn-outline-light {
    padding: 0.75rem 2rem;
    font-weight: 500;
}

/* Bouton secondaire personnalisé - Même style que btn-primary */
.btn-secondary-custom {
    background: var(--gradient-primary);
    border: 2px solid var(--ssiap-blue);
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(43, 90, 158, 0.2);
    color: white;
}

.btn-secondary-custom:hover {
    background: var(--ssiap-navy);
    border-color: var(--ssiap-gold);
    color: var(--ssiap-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(43, 90, 158, 0.3);
}

.btn-secondary-custom:active,
.btn-secondary-custom:focus {
    background: var(--ssiap-navy);
    border-color: var(--ssiap-gold);
    box-shadow: 0 4px 10px rgba(26, 58, 92, 0.3);
    color: white;
}

/* Stats cards */
.stats-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-label {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer */
footer {
    background: var(--dark-color) !important;
    border-top: 3px solid var(--ssiap-gold);
}

/* Badge personnalisé */
.badge.bg-primary {
    background: var(--gradient-primary) !important;
}

.badge.bg-danger {
    background-color: var(--fire-red) !important;
}

.badge.bg-warning {
    background-color: var(--ssiap-gold) !important;
    color: var(--dark-color) !important;
}

.badge.bg-info {
    background-color: var(--ssiap-light-blue) !important;
}

/* Alertes personnalisées */
.alert-info {
    background-color: rgba(43, 90, 158, 0.1);
    border-left: 4px solid var(--ssiap-blue);
    color: var(--ssiap-navy);
}

.alert-success {
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(196, 30, 58, 0.1);
    border-left: 4px solid var(--fire-red);
    color: #721c24;
}

.alert-warning {
    background-color: rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--ssiap-gold);
    color: #856404;
}