/* ============ Variables & Fonts ============ */
:root {
    --bg-color: #fdfdfd;
    --text-color: #111;
    --accent-color: #00aaff;
    --header-bg: #111;
    --header-text: #fff;
    --section-padding: 4rem 2rem;
}

html {
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body.dark {
    --bg-color: #111;
    --text-color: #fdfdfd;
    --header-bg: #222;
    --header-text: #fff;
    --accent-color: #00d4ff;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Header */
header {
    background: var(--header-bg);
    color: var(--header-text);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: relative;
}
header h1 {
    font-family: 'Roboto Mono', monospace;
    margin: 0;
    font-size: 1.5rem;
    flex: 1;
    text-align: left;
}

.header-title-link {
    color: var(--header-text);
    text-decoration: none;
    transition: none;
}

.header-title-link:hover {
    color: var(--header-text);
    text-decoration: none;
}
nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
nav a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}
nav a:hover {
    color: var(--accent-color);
}
#themeToggle {
    background: transparent;
    border: none;
    color: var(--header-text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s;
    padding: 0.5rem;
    min-width: 44px;
}
#themeToggle:hover {
    transform: rotate(20deg);
}

/* Menu hamburger pour mobile */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--header-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s;
}
.menu-toggle:hover {
    transform: scale(1.1);
}
.menu-toggle.active {
    transform: rotate(90deg);
}

/* Sections */
section {
    max-width: 1000px;
    margin: auto;
    padding: var(--section-padding);
    width: 100%;
    box-sizing: border-box;
}

/* Section Hero spécifique */
#hero {
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.05) 0%, rgba(0, 212, 255, 0.03) 100%);
    border-radius: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

#hero .hero-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--section-padding);
    box-sizing: border-box;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(0, 170, 255, 0.02) 50%, transparent 70%);
    animation: hero-shine 8s ease-in-out infinite;
}

@keyframes hero-shine {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

#hero h2 {
    font-family: 'Roboto Mono', monospace;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    position: relative;
    z-index: 1;
}

#hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.hero-btn {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 2rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.3);
}

.hero-btn:hover {
    background: #0088cc;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 170, 255, 0.4);
}

.hero-btn:active {
    transform: translateY(-1px);
}

h2 {
    font-family: 'Roboto Mono', monospace;
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Skills & Certifications Grid */

#skills ul, #certifications ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Nouvelle section Skills avec barres de progression */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.skills-category h3 {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.3rem;
}

.skill-item {
    margin-bottom: 0.75rem;
    padding: 0.6rem;
    background: rgba(0, 170, 255, 0.05);
    border-radius: 5px;
    border-left: 2px solid var(--accent-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.skill-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 170, 255, 0.2);
}

.skill-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.skill-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.skill-level {
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.skill-bar {
    width: 100%;
    height: 5px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #00d4ff);
    border-radius: 2px;
    transition: width 1.5s ease-in-out;
    position: relative;
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Anciens styles pour les certifications (à conserver) */
.skill-item img, .cert-item img {
    width: 150px;
    height: 150px;
    margin-bottom: 0.5rem;
    transition: transform 0.3s;
}
.skill-item:hover img, .cert-item:hover img {
    transform: scale(0.8) rotate(10deg);
}
.skill-item:hover, .cert-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background: var(--accent-color);
    color: #fff;
}

/* Horizontal scroller for certifications */
#certifications .h-scroller {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
#certifications .h-scroll-list {
    display: flex;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
#certifications .cert-item {
    min-width: 160px;
}
#certifications .cert-link {
    display: inline-block;
    border-radius: 6px;
}
#certifications figure {
    margin: 0;
}
#certifications figcaption {
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-content {
    background: var(--bg-color);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.lightbox-content img {
    max-width: 80vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}
/* Agrandissement progressif sur écrans plus larges */


.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
}

#skills li, #certifications li {
    padding: 0.5rem;
    border-radius: 6px;
    transition: transform 0.3s, background 0.3s;
}
#skills li:hover, #certifications li:hover {
    transform: translateY(-5px);
    background: var(--accent-color);
    color: #fff;
}

/* Articles */
#articles ul {
    padding-left: 0;
    list-style: none;
}
#articles li {
    margin-bottom: 0.5rem;
    transition: transform 0.3s;
}
#articles a {
    color: var(--accent-color);
    text-decoration: none;
    transition: text-decoration 0.3s, color 0.3s;
}
#articles li:hover {
    transform: translateX(5px);
}
#articles a:hover {
    text-decoration: underline;
    /* Remplacement de darken() non supporté en CSS pur */
    color: #0088cc;
}

/* Lien LinkedIn */
.linkedin-link {
    color: #0077b5;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.linkedin-link:hover {
    color: #005885;
    text-decoration: underline;
}

.linkedin-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

.linkedin-link:hover .linkedin-icon {
    transform: scale(1.2);
}

/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
input, textarea, button {
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}
button {
    background: var(--accent-color);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}
button:hover {
    background: #0088cc;
    transform: translateY(-2px);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: #f1f1f1;
}

/* Accessibilité */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: #fff;
}

/* Animations au scroll */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row;
        align-items: center;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    header h1 {
        font-size: 1.3rem;
        flex: 1;
        text-align: center;
        order: 2;
    }
    
    #themeToggle {
        order: 1;
        font-size: 1.1rem;
        padding: 0.4rem;
        min-width: 40px;
    }
    
    .menu-toggle {
        display: block;
        order: 3;
        font-size: 1.3rem;
        padding: 0.4rem;
        min-width: 40px;
    }
    
    /* Hero responsive */
    #hero {
        margin: 0;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    
    #hero .hero-content {
        padding: 2rem 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    #hero h2 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    #hero p {
        font-size: 1.1rem;
        max-width: 100%;
        padding: 0 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .hero-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        margin-top: 1.5rem;
    }
    
    /* Skills responsive */
    .skills-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-top: 0.75rem;
    }
    
    .skills-category h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .skill-item {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .skill-info {
        justify-content: flex-start;
        margin-bottom: 0.3rem;
    }
    
    .skill-name {
        font-size: 0.85rem;
    }
    
    .skill-bar {
        height: 4px;
    }
    
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }
    
    nav li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    nav a {
        display: block;
        padding: 1rem 2rem;
        transition: background 0.3s;
    }
    
    nav a:hover {
        background: rgba(255,255,255,0.1);
    }
}

/* Responsive pour très petits écrans */
@media (max-width: 480px) {
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    #hero {
        width: 100vw;
        max-width: 100vw;
        margin-left: 0;
        margin-right: 0;
        left: 0;
        right: 0;
    }
    
    #hero .hero-content {
        padding: 1.5rem 0.75rem;
        width: 100%;
        max-width: 100%;
    }
    
    #hero h2 {
        font-size: 1.8rem;
        padding: 0 0.5rem;
    }
    
    #hero p {
        font-size: 1rem;
        padding: 0 0.5rem;
    }
    
    .hero-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    section {
        padding: 2rem 1rem;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .header-container {
        padding: 0.5rem 0.75rem;
    }
    
    header h1 {
        font-size: 1.1rem;
    }
}

/* Dark mode pour les skills */
body.dark .skill-item {
    background: rgba(0, 212, 255, 0.1);
    border-left-color: var(--accent-color);
}

body.dark .skill-item:hover {
    box-shadow: 0 3px 12px rgba(0, 212, 255, 0.3);
}

body.dark .skill-bar {
    background: rgba(255, 255, 255, 0.1);
}

/* Dark mode pour la section hero */
body.dark #hero {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08) 0%, rgba(0, 170, 255, 0.05) 100%);
}

body.dark #hero::before {
    background: linear-gradient(45deg, transparent 30%, rgba(0, 212, 255, 0.03) 50%, transparent 70%);
}
