/* Reset et variables CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Mode clair */
    --bg-color: #f9f9f9;
    --text-color: #333;
    --primary-color: #1a73e8;
    --secondary-color: #555;
    --accent-color: #fff;
    --card-bg: #fff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Mode sombre */
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --primary-color: #4a90e2;
    --secondary-color: #bbb;
    --accent-color: #2c2c2c;
    --card-bg: #333;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
}

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

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--accent-color);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color 0.3s;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.logo a{
    text-decoration: none;
    color: var(--primary-color);
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-size: 1rem;
    transition: color 0.3s;
}

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

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

/* Bouton de bascule thème */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.theme-toggle .fa-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .fa-sun {
    display: inline;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    display: none;
}

/* Hero */
#hero {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    color: var(--accent-color);
    text-align: center;
    padding: 2rem;
    margin-top: 60px;
    overflow: hidden;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), #6ab0f3, #1a73e8);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    z-index: -2;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: auto;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    pointer-events: none;
}

.hero-content * {
    pointer-events: auto;
}

.hero-avatar {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    border: 2px solid var(--accent-color);
    margin-bottom: 1.5rem;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 2rem;
    max-width: 600px;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--accent-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow);
    text-align: center;
    cursor: pointer;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .btn:hover {
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Style spécifique pour le bouton du formulaire */
.btn-form {
    border: none; /* Supprime la bordure par défaut des boutons */
    outline: none; /* Supprime le contour au focus */
    background-color: var(--accent-color); /* Même fond que .btn */
    color: var(--primary-color); /* Même texte que .btn */
    padding: 0.8rem 2rem; /* Même padding que .btn */
    font-family: 'Poppins', sans-serif; /* Même police */
    font-size: 1rem; /* Taille de police cohérente */
    font-weight: 600; /* Même graisse que .btn */
    line-height: 1.6; /* Alignement vertical */
}

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

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--secondary-color);
}

/* About */
#about {
    background-color: var(--card-bg);
    text-align: center;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

#about p {
    margin-bottom: 1.5rem;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    text-align: center;
}

.skill-item {
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 1rem;
    border-radius: 5px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.3s;
}

.skill-item i {
    font-size: 1.2rem;
}

.skill-item:hover {
    transform: translateY(-5px);
}

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

.project-item {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 5px;
    box-shadow: var(--shadow);
    text-align: center;
}

.project-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.project-item a:hover {
    text-decoration: underline;
}

/* Contact */
#contact {
    text-align: center;
    background-color: var(--bg-color);
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.2rem;
}

.social-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--secondary-color);
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Formulaire de contact */
#contact-form {
    max-width: 600px;
    margin: 1.5rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    padding: 0.8rem;
    border: 1px solid var(--secondary-color);
    border-radius: 5px;
    font-size: 1rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(26, 115, 232, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

#contact-form .btn {
    align-self: center;
    padding: 0.8rem 3rem;
}

.form-message {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
}

.form-message.error {
    color: #e74c3c;
}

.form-message.success {
    color: #2ecc71;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--accent-color);
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

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

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

    .hamburger {
        display: block;
    }

    .nav-container {
        display: none;
    }

    .nav-container.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: var(--accent-color);
        padding: 1rem;
    }

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

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

    .hero-avatar {
        width: 100px;
        height: 100px;
    }

    #hero {
        margin-top: 60px;
    }

    #contact-form {
        max-width: 100%;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    section {
        padding: 2rem 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .skill-item {
        font-size: 0.9rem;
    }

    .skill-item i {
        font-size: 1rem;
    }

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

    .form-group input,
    .form-group textarea {
        font-size: 0.9rem;
    }

    .btn, .btn-form {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}