:root {
    --primary-color: #8B4513;
    --secondary-color: #D2691E;
    --accent-color: #CD853F;
    --bg-light: #FFF8DC;
    --text-dark: #2F1B14;
    --text-light: #FFFFFF;
    --shadow: rgba(139, 69, 19, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    text-align: center;
    padding: 8rem 2rem 4rem;
    margin-top: 60px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Sections */
.section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
}

.section h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: var(--secondary-color);
    margin: 1rem auto;
    border-radius: 2px;
}

/* Histoire */
.histoire-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow);
    margin-bottom: 2rem;
}

.histoire-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Projets */
.projets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.projet-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: visible;
}

.projet-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px var(--shadow);
}

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

.projet-card p {
    margin-bottom: 1rem;
}

.projet-status {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.status-actif {
    background: #e8f5e8;
    color: #2d5016;
}

.status-planifie {
    background: #fff3cd;
    color: #856404;
}

/* Team */
.team-section {
    background: white;
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow);
}

.team-section h3 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.member-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 15px;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: visible;
}

.member-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(139, 69, 19, 0.2);
}

.member-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--secondary-color);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    font-weight: bold;
}

.member-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.member-role {
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.member-description {
    font-size: 0.9rem;
    color: #666;
}

.admin-referent {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: var(--text-light);
    text-align: center;
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

/* Animations magiques */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardShuffle {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    25% {
        transform: translateX(var(--random-x, 100px)) translateY(var(--random-y, -50px)) rotate(var(--random-rotation, 15deg)) scale(0.8);
        opacity: 0.7;
    }
    50% {
        transform: translateX(var(--random-x2, -80px)) translateY(var(--random-y2, 30px)) rotate(var(--random-rotation2, -20deg)) scale(1.1);
        opacity: 0.5;
    }
    75% {
        transform: translateX(var(--random-x3, 50px)) translateY(var(--random-y3, -20px)) rotate(var(--random-rotation3, 10deg)) scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: translateX(0) translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
}

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

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

@keyframes magicGlow {
    0%, 100% {
        box-shadow: 0 5px 20px var(--shadow);
    }
    50% {
        box-shadow: 0 5px 30px rgba(139, 69, 19, 0.3), 0 0 50px rgba(210, 105, 30, 0.2);
    }
}

.fade-in {
    animation: fadeInUp 0.8s ease;
}

.magic-card {
    position: relative;
    overflow: visible;
    transition: all 0.3s ease;
}

.magic-card::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, transparent, rgba(210, 105, 30, 0.2), transparent);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.magic-card:hover::before {
    opacity: 1;
}

.magic-card.shuffling {
    animation: cardShuffle 2s ease-in-out;
    z-index: 10;
}

.magic-card.floating {
    animation: cardFloat 3s ease-in-out infinite;
}

.magic-card.glowing {
    animation: magicGlow 2s ease-in-out infinite;
}

.sparkle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffd700, transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
}

.sparkle::before,
.sparkle::after {
    content: '✨';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    animation: sparkle 1.5s ease-in-out infinite;
}

.sparkle::after {
    animation-delay: 0.7s;
}

/* Animation de reveal spectaculaire */
.spectacle-reveal {
    opacity: 0;
    transform: perspective(1000px) rotateX(90deg) translateZ(100px);
    transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spectacle-reveal.revealed {
    opacity: 1;
    transform: perspective(1000px) rotateX(0deg) translateZ(0px);
}

/* Animation de typing pour le héro */
.typing-text {
    border-right: 3px solid var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--text-light); }
}

/* Particle effects */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    top: 0;
    left: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: float-particles 6s linear infinite;
}

@keyframes float-particles {
    0% {
        transform: translateY(100vh) translateX(0px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Animation de rotation 3D pour les avatars */
.member-avatar {
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.member-avatar:hover {
    transform: rotateY(360deg) scale(1.1);
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.3);
}

/* Animation de wave pour le texte */
.wave-text {
    display: inline-block;
}

.wave-text span {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
    animation-delay: calc(0.1s * var(--i));
}

@keyframes wave {
    0%, 40%, 100% {
        transform: translateY(0);
    }
    20% {
        transform: translateY(-20px);
    }
}

/* Effet de morphing sur les sections */
.morph-section {
    transform: perspective(1000px) rotateY(5deg);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.320, 1);
}

.morph-section.in-view {
    transform: perspective(1000px) rotateY(0deg);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--primary-color);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 2px 10px var(--shadow);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        text-align: center;
        padding: 0.5rem 0;
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

    .section {
        padding: 2rem 1rem;
    }

    .section h2 {
        font-size: 2rem;
    }

    .projets-grid, .team-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .hero {
        padding: 6rem 1rem 3rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .membre-card {
        padding: 1rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Theme toggler (temporaire pour tests) */
.theme-controls {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    z-index: 999;
}

.theme-controls label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.color-input {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
