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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5em;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    color: #f0f8ff;
    font-weight: 500;
}

/* Zone de simulation */
.simulation-area {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    align-items: flex-start;
}

/* Cellule */
.cell {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-membrane {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chloroplaste */
.chloroplast {
    width: 150px;
    height: 100px;
    background: linear-gradient(45deg, #2d5016, #4a7c59);
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.3);
}

.thylakoids {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    background: repeating-linear-gradient(
        45deg,
        #1a3409,
        #1a3409 3px,
        #2d5016 3px,
        #2d5016 6px
    );
    border-radius: 40%;
}

/* Rayons lumineux */
.light-rays {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 30px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 0, 0.6) 50%, 
        transparent 100%);
    border-radius: 50%;
    animation: lightPulse 2s infinite ease-in-out;
}

@keyframes lightPulse {
    0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

/* Molécules */
.molecules {
    position: absolute;
    width: 100%;
    height: 100%;
}

.molecules > div {
    position: absolute;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: all 0.5s ease;
}

.co2-molecule {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    top: 20px;
    left: 20px;
}

.h2o-molecule {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
    bottom: 20px;
    right: 30px;
}

.glucose-molecule {
    background: linear-gradient(45deg, #feca57, #ff9ff3);
    color: #333;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.o2-molecule {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
    top: 30px;
    right: 20px;
    opacity: 0;
}

/* Soleil */
.sun-energy {
    position: absolute;
    top: -60px;
    right: -40px;
}

.sun {
    font-size: 3em;
    animation: sunRotate 4s infinite linear;
}

@keyframes sunRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.light-beams {
    position: absolute;
    top: 40px;
    left: -20px;
    width: 100px;
    height: 150px;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(255, 255, 0, 0.4) 20%, 
        rgba(255, 255, 0, 0.6) 50%, 
        rgba(255, 255, 0, 0.4) 80%, 
        transparent 100%);
    border-radius: 50%;
    animation: lightBeam 3s infinite ease-in-out;
}

@keyframes lightBeam {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Panneau d'information */
.info-panel {
    flex: 0 0 300px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.step {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 15px;
    background: #f8f9fa;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.step.active {
    border-color: #4ecdc4;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    transform: scale(1.02);
}

.step h3 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.step p {
    font-size: 0.9em;
    margin-bottom: 15px;
}

.molecule-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.molecule-display span {
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 12px;
}

.co2-badge { background: #ff6b6b; color: white; }
.h2o-badge { background: #4ecdc4; color: white; }
.glucose-badge { background: #feca57; color: #333; }
.o2-badge { background: #74b9ff; color: white; }
.plus { background: #6c757d; color: white; }
.light-icon { font-size: 2em; text-align: center; margin: 10px 0; }

/* Formule chimique */
.formula-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.formula-section h2 {
    color: #2d5016;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.formula {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 1.3em;
    font-weight: bold;
    flex-wrap: wrap;
}

.formula-left, .formula-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.formula-molecule {
    padding: 10px 15px;
    border-radius: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.formula-molecule.glucose {
    background: linear-gradient(45deg, #feca57, #ff9ff3);
    color: #333;
}

.formula-plus {
    color: #6c757d;
    font-weight: bold;
    font-size: 1.2em;
}

.formula-arrow {
    font-size: 2em;
    color: #4ecdc4;
    animation: pulse 2s infinite;
}

.formula-light {
    padding: 10px 15px;
    border-radius: 15px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    animation: lightGlow 2s infinite ease-in-out;
}

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

@keyframes lightGlow {
    0%, 100% { box-shadow: 0 3px 10px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 5px 20px rgba(255, 215, 0, 0.6); }
}

/* Contrôles */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.btn-primary {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #feca57, #ff9ff3);
    color: #333;
}

.btn-tertiary {
    background: linear-gradient(45deg, #a8e6cf, #88d8a3);
    color: #333;
}

.btn-icon {
    font-size: 1.2em;
}

/* Barre de progression */
.progress-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
    border-radius: 10px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-weight: bold;
    color: #2d5016;
    font-size: 1.1em;
}

/* Animations pour les étapes */
@keyframes moleculeEnter {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

@keyframes moleculeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Responsive */
@media (max-width: 768px) {
    .simulation-area {
        flex-direction: column;
    }
    
    .info-panel {
        flex: none;
    }
    
    .formula {
        flex-direction: column;
        gap: 15px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    h1 {
        font-size: 2em;
    }
}

/* État des molécules pendant l'animation */
.consuming .co2-molecule,
.consuming .h2o-molecule {
    animation: moleculeFloat 2s infinite ease-in-out;
}

.producing .glucose-molecule,
.producing .o2-molecule {
    opacity: 1;
    animation: moleculeEnter 1s ease-out;
}