/* ==================== VARIABLES & STYLES DE BASE ==================== */
:root {
    --bg-color-light: #f4f4f9;
    --text-color-light: #333;
    --card-bg-light: rgba(255, 255, 255, 0.4);
    --primary-color: #6a5acd;
    --secondary-color: #00bfa5;
    --border-color-light: rgba(255, 255, 255, 0.6);
    --shadow-light: 0 8px 32px 0 rgba(106, 90, 205, 0.2);

    --bg-color-dark: #12121c;
    --text-color-dark: #f0f0f0;
    --card-bg-dark: rgba(30, 30, 50, 0.4);
    --border-color-dark: rgba(255, 255, 255, 0.1);
    --shadow-dark: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --font-family: 'Poppins', sans-serif;
    --transition-speed: 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--bg-color-light);
    color: var(--text-color-light);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    background-image: 
        radial-gradient(circle at 1% 1%, var(--secondary-color), transparent 30%),
        radial-gradient(circle at 99% 99%, var(--primary-color), transparent 40%);
    background-attachment: fixed;
}

body.dark-mode {
    background-color: var(--bg-color-dark);
    color: var(--text-color-dark);
}

.section-container {
    padding: 80px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3 {
    font-weight: 600;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto;
    border-radius: 2px;
}


/* ==================== EFFET LIQUID GLASS ==================== */
.liquid-glass {
    background: var(--card-bg-light);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid var(--border-color-light);
    box-shadow: var(--shadow-light);
    transition: background var(--transition-speed), border var(--transition-speed), box-shadow var(--transition-speed);
}

body.dark-mode .liquid-glass {
    background: var(--card-bg-dark);
    border: 1px solid var(--border-color-dark);
    box-shadow: var(--shadow-dark);
}


/* ==================== HEADER & MENU ==================== */
header {
    position: fixed;
    top: 20px;
    left: 5%;
    width: 90%;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    width: 100%;
    box-sizing: border-box;
    background: var(--card-bg-light);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 30px;
    border: 1px solid var(--border-color-light);
    box-shadow: var(--shadow-light);
    transition: background var(--transition-speed), border var(--transition-speed), box-shadow var(--transition-speed);
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: inherit;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 35px;
}

.nav-link {
    text-decoration: none;
    color: inherit;
    font-weight: 400;
    position: relative;
    transition: color var(--transition-speed);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-color-light);
    transition: all 0.3s ease-in-out;
}

body.dark-mode .bar {
    background-color: var(--text-color-dark);
}

/* ==================== MODE SOMBRE/CLAIR TOGGLE ==================== */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}
.theme-switch {
    display: inline-block;
    height: 26px;
    position: relative;
    width: 50px;
}
.theme-switch input {
    display:none;
}
.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}
.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 18px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 18px;
}
input:checked + .slider {
    background-color: var(--primary-color);
}
input:checked + .slider:before {
    transform: translateX(24px);
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}


/* ==================== PAGE D'ACCUEIL ==================== */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.animated-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h1 {
    font-size: 4.5rem;
    margin: 0;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2rem;
    margin-top: 20px;
}

/* ==================== PAGE À PROPOS ==================== */
.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
    padding: 40px;
}

.about-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--secondary-color);
}

.about-text {
    flex: 1;
}


/* ==================== PAGE SERVICES ==================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    padding: 40px;
    text-align: center;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px 0 rgba(106, 90, 205, 0.3);
}

body.dark-mode .service-card:hover {
     box-shadow: 0 12px 40px 0 rgba(0,0,0, 0.4);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* ==================== PAGE EXPERTISE ==================== */
.expertise-content {
    padding: 40px;
}
.skill {
    margin-bottom: 25px;
}
.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}
.skill-bar-container {
    width: 100%;
    background-color: rgba(0,0,0,0.1);
    border-radius: 5px;
}
body.dark-mode .skill-bar-container {
    background-color: rgba(255,255,255,0.1);
}
.skill-bar {
    height: 10px;
    width: 0; /* Animé par JS */
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 5px;
    transition: width 1.5s ease-in-out;
}

/* ==================== PORTFOLIO ==================== */
.portfolio-filters {
    text-align: center;
    margin-bottom: 40px;
}
.filter-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-speed);
}
.filter-btn:hover, .filter-btn.active {
    background: var(--primary-color);
    color: white;
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.portfolio-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.portfolio-item img {
    width: 100%;
    display: block;
    transition: transform 0.4s ease;
}
.portfolio-item:hover img {
    transform: scale(1.1);
}
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

/* ==================== BOUTON CONTACT ==================== */
.contact-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all var(--transition-speed);
    z-index: 999;
    overflow: hidden;
}
.contact-btn span {
    position: absolute;
    width: 120px;
    opacity: 0;
    transform: translateX(20px);
    transition: all var(--transition-speed);
    font-size: 1rem;
}
.contact-btn:hover {
    width: 200px;
    border-radius: 30px;
    justify-content: flex-start;
    padding-left: 20px;
}
.contact-btn:hover i {
    margin-right: 15px;
}
.contact-btn:hover span {
    opacity: 1;
    transform: translateX(0);
}


/* ==================== FOOTER ==================== */
footer {
    padding: 40px 5%;
    margin-top: 50px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}
.footer-col h3 {
    margin-bottom: 20px;
}
.footer-col ul {
    list-style: none;
    padding: 0;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}
.footer-col ul li a:hover {
    color: var(--primary-color);
}
.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    color: inherit;
    transition: all var(--transition-speed);
}
.social-links a:hover {
    background: var(--primary-color);
    color: white;
}
.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color-light);
}
body.dark-mode .footer-bottom {
    border-top: 1px solid var(--border-color-dark);
}

/* ==================== RESPONSIVITÉ ==================== */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: var(--card-bg-light);
        backdrop-filter: blur(20px);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: 0.3s;
        gap: 0;
        justify-content: center;
    }

    body.dark-mode .nav-menu {
        background-color: var(--card-bg-dark);
    }

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

    .nav-item {
        margin: 16px 0;
    }

    .nav-link {
        font-size: 1.5rem;
    }

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

}