
/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--glow-color);
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 10px;
    min-width: 100px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.countdown-item span {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--glow-color);
}

.countdown-item .label {
    font-size: 1rem;
    margin-top: 0.5rem;
    color: white;
    text-shadow: none;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cta-button {
    padding: 1rem 2rem;
    border: 2px solid var(--primary-color);
    border-radius: 30px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    background: rgba(0, 168, 255, 0.1);
    backdrop-filter: blur(5px);
}

.cta-button:hover {
    background: var(--primary-color);
    box-shadow: 0 0 20px var(--glow-color);
    transform: translateY(-3px);
}


.section-title {
    text-align: center;
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 15px var(--glow-color);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.game-card {
    background: rgba(25, 42, 86, 0.8);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0, 168, 255, 0.1);
    transition: var(--transition);
    border: 1px solid rgba(0, 168, 255, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(0, 168, 255, 0.2);
}

.game-card h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.game-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
}

.game-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.question-display {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    min-height: 40px;
    color: white;
}

.game-display input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
    padding: 0.8rem;
    border-radius: 5px;
    color: var(--text-light);
    font-size: 1.2rem;
    width: 100%;
    text-align: center;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.game-display input:focus {
    outline: none;
    box-shadow: 0 0 10px var(--glow-color);
}

.score-display, .timer-display {
    font-size: 1.2rem;
    margin-top: 0.5rem;
    color: white;
}

.game-button {
    background: linear-gradient(45deg, var(--primary-color), #0077cc);
    border: none;
    color: white;
    height: 22px;
    min-width: 80px;
    padding: 0 10px;
    font-size: 0.8rem;
    border-radius: 3px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    margin: 0;
}

.game-button:hover {
    background: linear-gradient(45deg, #0077cc, var(--primary-color));
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.game-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.game-button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.game-section {
    background: linear-gradient(135deg, rgba(25, 25, 35, 0.9), rgba(40, 40, 60, 0.9));
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    position: relative;
    min-height: 200px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.game-section h2 {
    color: #fff;
    font-size: 1.2rem;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-info {
    display: flex;
    gap: 10px;
}

.timer, .score {
    font-size: 0.9rem;
    color: #fff;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-controls {
    display: flex;
    gap: 10px;
}

.game-button {
    background: linear-gradient(135deg, #0077cc, #00a0ff);
    border: none;
    color: white;
    height: 35px;
    min-width: 100px;
    padding: 0 20px;
    font-size: 0.9rem;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #00a0ff, #0077cc);
}

.question-area {
    text-align: center;
    min-height: 60px;
    margin: 15px 0;
    font-size: 1.8rem;
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.answer-area {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
}

.game-input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    height: 45px;
    width: 140px;
    font-size: 1.6rem;
    text-align: center;
    border-radius: 5px;
    padding: 0 10px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.game-input:focus {
    outline: none;
    border-color: #0077cc;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(0, 119, 204, 0.3);
}

/* Message initial */
.question-area:empty::before {
    content: 'Appuyez sur Démarrer';
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.4rem;
    font-style: italic;
}

/* Ajustements spécifiques pour la géométrie */
#geometry-section {
    min-height: 400px;
}

#geometry-canvas {
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    margin: 1rem auto;
    display: block;
}

.game-instructions {
    padding: 4rem 2rem;
    background: rgba(26, 26, 46, 0.3);
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.instruction-card {
    background: rgba(25, 42, 86, 0.6);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 0 20px rgba(0, 168, 255, 0.1);
    transition: var(--transition);
    border: 1px solid rgba(0, 168, 255, 0.1);
}

.instruction-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.instruction-card p {
    color: var(--text-light);
    line-height: 1.6;
    text-align: center;
}

.game-instructions h2.section-title {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 2em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.games-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 80px; /* Pour éviter que ça ne soit caché sous la barre de navigation */
}

.math-games-section {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.games-grid {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-section {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(25, 42, 86, 0.8);
    border-radius: 15px;
    padding: 2rem;
    margin: 1rem;
    box-shadow: 0 0 20px rgba(0, 168, 255, 0.2);
}

.question-area {
    font-size: 1.2rem;
    margin: 1rem 0;
    min-height: 40px;
    color: var(--text-light);
}

.answer-area {
    margin: 1rem 0;
}

.game-input {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-light);
    font-size: 1.2rem;
    width: 100%;
    max-width: 200px;
}

.game-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.game-info {
    display: flex;
    gap: 1rem;
}

.game-controls {
    display: flex;
    gap: 1rem;
}

.game-button {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 25px;
    padding: 0.7rem 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.game-button:hover {
    background: var(--secondary-color);
    box-shadow: 0 0 15px var(--glow-color);
    transform: translateY(-2px);
}

.game-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Activities Section */
.activities {
    padding: 4rem 2rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    justify-items: center;
    align-items: center;
}

.activity-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    transition: transform 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 168, 255, 0.2);
}

.activity-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 30px rgba(0, 168, 255, 0.3);
}

.activity-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.activity-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.activity-card ul {
    list-style-position: inside;
}

/* Program Section */
.program-section {
    padding: 60px 20px;
    background: linear-gradient(45deg, #1a1a2e, #16213e, #1a1a2e);
    position: relative;
    overflow: hidden;
}

.program-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.program-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(0, 168, 255, 0.2);
    transition: all 0.3s ease;
}

.program-image:hover {
    transform: scale(1.02);
    box-shadow: 0 0 40px rgba(0, 168, 255, 0.4);
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 168, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.glow-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.glow-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0, 168, 255, 0.5), transparent);
    animation: glow-line-animation 8s infinite;
}

.glow-line:nth-child(1) { left: 20%; animation-delay: 0s; }
.glow-line:nth-child(2) { left: 50%; animation-delay: 2s; }
.glow-line:nth-child(3) { left: 80%; animation-delay: 4s; }

@keyframes glow-line-animation {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .program-container {
        padding: 20px;
    }
    
    .program-image {
        max-width: 95%;
    }
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
    padding: 2rem;
    margin-top: 3rem;
    backdrop-filter: blur(10px);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    border-radius: 25px;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--glow-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .nav-container {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .time-block {
        flex-direction: column;
        gap: 1rem;
    }

    .countdown {
        gap: 1rem;
    }
    
    .countdown-item {
        min-width: 70px;
        padding: 0.5rem;
    }
    
    .countdown-item span {
        font-size: 1.5rem;
    }
    
    .countdown-item .label {
        font-size: 0.8rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* Animations */
@keyframes glow {
    0% { box-shadow: 0 0 5px var(--glow-color); }
    50% { box-shadow: 0 0 20px var(--glow-color); }
    100% { box-shadow: 0 0 5px var(--glow-color); }
}

.rules-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin: 20px auto;
    max-width: 1200px;
    gap: 30px;
    padding: 0 20px;
}

.rule-card {
    flex: 1;
    background: linear-gradient(145deg, #00a8ff40, #00a8ff20);
    border: 2px solid #00a8ff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 168, 255, 0.2);
    transition: transform 0.3s ease;
    width: calc(33.33% - 20px);
    display: flex;
    flex-direction: column;
}

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

.rule-card h3 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rule-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.rule-card li {
    margin: 10px 0;
    color: white;
    font-size: 1.1em;
    line-height: 1.4;
    text-align: left;
    padding-left: 10px;
}


.logo-container {
    display: flex; /* Use flexbox for layout */
    flex-wrap: wrap; /* Allow logos to wrap to the next line */
    justify-content: center; /* Center logos horizontally */
    margin-top: 10px; /* Space above the logo container */
}

.logo-container a {
    flex: 1 0 21%; /* Allow four logos per line with some space */
    margin: 10px; /* Space between logos */
    display: inline-block; /* Allow for margin to work */
    max-width: 100px; /* Limit logo size */
}

.logo-container img {
    width: 100%; /* Make the image fill the container */
    height: auto; /* Maintain aspect ratio */
    transition: transform 0.3s; /* Smooth hover effect */
}

.logo-container img:hover {
    transform: scale(1.1); /* Scale up on hover for effect */
}.logo-container {
    display: flex; /* Use flexbox for layout */
    flex-wrap: wrap; /* Allow logos to wrap to the next line */
    justify-content: center; /* Center logos horizontally */
    margin-top: 10px; /* Space above the logo container */
    background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent white background */
    padding: 20px; /* Padding around the logos */
    border-radius: 10px; /* Rounded corners */
}.logo-container a {
    flex: 1 0 18%; /* Allow for 5 logos in the first row */
    margin: 10px; /* Space between logos */
    display: inline-block; /* Allow for margin to work */
    max-width: 100px; /* Limit logo size */
}

@media (max-width: 800px) {
    .logo-container a {
        flex: 1 0 22%; /* Adjust for 4 logos in the second row on smaller screens */
    }
}


.title {
    align-items: center;
    margin-top: 20px;
    color: #333;
}

.carousel {
    margin: 20px auto;
    overflow: hidden;
    width: 90%;
    border: 2px solid #ccc;
    border-radius: 10px;
    background-color: white;
}

.carousel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-item {
    min-width: 200px;
    margin: 10px;
    text-align: center;
}

.carousel-item img {
    max-width: 100px;
    max-height: 100px;
    display: block;
    margin: 0 auto;
}

.carousel-item p {
    margin-top: 10px;
    color: #555;
}