/* ==================== VARIABLES ==================== */
:root {
    --primary: #0a0a1a;
    --secondary: #0c0c1a;
    --accent: #00b4d8;
    --accent-dark: #0077b6;
    --accent-light: #48cae4;
    --text-light: #ffffff;
    --text-gray: rgba(255, 255, 255, 0.7);
    --text-dark: #0a0a1a;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s ease-in-out;
    --border-radius: 20px;
    /* Couleurs navbar - vos choix */
    --navbar-default: rgba(15, 15, 216, 0.95);
    --navbar-scrolled: rgba(8, 8, 90, 0.98);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary);
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* ==================== PRELOADER ==================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

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

.loader-text {
    margin-top: 20px;
    color: var(--text-gray);
    font-size: 14px;
    letter-spacing: 2px;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--navbar-default);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: var(--navbar-scrolled);
    padding: 10px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
    color: #fff !important;
}

.brand-icon {
    margin-right: 8px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    margin: 0 5px;
    transition: all 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

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

.nav-link:hover {
    color: var(--accent) !important;
}

.nav-link.active {
    color: var(--accent) !important;
}

.social-icons a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    margin-left: 15px;
    transition: all 0.3s;
}

.social-icons a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

/* ==================== HERO SECTION ==================== */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(10, 10, 26, 0.92), rgba(0, 0, 0, 0.85)),
        url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=1600');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    position: relative;
}


.hero h1 {
    font-size: clamp(36px, 8vw, 70px);
    font-weight: 800;
    margin-bottom: 20px;
}

.hero .highlight {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 30px;
    min-height: 30px;
}

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

.hero-stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number-hero {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}

.stat-label-hero {
    font-size: 14px;
    color: var(--text-gray);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator a {
    color: white;
    font-size: 24px;
    opacity: 0.7;
    transition: all 0.3s;
}

.scroll-indicator a:hover {
    opacity: 1;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ==================== BUTTONS ==================== */
.btn-custom {
    padding: 12px 35px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    border: none;
}

.btn-primary-custom:hover {
    background: var(--accent-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 180, 216, 0.3);
    color: white;
}

.btn-outline-custom {
    background: transparent;
    border: 2px solid white;
    color: white;
}

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

.btn-sm {
    padding: 8px 20px;
    font-size: 14px;
}

/* ==================== SECTION COMMUNS ==================== */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-tag {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent);
    font-weight: 600;
}

.section-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    margin-top: 15px;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-divider {
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 20px auto;
    border-radius: 2px;
}

.section-description {
    max-width: 700px;
    margin: 20px auto 0;
    color: var(--text-gray);
    font-size: 15px;
}

/* ==================== ABOUT ==================== */
.about-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.about-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.about-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    /* Bordure avec effet de lumière */
    border: 3px solid var(--accent);
    box-shadow: 
        0 0 20px rgba(0, 180, 216, 0.3),
        inset 0 0 20px rgba(0, 180, 216, 0.1);
    transition: all 0.4s ease;
    /* Fond de secours si l'image ne charge pas */
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Conteneur de l'image */
.about-avatar .profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

/* Effet au survol - zoom léger + effet de lueur */
.about-avatar:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 30px rgba(0, 180, 216, 0.5),
        0 0 60px rgba(0, 180, 216, 0.2),
        inset 0 0 30px rgba(0, 180, 216, 0.2);
    border-color: var(--accent-light);
}

.about-avatar:hover .profile-photo {
    transform: scale(1.1);
}

/* Anneau lumineux autour de l'avatar (effet de glow) */
.about-avatar::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--accent),
        var(--accent-light),
        var(--accent),
        var(--accent-dark),
        var(--accent)
    );
    opacity: 0;
    z-index: -1;
    animation: rotateGlow 4s linear infinite;
    transition: opacity 0.4s ease;
}

.about-avatar:hover::before {
    opacity: 1;
}

/* Animation de rotation du glow */
@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Position relative pour le pseudo-élément */
.about-avatar {
    position: relative;
}

/* Fallback si l'image ne charge pas - afficher les initiales */
.about-avatar .fallback-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
    display: none;
}

.about-avatar img:not([src]) + .fallback-text,
.about-avatar img[src=""] + .fallback-text {
    display: block;
}

/* Version simplifiée et élégante (alternative) */
.about-avatar.elegant {
    border: 3px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.about-avatar.elegant:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 40px rgba(0, 180, 216, 0.3);
}
/* Pour les liens CV et Discuter */

.about-link {
    display: inline-block;
    margin-right: 12px;
    font-size: 14px;
    color: #ffffff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.about-link:hover {
    color: #3003f7;
    border-bottom: 1px solid #000;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .about-avatar {
        width: 60px;
        height: 60px;
        border-width: 2px;
    }
}

@media (max-width: 576px) {
    .about-avatar {
        width: 50px;
        height: 50px;
    }
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4caf50;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ===== CORRECTION : ALIGNEMENT VERTICAL ===== */
.info-row {
    display: flex;
    align-items: center;          /* ← Alignement vertical au centre */
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 50px;             /* ← Hauteur minimale pour éviter les décalages */
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    flex: 0 0 130px;              /* ← Largeur fixe pour uniformité */
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;          /* ← Centrage vertical des icônes + texte */
    gap: 10px;                    /* ← Espace entre l'icône et le texte */
    white-space: nowrap;          /* ← Empêche le texte de passer à la ligne */
}

.info-label i {
    width: 20px;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;               /* ← Empêche l'icône de rétrécir */
}

.info-value {
    flex: 1;
    color: var(--text-gray);
    padding-left: 5px;
}

.about-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.about-image {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.image-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 2; /* NOUVEAU: Force le badge à passer au premier plan */
}

/* --- NOUVELLE CLASSE À AJOUTER --- */
.main-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit l'espace sans déformer l'image */
    z-index: 1; /* Place l'image juste sous le badge */
}

.experience-badge {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.exp-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    display: block;
}

.exp-label {
    font-size: 12px;
    color: var(--text-gray);
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-box:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.stat-number {
    font-size: 48px;
    font-weight: 800;
    color: var(--accent);
}

.stat-number span {
    font-size: 24px;
}

.stat-label {
    color: var(--text-gray);
    margin-top: 10px;
}

/* ==================== SKILLS ==================== */
.skills-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    padding: 40px;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.skill-category {
    font-size: 24px;
    margin-bottom: 5px;
}

.skill-category i {
    color: var(--accent);
    margin-right: 10px;
}

.skill-subtitle {
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 30px;
}

.skill-item {
    margin-bottom: 20px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-gray);
}

.progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--accent-dark));
    border-radius: 10px;
    width: 0;
    transition: width 1.5s ease-in-out;
}

/* ==================== SERVICES ==================== */
.service-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    transition: all 0.3s;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

.service-icon i {
    font-size: 30px;
    color: white;
}

.service-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.service-card p {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 15px;
}

.service-tag {
    display: inline-block;
    background: rgba(0, 180, 216, 0.15);
    color: var(--accent);
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 12px;
    border: 1px solid rgba(0, 180, 216, 0.2);
}

/* ==================== PROJECTS ==================== */
.project-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

/* Nouvelle classe pour les images de vos projets */
.project-img-custom {
  width: 100%;
  height: 200px; /* Ajustez cette hauteur selon la taille désirée pour vos cartes */
  object-fit: cover; /* Remplit l'espace sans écraser l'image */
  display: block;
  transition: transform 0.3s ease; /* Optionnel : pour un petit effet de zoom au survol */
}

/* Optionnel : un petit effet de zoom quand on passe la souris sur la carte */
.project-card:hover .project-img-custom {
  transform: scale(1.05);
}

.project-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-dark), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: rgba(255, 255, 255, 0.3);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-info {
    padding: 20px;
}

.project-info h4 {
    margin-bottom: 10px;
}

.project-info p {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.project-tech {
    font-size: 12px;
    color: var(--accent);
}

/* ==================== TESTIMONIALS ==================== */
.testimonial-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    padding: 30px;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.testimonial-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.testimonial-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden; /* NOUVEAU : Coupe les coins de l'image qui dépassent du cercle */
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* La nouvelle classe pour l'image de l'avatar */
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Recadre l'image proprement sans la déformer */
  object-position: center; /* Centre le visage si l'image est recadrée */
  display: block;
}

.testimonial-role {
    font-size: 12px;
    color: var(--text-gray);
}

.stars {
    color: #ffc107;
    font-size: 14px;
    margin-bottom: 5px;
}

.testimonial-text {
    color: var(--text-gray);
    font-style: italic;
    line-height: 1.8;
}

/* ==================== CTA ==================== */
.cta-section {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.cta-section h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.cta-section p {
    font-size: 18px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.9);
}

.cta-section .btn-primary-custom {
    background: white;
    color: var(--accent-dark);
}

.cta-section .btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: var(--accent-dark);
}

/* ==================== BACK TO TOP ==================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-dark);
    transform: translateY(-3px);
}

/* ==================== FOOTER ==================== */
footer {
    background: #050510;
    padding: 60px 0 0;
}

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.footer-desc {
    color: var(--text-gray);
}

.footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 0;
}

.footer-links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-social {
    text-align: right;
}

.footer-social a {
    color: var(--text-gray);
    font-size: 22px;
    margin-left: 20px;
    transition: all 0.3s;
    display: inline-block;
}

.footer-social a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.footer-contact {
    color: var(--text-gray);
    font-size: 14px;
}

.footer-hours {
    color: var(--text-gray);
    font-size: 13px;
}

.footer-bottom {
    background: #02020a;
    padding: 20px 0;
    margin-top: 50px;
}

.footer-bottom p {
    margin: 0;
    font-size: 13px;
    color: var(--text-gray);
}

.footer-version {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 5px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {
    .section-title {
        font-size: 32px;
    }
    
    .navbar-collapse {
        background: var(--navbar-default);
        backdrop-filter: blur(10px);
        padding: 20px;
        border-radius: 10px;
        margin-top: 15px;
    }
    
    .social-icons {
        margin-top: 15px;
        text-align: center;
    }
    
    .hero-stats {
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .footer-social {
        text-align: center;
        margin-top: 20px;
    }
    
    .footer-links {
        margin: 20px 0;
    }
}

@media (max-width: 768px) {
    section {
        padding: 50px 0;
    }
    
    .hero h1 {
        font-size: 36px;
    }
    
    .hero-buttons .btn-custom {
        display: block;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    /* ===== CORRECTION RESPONSIVE ===== */
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        min-height: auto;
        padding: 12px 0;
    }
    
    .info-label {
        flex: 0 0 auto;
        white-space: normal;
        margin-bottom: 4px;
        width: 100%;
    }
    
    .info-value {
        padding-left: 30px;
    }
    
    .stat-box {
        margin-bottom: 20px;
    }
    
    .service-card {
        margin-bottom: 20px;
    }
    
    .about-image {
        height: 250px;
        margin-top: 20px;
    }
    
    .cta-section .btn-custom {
        margin-top: 20px;
    }
    
    .footer-social a {
        margin: 0 10px;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 28px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .skills-card {
        padding: 25px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}