/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

/* Container principal */
.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    padding: 40px;
    min-height: 600px;
}

/* Fil d'Ariane */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
}

.breadcrumb-item {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    font-weight: 500;
}

.breadcrumb-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.breadcrumb-item.active {
    background: #667eea;
    color: white;
    cursor: default;
}

.breadcrumb-separator {
    color: #dee2e6;
    font-size: 1.2em;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* Titres */
h1 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 10px;
    text-align: center;
}

h2 {
    color: #555;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 400;
}

h3 {
    color: #667eea;
    font-size: 1.1em;
    margin-bottom: 10px;
}

p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Grille d'images - Module 1 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.image-item {
    text-align: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    transition: transform 0.2s;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.image-item .label {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

/* Grille de test - Module 1 */
.test-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin: 30px 0;
}

.test-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.test-item.correct {
    border-color: #28a745;
    background: #d4edda;
}

.test-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 15px;
}

.radio-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 1em;
}

.radio-group input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* Tableau - Modules 2 et 3 */
.pattern-table {
    width: 100%;
    max-width: 400px;
    margin: 30px auto;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pattern-table thead {
    background: #667eea;
    color: white;
}

.pattern-table th,
.pattern-table td {
    padding: 15px;
    text-align: center;
    border: 1px solid #ddd;
}

.pattern-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.pattern-table tbody tr:hover {
    background: #e9ecef;
}

/* Test textuel - Modules 2 et 3 */
.text-test {
    max-width: 500px;
    margin: 30px auto;
}

.text-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.text-item.correct {
    border-color: #28a745;
    background: #d4edda;
}

.text-item label {
    font-size: 1.2em;
    font-weight: bold;
    min-width: 120px;
}

.text-item input {
    flex: 1;
    padding: 10px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 6px;
    text-align: center;
    text-transform: uppercase;
    transition: border-color 0.2s;
}

.text-item input:focus {
    outline: none;
    border-color: #667eea;
}

/* Boutons */
.btn {
    padding: 12px 30px;
    font-size: 1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-next,
.btn-verify,
.btn-restart {
    background: #667eea;
    color: white;
}

.btn-next:hover,
.btn-verify:hover,
.btn-restart:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-prev {
    background: #e9ecef;
    color: #333;
}

.btn-prev:hover {
    background: #dee2e6;
}

.btn-verify {
    display: block;
    margin: 20px auto;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 10px;
}

.navigation button:only-child {
    margin-left: auto;
}

/* Résultats */
.result {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.result .score {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.result .error {
    color: #dc3545;
    font-weight: bold;
}

/* Explications */
.explanation {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
}

.explanation p {
    margin-bottom: 15px;
}

.explanation ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.explanation li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.insight {
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    margin: 15px 0;
}

/* Réseau neuronal - Module 3 */
.neural-network {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.layer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.neuron {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.connections {
    width: 60px;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        #667eea 0px,
        #667eea 10px,
        transparent 10px,
        transparent 20px
    );
    position: relative;
}

.connections::before,
.connections::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        #667eea 0px,
        #667eea 10px,
        transparent 10px,
        transparent 20px
    );
}

.connections::before {
    top: -50px;
}

.connections::after {
    top: 50px;
}

/* Conclusion */
.conclusion-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.comparison {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.compare-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.compare-item h3 {
    margin-bottom: 15px;
    text-align: center;
}

.compare-item p {
    margin-bottom: 10px;
    padding-left: 10px;
}

.final-message {
    background: #667eea;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1em;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    .image-grid,
    .test-grid {
        grid-template-columns: 1fr;
    }

    .comparison {
        grid-template-columns: 1fr;
    }

    .neural-network {
        flex-direction: column;
        gap: 20px;
    }

    .connections {
        width: 2px;
        height: 60px;
        background: repeating-linear-gradient(
            to bottom,
            #667eea 0px,
            #667eea 10px,
            transparent 10px,
            transparent 20px
        );
    }

    .connections::before,
    .connections::after {
        display: none;
    }

    .navigation {
        flex-direction: column;
    }

    .navigation button {
        width: 100%;
    }
}
