/* Variables CSS pour une cohérence des couleurs */
:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --accent-gradient: linear-gradient(135deg, #f43f5e 0%, #f97316 100%);
    --background: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --border-radius: 12px;
}

/* Reset moderne */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Styles de base améliorés */
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background);
    background-image: 
        radial-gradient(at 40% 20%, rgba(99, 102, 241, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(59, 130, 246, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Header avec animation et effet de verre */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

header h1 {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

/* Navigation moderne */
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.5rem;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-block;
    font-weight: 500;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--secondary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    border-radius: var(--border-radius);
}

nav a:hover::before,
nav a.active::before {
    opacity: 1;
}

nav a:hover,
nav a.active {
    color: white;
    transform: translateY(-2px);
}

/* Contenu principal */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    animation: slideUp 0.5s ease-out;
}

section {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg), 0 15px 30px rgba(0,0,0,0.1);
}

h2 {
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--secondary-gradient);
    border-radius: 3px;
}

/* Grille de photos améliorée */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.photo-grid img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius);
    transition: all 0.5s ease;
    box-shadow: var(--shadow-md);
}

.photo-grid img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: var(--shadow-lg);
}

/* Formulaire de contact stylisé */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

input,
textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
    box-shadow: var(--shadow-md);
}

textarea {
    height: 150px;
    resize: vertical;
}

button {
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.3s ease;
}

button:hover::after {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Tableau d'agenda amélioré */
.timetable {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
}

th, td {
    padding: 1.25rem;
    text-align: left;
    border: none;
}

th {
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

th:first-child {
    border-top-left-radius: var(--border-radius);
}

th:last-child {
    border-top-right-radius: var(--border-radius);
}

tr:last-child td:first-child {
    border-bottom-left-radius: var(--border-radius);
}

tr:last-child td:last-child {
    border-bottom-right-radius: var(--border-radius);
}

/* Couleurs des cours avec dégradés */
table {
    width: 80%;
    border-collapse: collapse;
    text-align: center;
    margin: auto;
}

th, td {
    padding: 15px;
    border: 1px solid black;
}

.algo {
    background-color: #FFD700; /* Jaune */
}

.genie {
    background-color: #FF69B4; /* Rose */
}

.anglais {
    background-color: #FFB6C1; /* Orange clair */
}

.bases {
    background-color: #D8BFD8; /* Mauve */
}

.reseaux {
    background-color: #87CEEB; /* Bleu clair */
}

.programmation {
    background-color: #90EE90; /* Vert clair */
}

.sport {
    background-color: #008000; /* Vert foncé */
    color: white;
}

.systemes {
    background: #B22222; /* Rouge foncé */
    color: white;
}

.techweb {
    background-color: #006400; /* Vert forêt */
    color: white;
}

/* CV stylisé */
.cv-content {
    max-width: 800px;
    margin: 0 auto;
}

.cv-item {
    margin-bottom: 2rem;
    padding: 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cv-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
}

.cv-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-lg);
}

.cv-item h4 {
    color: #6366f1;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* Footer élégant */
footer {
    background: var(--primary-gradient);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

footer:hover::before {
    transform: translateY(0);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Design amélioré */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    nav ul {
        flex-direction: row;
        gap: 0.5rem;
    }

    nav a {
        display: inline;
        text-align: center;
    }

    main {
        padding: 0 1rem;
    }

    .photo-grid {
        grid-template-columns: 1fr;
    }

    section {
        padding: 1.5rem;
    }

    .cv-item {
        padding: 1.5rem;
    }
}

/* Effet de scroll fluide */
html {
    scroll-behavior: smooth;
}

/* Sélection de texte stylisée */
::selection {
    background: #6366f1;
    color: white;
}
body {
    font-family: Arial, sans-serif;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 300px;
}

.item {
    display: flex;
    align-items: center;
    font-size: 16px;
}

.color-box {
    width: 20px;
    height: 20px;
    display: inline-block;
    margin-right: 10px;
    border: 1px solid black;
}

/* Couleurs spécifiques */
.algo { background-color: yellow; }
.anglais { background-color: brown; }
.bdd { background-color: purple; }
.genie { background-color: pink; }
.prog { background-color: lightgreen; }
.reseaux { background-color: blue; }
.sport { background-color: green; }
.systemes { background-color: red; }
.web { background-color: darkgreen; }