/* ===== CSS VARIABLES & RESET ===== */
:root {
    --primary-color: #1a365d;
    --secondary-color: #2d5a8c;
    --accent-color: #0ea5e9;
    --accent-light: #38bdf8;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ===== DARK MODE VARIABLES ===== */
body.dark {
    --primary-color: #1a365d;
    --secondary-color: #2d5a8c;
    --text-dark: #f1f5f9;
    --text-light: #cbd5e1;
    --bg-light: #1a1f2e;
    --bg-white: #0f1419;
    --border-color: #334155;
}

/* Textes des headings en dark mode */
body.dark .section h2,
body.dark .timeline-header h3,
body.dark .skill-category h3 {
    color: #e2e8f0 !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-light);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

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

.nav-links a {
    color: var(--bg-white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding-bottom: 0.25rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-light);
    transition: var(--transition);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 2.5px;
    background-color: var(--bg-white);
    margin: 5px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* ===== DARK MODE BUTTON ===== */
.dark-mode-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    transition: var(--transition);
    position: relative;
}

.dark-mode-btn:hover {
    transform: scale(1.1);
}

.dark-mode-btn svg {
    width: 24px;
    height: 24px;
    position: absolute;
    transition: var(--transition);
}

.dark-mode-btn .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.dark-mode-btn .icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

body.dark .dark-mode-btn .icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

body.dark .dark-mode-btn .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--bg-white);
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(30px);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    animation: slideInUp 0.8s ease-out;
}

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

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--accent-light);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero .description {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

/* ===== SECTIONS ===== */
.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: var(--bg-light);
}

.section h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 3rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
    font-weight: 700;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-light));
    border-radius: 2px;
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-color), var(--accent-light));
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

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

.timeline-item:nth-child(2) {
    animation-delay: 0.1s;
}

.timeline-marker {
    position: absolute;
    left: -11px;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    border: 4px solid var(--bg-white);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg-light);
    transition: var(--transition);
}

.timeline-item:hover .timeline-marker {
    background: var(--accent-light);
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.5), 0 0 0 4px var(--bg-light);
    transform: scale(1.3);
}

.timeline-content {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.section-alt .timeline-content {
    background: var(--bg-white);
}

.timeline-item:hover .timeline-content {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-lg);
    transform: translateX(5px);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.timeline-header h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.year {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-light));
    color: var(--bg-white);
    border-radius: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.institution {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.institution-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
    opacity: 0.8;
    transition: var(--transition);
}

.timeline-item:hover .institution-logo {
    opacity: 1;
}

.description-text {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 0.95rem;
}

.exp-list {
    list-style: none;
    margin-top: 1rem;
}

.exp-list li {
    padding: 0.6rem 0;
    padding-left: 1.5rem;
    color: var(--text-light);
    line-height: 1.7;
    position: relative;
}

.exp-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* ===== SKILLS GRID ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
}

.skill-category:nth-child(2) {
    animation-delay: 0.1s;
}

.skill-category:nth-child(3) {
    animation-delay: 0.2s;
}

.skill-category:nth-child(4) {
    animation-delay: 0.3s;
}

.skill-category:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
}

.skill-category h3 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-icon {
    font-size: 1.4rem;
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 0.6rem 0;
    color: var(--text-light);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.skill-list img {
    width: 28px;
    height: auto;
}

/* ===== CONTACT SECTION ===== */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content > p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.contact-item {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.contact-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.contact-item .label {
    display: block;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.contact-item p {
    color: var(--text-dark);
    font-size: 1rem;
}

.contact-item a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.contact-item a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.contact-item em {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: normal;
    margin-top: 0.5rem;
}

/* ===== CONTACT FORM ===== */
.contact-form {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.6s ease-out;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    transition: var(--transition);
    background-color: var(--bg-white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
}

.contact-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.form-message.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.form-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    color: #ef4444;
}

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

/* ===== FOOTER ===== */
.footer {
    background: var(--primary-color);
    color: var(--bg-white);
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
}

body.dark .footer {
    background: #1a1f2e;
    color: #e2e8f0;
}

/* Inputs en dark mode */
body.dark .form-group input,
body.dark .form-group textarea {
    background-color: #1a1f2e;
    color: #e2e8f0;
    border-color: #334155;
}

body.dark .form-group input::placeholder,
body.dark .form-group textarea::placeholder {
    color: #94a3b8;
}

body.dark .form-group label {
    color: #e2e8f0;
}

/* Links en dark mode */
body.dark .contact-item p {
    color: #cbd5e1;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.95rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        padding: 1rem;
        gap: 0.5rem;
    }

    .section {
        padding: 3rem 0;
    }

    .timeline::before {
        left: 0;
    }

    .timeline-item {
        padding-left: 2.5rem;
    }

    .timeline-header {
        flex-direction: column;
    }

    .year {
        align-self: flex-start;
    }

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

    .hero {
        padding: 3.5rem 0;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .section h2 {
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .hero .description {
        font-size: 0.95rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .timeline-item {
        padding-left: 2rem;
    }

    .timeline-marker {
        left: -8px;
        width: 20px;
        height: 20px;
        border-width: 3px;
    }

    .timeline-header h3 {
        font-size: 1.1rem;
    }

    .year {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }
}
