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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --gray-color: #6b7280;
    --success-color: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    color: var(--dark-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--dark-color);
}

.logo span {
    color: var(--primary-color);
}

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

.nav-menu li {
    margin-left: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: var(--transition);
}

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

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

/* Hero Section */
.hero {
    padding-top: 120px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.highlight {
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--gray-color);
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.hero-social {
    display: flex;
    gap: 15px;
}

.hero-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: white;
    border-radius: 50%;
    color: var(--primary-color);
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.hero-social a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.image-placeholder {
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 5rem;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.3);
}

.image-placeholder img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 50px;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.about-info {
    margin-top: 30px;
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.info-item {
    display: flex;
}

/* ============================== */

/* Ajoutez à la fin de votre fichier style.css */

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth transitions pour les cartes */
.education-card, .skill-category {
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

/* Effets de hover améliorés */
.interest-item:hover, .skill-category:hover, .education-card:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Animations de texte */
.typing-text {
    overflow: hidden;
    border-right: 2px solid #2563eb;
    white-space: nowrap;
    animation: typing 3.5s 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: #2563eb }
}

/* Responsive amélioré */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .skill-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* ============ CORRECTIONS POUR LE SCROLL ============ */

/* Fix pour la section hero */
.hero {
    padding-top: 120px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Espacement entre sections */
section {
    padding: 80px 0;
    position: relative;
    z-index: 2;
}

/* Ajustement de la navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 15px 0;
}

/* Correction pour le margin-top automatique */
#apropos, #competences, #experience, #formations, #contact {
    scroll-margin-top: 80px;
}

/* Effet de séparation entre sections */
section:not(.hero)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    z-index: -1;
}

/* Alternance de couleurs de fond */
.about, .experience, .contact {
    background-color: #f8fafc;
}

.skills, .education, .projects {
    background-color: white;
}

/* Transition fluide entre sections */
.section-transition {
    height: 50px;
    background: linear-gradient(to bottom, transparent, #f8fafc);
    margin-top: -50px;
    position: relative;
    z-index: 1;
}

/* ============ SECTION PROJETS ============ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.project-card {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    height: 200px;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

.project-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.project-category {
    display: inline-block;
    background-color: #dbeafe;
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.project-content p {
    color: var(--gray-color);
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-tech, .project-clients {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tech-tag {
    background-color: #f3f4f6;
    color: var(--dark-color);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.client-tag {
    background-color: #f0f9ff;
    color: #0369a1;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #bae6fd;
}

.projects-cta {
    text-align: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 40px;
    border-radius: 15px;
    margin-top: 30px;
}

.projects-cta p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

/* ============ AMÉLIORATIONS FORMULAIRE ============ */

/* États du formulaire */
.form-group.focused label {
    color: var(--primary-color);
    transform: translateY(-25px);
    font-size: 0.9rem;
}

.form-group.valid input,
.form-group.valid textarea {
    border-color: var(--success-color);
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Confirmation d'envoi */
.form-confirmation {
    background-color: #d1fae5;
    border: 2px solid #10b981;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    animation: slideIn 0.5s ease;
}

.form-confirmation i {
    color: #10b981;
    font-size: 3rem;
    margin-bottom: 15px;
}

.form-confirmation h3 {
    color: #065f46;
    margin-bottom: 10px;
}

.form-confirmation p {
    color: #047857;
}

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

/* Loading state amélioré */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.fa-spinner {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

/* Labels flottants (optionnel) */
.form-group {
    position: relative;
}

.form-group label {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--gray-color);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -10px;
    left: 10px;
    font-size: 0.8rem;
    background-color: white;
    padding: 0 5px;
    color: var(--primary-color);
}