/* === Variables & Reset === */
:root {
    --dark-nav: #030712;
    --cyber-blue: #3b82f6;
    --btn-blue: #3498db;
    --bg-light: #f1f5f9;
    --text-dark: #1e293b;
    --text-light: #64748b;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}
html { scroll-behavior: smooth; }
body { 
    font-family: 'Inter', sans-serif; 
    display: flex; 
    background: white; 
    color: var(--text-dark); 
    overflow-x: hidden; 
}

/* === Sidebar & Menu === */
.sidebar {
    width: 280px; height: 100vh; background: var(--dark-nav); color: white;
    position: fixed; top: 0; left: 0; padding: 40px 30px;
    display: flex; flex-direction: column; z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar .profile h3 { font-size: 1.2rem; margin-bottom: 5px; }
.sidebar ul { list-style: none; margin-top: 50px; flex-grow: 1; }
.sidebar ul li { margin-bottom: 20px; }
.sidebar a { color: #9ca3af; text-decoration: none; transition: 0.3s; font-size: 0.95rem; display: flex; align-items: center; }
.sidebar a i { width: 25px; margin-right: 15px; font-size: 1.1rem; }
.sidebar a:hover, .sidebar a.active { color: white; padding-left: 5px; }
.sidebar a:hover i, .sidebar a.active i { color: var(--cyber-blue); }
.sidebar .copyright { font-size: 0.85rem; color: #9ca3af; }

.content { margin-left: 280px; width: calc(100% - 280px); min-width: 0; }

.mobile-nav-toggle {
    display: none; position: fixed; top: 20px; right: 20px; z-index: 1000;
    background: var(--cyber-blue); color: white; border: none;
    width: 45px; height: 45px; border-radius: 8px; font-size: 1.3rem;
    cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 99; opacity: 0; transition: opacity 0.3s ease;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* === Layout Sections === */
.white-section { padding: 90px 0; display: flex; align-items: center; }
.alternate { background-color: var(--bg-light); }
.container { width: 100%; max-width: 1300px; margin: 0 auto; padding: 0 50px; }

.section-title { color: #1e3a8a; font-size: 2.2rem; margin-bottom: 40px; position: relative; padding-bottom: 10px; }
.section-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 60px; height: 4px; background: var(--cyber-blue); }

/* === Hero Accueil === */
.hero-cyber {
    height: 100vh;
    background: linear-gradient(rgba(3, 7, 18, 0.65), rgba(3, 7, 18, 0.85)), url('img/fond_porte.jpg') center/cover no-repeat;
    display: flex; justify-content: center; align-items: center; text-align: center; padding: 0 20px;
}
.hero-text h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); color: white; margin-bottom: 10px; }
.hero-text h2 { font-size: clamp(1.2rem, 3vw, 2rem); min-height: 2.5rem; }
.blue-glow { color: var(--cyber-blue); font-weight: 800; }
#typewriter { border-right: 3px solid var(--cyber-blue); padding-right: 5px; animation: blink 0.7s infinite; }
@keyframes blink { 0%, 100% { border-color: transparent; } 50% { border-color: var(--cyber-blue); } }

/* === A propos === */
.intro-p { font-size: 1.05rem; color: #4b5563; line-height: 1.6; margin-bottom: 45px; max-width: 850px; }
.about-flex { display: flex; gap: 50px; align-items: center; margin-bottom: 50px; }
.about-left { flex: 1; display: flex; justify-content: center; }

.photo-frame {
    width: 100%; max-width: 320px; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08); border: 1px solid #e2e8f0; transition: transform 0.3s ease;
}
.photo-frame:hover { transform: translateY(-5px); }
.main-photo { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

.about-right { flex: 1.8; }
.about-right h3 { font-size: 1.8rem; color: #1e3a8a; margin-bottom: 15px; font-weight: 700; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 30px 0; padding: 20px 0; border-top: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9; }
.info-item { display: flex; align-items: center; font-size: 0.95rem; color: var(--text-dark); }
.info-item strong { color: #1e3a8a; }
.blue-icon { color: var(--cyber-blue); margin-right: 12px; font-size: 0.75rem; }
.bio { line-height: 1.7; color: #4b5563; font-size: 0.98rem; }

.about-buttons-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 40px; padding-top: 20px; }
.about-buttons-container .btn-action {
    background-color: var(--btn-blue); color: white; padding: 14px 28px; text-decoration: none; border-radius: 30px;
    font-size: 0.9rem; font-weight: 600; text-align: center; transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.15); display: inline-flex; align-items: center; justify-content: center;
    gap: 10px; flex: 1; min-width: 210px; max-width: 280px;
}
.about-buttons-container .btn-action:hover { background-color: #2980b9; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3); }

/* === Compétences === */
.skills-wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; }
.skill-card { background: white; padding: 30px; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02); transition: 0.3s; }
.skill-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05); }

.skill-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.icon-circle { background: var(--cyber-blue); color: white; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.skill-header h3 { color: #1e3a8a; font-size: 1.2rem; font-weight: 700; }

.tags-container { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-tag { background-color: #f1f5f9; color: #334155; padding: 8px 14px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; transition: 0.2s; border: 1px solid #e2e8f0; }
.tech-tag:hover { background-color: var(--cyber-blue); color: white; border-color: var(--cyber-blue); transform: scale(1.05); }

/* === Timeline (Parcours) === */
.two-columns-timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 25px; }
.timeline-side-col { display: block; }
.timeline-side-col h3 { color: #1e3a8a; font-size: 1.4rem; font-weight: 700; margin-bottom: 30px; }

.timeline-side-row {
    position: relative;
    padding-left: 45px;
    padding-bottom: 30px; 
}
.timeline-side-row:last-child {
    padding-bottom: 0; 
}
.timeline-side-row:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 6px; 
    top: 50px; 
    bottom: -34px; 
    width: 2px;
    background-color: #cbd5e1; 
    z-index: 1;
}

.timeline-side-bullet {
    position: absolute;
    left: 0;
    top: 34px; 
    width: 14px;
    height: 14px;
    background-color: white;
    border: 3px solid var(--cyber-blue); 
    border-radius: 50%;
    z-index: 2;
}

.timeline-side-card { background: white; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; width: 100%; box-shadow: 0 2px 4px rgba(0,0,0,0.01); }
.card-side-header { display: flex; align-items: center; gap: 15px; margin-bottom: 10px; }
.comp-logo-fixed { width: 45px; height: 45px; object-fit: contain; border-radius: 6px; border: 1px solid #f1f5f9; padding: 4px; background: white; flex-shrink: 0; }
.header-text-fixed h4 { color: var(--cyber-blue); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px; }
.header-text-fixed h5 { color: #1e3a8a; font-size: 1rem; font-weight: 700; }
.timeline-date-fixed { font-size: 0.8rem; color: #64748b; font-weight: 600; }
.institution-fixed { font-size: 0.88rem; font-weight: 600; color: #475569; }

.task-list-fixed { list-style: none; margin-top: 8px;}
.task-list-fixed li { font-size: 0.85rem; line-height: 1.4; color: #475569; position: relative; padding-left: 12px; margin-bottom: 5px; }
.task-list-fixed li::before { content: '>'; position: absolute; left: 0; color: var(--cyber-blue); font-weight: bold; }

/* === Certifications === */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px; justify-content: start; }
.cert-card { position: relative; overflow: hidden; border-radius: 12px; border: 1px solid #e2e8f0; background: white; transition: 0.3s; }
.cert-card img { width: 100%; height: 220px; object-fit: contain; padding: 10px; transition: 0.3s; }
.cert-card a { text-decoration: none; }

.info-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(59, 130, 246, 0.9);
    color: white; padding: 12px; text-align: center; transform: translateY(100%); transition: 0.3s;
}
.cert-card:hover .info-overlay { transform: translateY(0); }
.cert-card:hover img { transform: scale(1.05); }

/* =========================================
   PORTFOLIO (TOTALEMENT REFAIT)
========================================= */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: stretch; /* Force toutes les cartes à avoir la même hauteur */
}

.project-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex; /* Structure flexible */
    flex-direction: column;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* Le lien englobe tout et se comporte comme un conteneur propre */
.project-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none !important; /* Retire le souligné par défaut */
    color: inherit; /* Empêche le texte de devenir bleu/violet */
}

.project-img-wrapper {
    width: 100%;
    height: 200px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0; /* Empêche l'image de s'écraser */
}

/* Classe pour les photos (remplit tout l'espace) */
.project-img-wrapper img.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Classe pour les logos (garde les proportions, ne coupe pas) */
.project-img-wrapper img.contain-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 25px; /* Un peu d'espace autour du logo */
    transition: transform 0.4s ease;
}

.project-card:hover .project-img-wrapper img {
    transform: scale(1.05); /* Effet zoom au survol */
}

.project-content {
    padding: 25px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Force le contenu à prendre la place restante vers le bas */
}

.project-content h3 {
    color: #1e3a8a;
    font-size: 1.25rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.project-content p {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* === Contact === */
.contact-grid-layout { display: grid; grid-template-columns: 1fr 1.8fr; gap: 30px; align-items: stretch; }
.contact-links-column { display: flex; flex-direction: column; gap: 15px; }

.info-card {
    background: white; padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0; transition: 0.3s;
    text-decoration: none; color: inherit; display: flex; align-items: center; word-break: break-all;
}
.info-card i { color: var(--cyber-blue); margin-right: 15px; font-size: 1.2rem; width: 20px; text-align: center; flex-shrink: 0; }
.info-card:hover { border-color: var(--cyber-blue); transform: translateX(3px); }

.contact-map-card { background: white; padding: 10px; border-radius: 12px; border: 1px solid #e2e8f0; min-height: 320px; }
.contact-map-card iframe { width: 100%; height: 100%; min-height: 300px; border: 0; border-radius: 8px; display: block; }

/* === Veille (Cartes) === */
.veille-card { padding: 30px 30px 0 30px !important; display: flex; flex-direction: column; overflow: hidden; }
.veille-img-wrapper { width: calc(100% + 60px); margin-left: -30px; margin-right: -30px; margin-top: 20px; background: #f8fafc; border-top: 1px solid #e2e8f0; overflow: hidden; }
.veille-screenshot { width: 100%; height: 180px; object-fit: cover; display: block; transition: transform 0.3s ease; }
.veille-card:hover .veille-screenshot { transform: scale(1.03); }

.articles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; margin-top: 20px; }
.article-card { background: #ffffff; border-radius: 12px; overflow: hidden; border: 1px solid #f1f5f9; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); transition: transform 0.3s ease, box-shadow 0.3s ease; }
.article-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.card-image { width: 100%; height: 180px; overflow: hidden; background: #e2e8f0; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.article-card:hover .card-image img { transform: scale(1.05); }

.card-content { padding: 20px; }
.card-tag { display: inline-block; padding: 4px 8px; background: #fee2e2; color: #ef4444; font-size: 0.75rem; font-weight: 600; border-radius: 4px; margin-bottom: 10px; }
.card-tag.info { background: #dbeafe; color: #3b82f6; }
.card-content h3 { font-size: 1.2rem; color: #1e293b; margin: 0 0 8px 0; line-height: 1.4; }
.card-date { font-size: 0.8rem; color: #94a3b8; margin-bottom: 12px; }
.card-text { font-size: 0.9rem; color: #475569; line-height: 1.5; margin-bottom: 15px; }
.card-link { display: inline-block; color: #3b82f6; text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: color 0.2s; }
.card-link i { margin-left: 5px; transition: transform 0.2s; }
.card-link:hover { color: #1d4ed8; }
.card-link:hover i { transform: translateX(3px); }

/* === Responsive === */
@media (max-width: 992px) {
    body { flex-direction: column; }
    .mobile-nav-toggle { display: block; }
    .sidebar { transform: translateX(-100%); box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    .sidebar.active { transform: translateX(0); }
    .content { margin-left: 0; width: 100%; }
    .about-flex { flex-direction: column; text-align: center; gap: 30px; }
    .photo-frame { aspect-ratio: 1 / 1; margin: 0 auto; }
    .two-columns-timeline { grid-template-columns: 1fr; gap: 40px; }
    .contact-grid-layout { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .container { padding: 0 20px; }
    .white-section { padding: 60px 0; }
    .section-title { font-size: 1.8rem; }
    .about-buttons-container .btn-action { max-width: 100%; }
    .contact-map-card { min-height: 280px; }
    .timeline-side-row { padding-left: 35px; }
    .timeline-side-row:not(:last-child)::before { left: 6px; }
    .timeline-side-bullet { left: -1px; }
}