/* Police et styles de base */
body {
    font-family: 'Roboto', sans-serif;
    color: #212121;
    line-height: 1.6;
    background: #f5f5f5 url('fond.jpg') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    overflow-x: hidden;
}

/* Sections */
.section {
    padding: 80px 20px;
    max-width: auto;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

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

/* Titres */
h2 {
    font-family: 'Lora', serif;
    font-size: 2.8rem;
    margin-bottom: 30px;
    color: #2E7D32;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: center;
    justify-content: center;
}

h3 {
    font-family: 'Lora', serif;
    font-size: 2rem;
    color: #5D4037;
}

/* Icônes */
.section-icon, .list-icon {
    font-size: 36px;
    color: #2E7D32;
    transition: transform 0.3s ease, color 0.3s ease;
}

.section-icon:hover, .list-icon:hover {
    transform: scale(1.15);
    color: #66BB6A;
}

.list-icon {
    font-size: 30px;
    margin-right: 20px;
}

/* Boutons */
.btn {
    display: inline-flex;
    padding: 14px 35px;
    background-color: #2E7D32;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    align-items: center;
    gap: 10px;
}

.btn:hover {
    background-color: #66BB6A;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Illustrations */
.illustration {
    width: 100%;
    max-width: 450px;
    margin: 30px auto;
    padding: 5px;
    border: 3px solid #2E7D32;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.15);
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.illustration:hover {
    transform: scale(1.03);
}

.illustration img {
    width: 100%;
    height: auto; /* << très important pour garder les proportions naturelles */
    border-radius: 12px; /* correspond à .illustration pour une belle cohérence */
    display: block;
}


/* Header */
header {
    background: #5D4037;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 50px;
    color: #2E7D32;
}

.logo h1 {
    font-family: 'Pacifico', cursive;
    font-size: 2.5rem;
    color: #2E7D32;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    color: #66BB6A;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 10px 25px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    color: white;
    background-color: #2E7D32;
}

.hamburger {
    display: none;
    font-size: 2rem;
    color: #66BB6A;
    cursor: pointer;
}

/* Section Accueil */
#inicio {
    text-align: center;
    background: none;
    position: relative;
}

.hero {
    position: relative;
}

.planet-animation {
    width: 500px;
    height: 500px;
    margin: 40px auto;
    animation: rotate 20s linear infinite;
    filter: drop-shadow(0 0 25px rgba(0, 0, 0, 0.3));
}

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

.background-image {
    width: 100%;
    max-width: 1000px;
    height: 350px;
    margin: 30px auto;
    background: url('fond2.JPG') no-repeat center center;
    background-size: cover;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.subtitle {
    font-family: 'Lora', serif;
    font-size: 1.6rem;
    margin: 20px 0;
    color: #212121;
}

.team {
    margin: 30px 0;
    padding: 25px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Section Reglas */
#reglas {
    background: none;
    padding: 0;
    max-width: 100%;
    margin: 0;
}

.rules-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.rule {
    width: 100%;
    padding: 50px 30px;
    border-radius: 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

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

.rule:nth-child(odd) {
    background: rgba(46, 125, 50, 0.85);
}

.rule:nth-child(even) {
    background: rgba(93, 64, 55, 0.85);
}

.rule .illustration {
    max-width: 600px;
    height: 350px;
}

/* Section Países */
#paises {
    background: linear-gradient(135deg, #5D4037 0%, #2E7D32 100%);
    text-align: center;
    padding: 100px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    position: relative;
}

#paises::before, #paises::after {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: rgba(102, 187, 106, 0.2);
    font-size: 150px;
    position: absolute;
    opacity: 0.2;
}

#paises::before {
    content: '\f57d';
    top: 20px;
    left: 20px;
}

#paises::after {
    content: '\f6d5';
    bottom: 20px;
    right: 20px;
}

#paises ul {
    list-style: none;
    margin: 40px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

#paises ul li {
    background: rgba(255, 255, 255, 0.2);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

#paises ul li:hover {
    transform: scale(1.03);
}

.map-placeholder {
    width: 100%;
    max-width: 900px;
    height: 500px;
    margin: 50px auto;
    border: 4px solid #2E7D32;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
}

#co2-chart {
    max-width: 900px;
    height: 450px;
    margin: 50px auto;
    padding: 25px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    border: 3px solid #66BB6A;
}

/* Section Cuestionario */
#cuestionario {
    background: linear-gradient(135deg, #2E7D32 0%, #66BB6A 100%);
    text-align: center;
    padding: 100px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    position: relative;
}

#cuestionario::before, #cuestionario::after {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: rgba(255, 255, 255, 0.15);
    font-size: 140px;
    position: absolute;
    opacity: 0.15;
}

#cuestionario::before {
    content: '\f059';
    top: 20px;
    left: 20px;
}

#cuestionario::after {
    content: '\f4fe';
    bottom: 20px;
    right: 20px;
}

#quiz {
    max-width: 850px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.3);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 3px solid #5D4037;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

#quiz:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

#user-name {
    width: 100%;
    padding: 15px;
    margin-bottom: 25px;
    border: 3px solid #2E7D32;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.35);
    color: #212121;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#user-name:focus {
    border-color: #66BB6A;
    background: rgba(255, 255, 255, 0.45);
    outline: none;
}

#question {
    font-size: 1.5rem;
    color: #5D4037;
    margin: 25px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    animation: fadeIn 0.5s ease;
}

#options {
    display: grid;
    gap: 20px;
}

#options button {
    padding: 15px;
    background-color: #5D4037;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
}

#options button:hover {
    background-color: #2E7D32;
    transform: scale(1.03);
}

#progress {
    width: 100%;
    height: 15px;
    background-color: rgba(255, 255, 255, 0.2);
    margin-top: 25px;
    border-radius: 8px;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    background-color: #66BB6A;
    width: 0;
    transition: width 0.5s ease-in-out;
}

#leaderboard {
    margin-top: 40px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 15px;
    border: 2px solid #2E7D32;
}

#leaderboard-list li {
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    margin: 10px 0;
    border-radius: 8px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Chatbot */
.chatbot-toggle {
    position: fixed;
    bottom: 60px;
    left: 20px;
    background-color: #2E7D32;
    color: white;
    padding: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

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

.chatbot {
    position: fixed;
    bottom: 60px;
    left: 20px;
    width: 400px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    border: 2px solid #2E7D32;
    display: none;
    animation: slideUp 0.5s ease-out;
}

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

.chatbot.active {
    display: block;
}

.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #5D4037;
    color: white;
    border-radius: 20px 20px 0 0;
}

.close-chatbot {
    cursor: pointer;
    font-size: 1.6rem;
    transition: transform 0.3s;
}

.close-chatbot:hover {
    transform: scale(1.2);
}

#chatbox {
    max-height: 350px;
    overflow-y: auto;
    padding: 20px;
}

#chatbox li {
    padding: 15px;
    margin: 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#chatbox .user {
    background-color: #8D6E63;
    color: white;
    text-align: right;
    justify-content: flex-end;
}

#chatbox .bot {
    background-color: #66BB6A;
    color: #212121;
}

#user-input {
    width: 100%;
    padding: 15px;
    border: none;
    border-top: 3px solid #2E7D32;
    border-radius: 0 0 20px 20px;
    background: rgba(255, 255, 255, 0.3);
    color: #212121;
    font-size: 1.1rem;
}

/* Bouton Retour en haut */
.back-to-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #2E7D32;
    color: white;
    padding: 15px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s;
}

.back-to-top:hover {
    background-color: #66BB6A;
    transform: scale(1.1);
}

/* Footer */
footer {
    background: #5D4037;
    color: white;
    text-align: center;
    padding: 30px;
    font-size: 1rem;
    box-shadow: 0 -5px 12px rgba(0, 0, 0, 0.25);
}

.leaderboard-link {
    text-align: center;
    margin-top: 20px;
}

.btn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #45a049;
}

/* Responsive Design */
@media (max-width: 1400px) { /* Ordinateurs moyens */
    .section {
        max-width: 1100px;
        padding: 60px 20px;
    }
    .planet-animation {
        width: 400px;
        height: 400px;
    }
    .background-image {
        max-width: 900px;
        height: 300px;
    }
    .rule .illustration {
        max-width: 500px;
        height: 300px;
    }
    .map-placeholder {
        max-width: 750px;
        height: 400px;
    }
    #co2-chart {
        max-width: 750px;
        height: 400px;
    }
    #quiz {
        max-width: 750px;
    }
}

@media (max-width: 900px) { /* Tablettes et iPads */
    .section {
        max-width: 700px;
        padding: 50px 15px;
        margin: 30px 10px;
    }
    h2 {
        font-size: 2.2rem;
    }
    .btn {
        padding: 12px 30px;
    }
    .planet-animation {
        width: 100%;
        height: auto;
    }
    .background-image {
        height: 250px;
    }
    .rule .illustration {
        max-width: 100%;
        height: 220px;
    }
    .map-placeholder {
        max-width: 100%;
        height: 350px;
    }
    #co2-chart {
        max-width: 100%;
        height: 350px;
    }
    .chatbot {
        width: 90%;
        left: 5%;
    }
    #quiz {
        padding: 30px;
    }
}

@media (max-width: 600px) { /* Téléphones */
    header {
        padding: 15px 20px;
    }
    .logo h1 {
        font-size: 2rem;
    }
    .hamburger {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #5D4037;
    }
    .nav-links.active {
        display: flex;
    }
    nav ul li {
        margin: 15px 0;
    }
    h2 {
        font-size: 1.8rem;
    }
    .section {
        padding: 40px 10px;
        margin: 20px 5px;
    }
    .rule {
        padding: 40px 15px;
    }
    .rule .illustration {
        height: 180px;
    }
    #quiz {
        padding: 20px;
    }
    #question {
        font-size: 1.3rem;
    }
    #options button {
        padding: 12px;
        font-size: 1rem;
    }
}

@media (min-width: 1400px) and (max-height: 900px) { /* Projecteurs */
    .section {
        max-width: 1600px;
        padding: 100px 40px;
    }
    h2 {
        font-size: 3.2rem;
    }
    .btn {
        padding: 18px 50px;
        font-size: 1.3rem;
    }
    .planet-animation {
        width: 700px;
        height: 700px;
    }
    .background-image {
        max-width: 1200px;
        height: 450px;
    }
    .rule .illustration {
        max-width: 800px;
        height: 450px;
    }
    .map-placeholder {
        max-width: 1100px;
        height: 600px;
    }
    #co2-chart {
        max-width: 1100px;
        height: 550px;
    }
    #quiz {
        max-width: 1000px;
        padding: 50px;
    }
}