/* Styles généraux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

h1 {
    text-align: center;
    color: #4a5568;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* Navigation */
nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    gap: 2rem;
    padding: 0 2rem;
}

nav a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

nav a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

/* Main content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Chapters */
.chapter {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.5s ease-in;
}

.chapter.hidden {
    display: none;
}

.chapter h2 {
    color: #2d3748;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* Lessons */
.lesson {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 10px;
    border-left: 5px solid #667eea;
}

.lesson h3 {
    color: #2b6cb0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.lesson h4 {
    color: #3182ce;
    margin: 1rem 0 0.5rem 0;
}

/* Lists */
ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
    position: relative;
}

ul li::before {
    content: "🧬";
    position: absolute;
    left: -2rem;
}

ol li {
    counter-increment: item;
}

/* Interactive elements */
.interactive-element {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    border: 2px solid #38b2ac;
}

.info-btn, .animation-btn, .submit-btn {
    background: linear-gradient(45deg, #38b2ac 0%, #319795 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 178, 172, 0.3);
}

.info-btn:hover, .animation-btn:hover, .submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 178, 172, 0.4);
}

.hidden-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border-left: 4px solid #38b2ac;
    display: none;
    animation: slideDown 0.3s ease;
}

.hidden-info.show {
    display: block;
}

/* Diagram styles */
.diagram {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.tree {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 2rem 0;
}

.branch {
    position: relative;
    padding: 1rem;
}

.species {
    background: linear-gradient(45deg, #4299e1 0%, #3182ce 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
    display: inline-block;
}

.species:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4);
}

.species-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    min-height: 50px;
}

/* Earth structure */
.earth-structure {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
}

.layer {
    background: linear-gradient(135deg, #fbb6ce 0%, #f687b3 100%);
    padding: 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.layer:hover {
    transform: translateX(10px);
    border-color: #ed64a6;
    box-shadow: 0 8px 25px rgba(237, 100, 166, 0.3);
}

.layer[data-layer="croute"] {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
}

.layer[data-layer="manteau"] {
    background: linear-gradient(135deg, #feebc8 0%, #fbd38d 100%);
}

.layer[data-layer="noyau"] {
    background: linear-gradient(135deg, #fed7e2 0%, #fbb6ce 100%);
}

.layer-info {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-height: 50px;
}

/* Animation container */
.animation-container {
    width: 100%;
    height: 200px;
    background: linear-gradient(to right, #4299e1, #63b3ed, #90cdf4);
    border-radius: 10px;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

/* Comparison table */
.comparison-table {
    margin: 2rem 0;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.comparison-table th {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.comparison-table tr:hover {
    background: #f7fafc;
    cursor: pointer;
}

.comparison-table tr.highlighted {
    background: #e6fffa;
    border-left: 4px solid #38b2ac;
}

/* Equation */
.equation {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #c53030;
    margin: 1rem 0;
    border: 2px solid #fc8181;
}

/* Photosynthesis simulator */
.photosynthesis-simulator {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.photosynthesis-simulator label {
    font-weight: 600;
    color: #2d3748;
}

.photosynthesis-simulator input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.photosynthesis-simulator input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #38b2ac;
    border-radius: 50%;
    cursor: pointer;
}

#photosynthesis-rate {
    background: linear-gradient(45deg, #68d391 0%, #38a169 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* Genetic diagram */
.genetic-diagram {
    margin: 2rem 0;
    text-align: center;
}

.punnett-square {
    margin: 0 auto;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.punnett-square td {
    width: 80px;
    height: 60px;
    border: 2px solid #e2e8f0;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.punnett-square .gamete {
    background: linear-gradient(45deg, #9f7aea 0%, #805ad5 100%);
    color: white;
}

.punnett-square .offspring.female {
    background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.punnett-square .offspring.male {
    background: linear-gradient(45deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.punnett-square td:hover {
    transform: scale(1.05);
}

#genotype-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    min-height: 50px;
}

/* Hormone graph */
.hormone-graph {
    text-align: center;
    margin: 2rem 0;
}

#menstrual-cycle {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Quiz styles */
.question {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.question h3 {
    color: #2b6cb0;
    margin-bottom: 1rem;
}

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

.options label {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f7fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.options label:hover {
    background: #e6fffa;
    border-color: #38b2ac;
}

.options input[type="radio"] {
    margin-right: 0.75rem;
    transform: scale(1.2);
}

#quiz-results {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

#quiz-results.success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border: 2px solid #68d391;
}

#quiz-results.partial {
    background: linear-gradient(135deg, #fefcbf 0%, #f6e05e 100%);
    color: #744210;
    border: 2px solid #ecc94b;
}

#quiz-results.failure {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #742a2a;
    border: 2px solid #fc8181;
}

/* Footer */
footer {
    background: rgba(255, 255, 255, 0.95);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

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

.pulse {
    animation: pulse 1s infinite;
}

/* Responsive design */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .chapter {
        padding: 1rem;
    }
    
    .tree {
        flex-direction: column;
        gap: 1rem;
    }
    
    .earth-structure {
        gap: 0.5rem;
    }
    
    .layer:hover {
        transform: none;
    }
    
    .comparison-table {
        overflow-x: auto;
    }
    
    .punnett-square {
        font-size: 0.8rem;
    }
    
    .punnett-square td {
        width: 60px;
        height: 50px;
    }
}