/* Variables globales */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #8a2be2;
    --text-color: #ffffff;
    --background-color: #121212;
    --card-background: #1e1e1e;
    --hover-color: #9d4edd;
    --transition-speed: 0.3s;
    --shadow-small: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

/* Styles communs */
.nav-links a, .grid-button, .social-link, .work-card, .back-button, .scroll-top {
    transition: all var(--transition-speed) ease;
}

/* Styles de boutons communs */
.back-button, .scroll-top {
    color: var(--text-color);
    font-weight: 500;
    background-color: var(--secondary-color);
    box-shadow: var(--shadow-small);
    border: none;
    cursor: pointer;
}

/* Styles de cartes communs */
.grid-button, .work-card {
    background-color: var(--card-background);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    color: var(--text-color);
}

/* Styles de liens communs */
.nav-links li a, .social-links a, .breadcrumb a {
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

main {
    flex: 1;
    margin-top: 80px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Header et Navigation */
.navbar {
    background-color: var(--primary-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--secondary-color);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--secondary-color);
}

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

.nav-links li a {
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-weight: 500;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--secondary-color);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-links li a:hover::after {
    width: 100%;
}

.nav-links li a:hover {
    background-color: rgba(138, 43, 226, 0.1);
}

/* Navigation active */
.nav-links li a.active {
    color: var(--secondary-color);
    font-weight: bold;
}

.nav-links li a.active::after {
    width: 100%;
    background-color: var(--secondary-color);
}

/* Contenu principal */
.container {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

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

.grid-button {
    display: block;
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    text-align: center;
}

.grid-button:hover {
    background-color: var(--hover-color);
}

.grid-button h2 {
    color: var(--text-color);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem;
    margin-top: auto;
    border-top: 2px solid var(--secondary-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-right: 1rem;
    transition: color 0.3s ease;
}

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

/* Animation du menu hamburger */
.menu-toggle {
    display: none;
    position: relative;
    width: 30px;
    height: 22px;
    cursor: pointer;
    margin-left: auto;
}

.menu-toggle span {
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: var(--secondary-color);
    transition: all 0.3s ease-in-out;
}

.menu-toggle span:nth-child(1) {
    top: 0;
}

.menu-toggle span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.menu-toggle span:nth-child(3) {
    bottom: 0;
}

/* Animation du menu hamburger actif */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 50%;
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 50%;
}

/* Animation du menu mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: auto;
        background-color: var(--primary-color);
        padding: 1.5rem;
        transition: left 0.3s ease-in-out;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
        border-bottom: 2px solid var(--secondary-color);
        z-index: 999;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li a {
        font-size: 1.1rem;
        padding: 0.8rem 1.5rem;
        width: 100%;
        text-align: center;
    }

    main {
        margin-top: 90px;
    }

    .container {
        padding: 1rem;
        width: 95%;
        margin-bottom: 2rem;
    }

    .work-card {
        max-width: 100%;
        margin: 0 auto;
    }

    .work-card .description {
        font-size: 0.95rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem 0;
    }

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

/* Très petits écrans */
@media (max-width: 480px) {
    .navbar {
        padding: 0.8rem 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-links li a {
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }

    .work-card {
        padding: 1rem;
    }

    .back-button, .scroll-top {
        bottom: 70px;
        padding: 0.5rem 1rem;
    }

    .scroll-top {
        right: 10px;
    }

    .breadcrumb {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
}

h1 {
    margin-bottom: 2rem;
}

/* Style pour la grille des travaux */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.work-card {
    background-color: var(--card-background);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px var(--secondary-color);
}

.work-card h2 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.work-card .date {
    color: var(--hover-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.work-card .description {
    line-height: 1.8;
    max-width: 65ch;
    margin: 1rem auto;
}

.work-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.work-card .tag {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

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

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

.work-card .links a:hover {
    color: var(--hover-color);
}

/* Styles pour le projet PHP */
.project-section {
    background-color: var(--card-background);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.project-info {
    display: flex;
    gap: 2rem;
    margin: 1rem 0;
    color: var(--hover-color);
}

.project-description {
    margin: 1.5rem 0;
    line-height: 1.6;
}

.features {
    margin: 2rem 0;
}

.features h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.features ul {
    list-style-position: inside;
    padding-left: 1rem;
}

.features li {
    margin: 0.5rem 0;
}

/* Bouton retour en haut */
.scroll-top {
    position: fixed;
    bottom: 100px;
    right: 80px;
    padding: 10px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    transition: all var(--transition-speed) ease;
    color: #ffffff;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scroll-top.visible {
    opacity: 1;
}

/* Supprimer le bouton de thème */
.theme-toggle {
    display: none;
}

/* Fil d'Ariane */
.breadcrumb {
    background-color: var(--primary-color);
    padding: 0.5rem 2rem;
    margin-top: 70px;
    border-bottom: 1px solid var(--secondary-color);
}

.breadcrumb a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--hover-color);
}

.breadcrumb .separator {
    color: var(--text-color);
    margin: 0 0.5rem;
}

.breadcrumb .current {
    color: var(--text-color);
}

/* Bouton retour */
.back-button {
    position: fixed;
    left: 20px;
    bottom: 100px;
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed) ease;
    z-index: 1000;
    border: none;
    cursor: pointer;
    color: #ffffff;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.back-button:hover {
    background-color: var(--hover-color);
    transform: translateX(-5px);
}

.back-button::before {
    content: '←';
    font-size: 1.2rem;
}

/* Amélioration de l'accessibilité */
*:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Amélioration du contraste des liens */
.nav-links li a {
    color: #ffffff;
    font-weight: 500;
}

.work-card .links a {
    color: var(--secondary-color);
    font-weight: 500;
    text-decoration: underline;
}

/* Amélioration de la lisibilité des textes */
.work-card .description {
    line-height: 1.8;
    max-width: 65ch;
    margin: 1rem auto;
}

/* Amélioration des contrastes pour les boutons */
.back-button, .scroll-top {
    color: #ffffff;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Amélioration de la visibilité du focus sur les cards */
.work-card:focus-within {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
    box-shadow: 0 0 10px var(--secondary-color);
}

/* Form Styling */
form {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.1);
}

.style1, .style2 {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.style1:focus, .style2:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(138, 43, 226, 0.2);
}

.style {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="submit"].style {
    background-color: var(--secondary-color);
    color: white;
}

input[type="submit"].style:hover {
    background-color: #7b1fa2;
}

input[type="reset"].style {
    background-color: #f5f5f5;
    color: #666;
}

input[type="reset"].style:hover {
    background-color: #e0e0e0;
}

form a {
    display: block;
    margin-top: 1rem;
    color: var(--secondary-color);
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

form a:hover {
    text-decoration: underline;
}

form h1 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
}