    /* --- 1. COLOR PALETTE --- */
    :root {
        --primary: #4f46e5;       
        --primary-light: #818cf8;
        --accent: #f43f5e;        
        --bg-light: #f8fafc;      
        --text-main: #1e293b;     
        --text-sub: #475569;      
        --card-bg: #ffffff;
        --glass-border: 1px solid rgba(0, 0, 0, 0.05);
        --shadow: 0 10px 40px -10px rgba(79, 70, 229, 0.15);
        
        --bg-color: var(--bg-light);
        --text-color: var(--text-main);
        --p-color: var(--text-sub);
        --surface-color: var(--card-bg);
    }

    [data-theme="dark"] {
        --bg-color: #0f172a;      
        --text-color: #f1f5f9;
        --p-color: #94a3b8;
        --surface-color: #1e293b;
        --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
        --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    }

    * { margin: 0; padding: 0; box-sizing: border-box; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); }
    html { scroll-behavior: smooth; }

    body {
        font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
        background-color: var(--bg-color);
        color: var(--text-color);
        line-height: 1.7;
        overflow-x: hidden;
    }

    /* --- BACKGROUND ORBS --- */
    .bg-decoration {
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh; z-index: -1;
        overflow: hidden; pointer-events: none;
    }
    .blob {
        position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.4;
        animation: float 10s infinite ease-in-out;
    }
    .blob-1 { top: -10%; left: -10%; width: 500px; height: 500px; background: var(--primary-light); }
    .blob-2 { bottom: -10%; right: -10%; width: 400px; height: 400px; background: var(--accent); animation-delay: 2s; }
    
    @keyframes float {
        0%, 100% { transform: translate(0, 0); }
        50% { transform: translate(30px, 50px); }
    }

    /* --- NAVIGATION --- */
    nav {
        position: fixed; top: 0; width: 100%; padding: 1rem 5%;
        display: flex; justify-content: space-between; align-items: center;
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        z-index: 1000; border-bottom: var(--glass-border);
    }
    [data-theme="dark"] nav { background: rgba(15, 23, 42, 0.7); }
    
    .logo { font-weight: 800; font-size: 1.5rem; color: var(--primary); letter-spacing: -0.5px; }
    .controls { display: flex; gap: 15px; align-items: center; }
    .lang-group { display: flex; background: var(--surface-color); border-radius: 50px; padding: 4px; box-shadow: var(--shadow); }
    .lang-btn {
        background: none; border: none; padding: 5px 12px; font-size: 0.8rem;
        font-weight: 700; cursor: pointer; color: var(--text-color); border-radius: 50px; opacity: 0.6;
    }
    .lang-btn.active { background: var(--primary); color: white; opacity: 1; transform: scale(1.05); }
    .theme-btn {
        background: var(--surface-color); border: none; width: 40px; height: 40px; border-radius: 50%;
        cursor: pointer; color: var(--text-color); box-shadow: var(--shadow);
        display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    }
    .theme-btn:hover { color: var(--accent); transform: rotate(15deg); }

    /* --- HERO SECTION --- */
    .hero {
        min-height: 100vh; display: flex; flex-direction: column;
        justify-content: center; align-items: center; text-align: center;
        padding: 120px 20px 50px;
    }
    .hero-avatar {
        width: 160px; height: 160px; border-radius: 50%;
        object-fit: cover; border: 4px solid var(--surface-color);
        box-shadow: 0 20px 50px rgba(79, 70, 229, 0.3);
        margin-bottom: 2rem;
    }
    h1 { font-size: 4rem; margin-bottom: 0.5rem; line-height: 1.1; background: linear-gradient(135deg, var(--text-color) 0%, var(--primary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
    .hero-subtitle { font-size: 1.5rem; color: var(--p-color); margin-bottom: 1.5rem; font-weight: 500; height: 3rem; }
    .hero-subtitle .typing-text { color: var(--primary); font-weight: 700; }
    .hero-subtitle .cursor { background: var(--accent); display: inline-block; width: 3px; height: 1.5rem; animation: blink 0.7s infinite; vertical-align: middle; }
    @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

    .bio-stats {
        display: flex; flex-wrap: wrap; gap: 15px; justify-content: center;
        margin-bottom: 2.5rem;
    }
    .stat-badge {
        background: var(--surface-color); padding: 8px 16px; border-radius: 30px;
        font-size: 0.9rem; font-weight: 600; color: var(--text-color);
        box-shadow: 0 4px 20px rgba(0,0,0,0.05); border: 1px solid var(--glass-border);
        display: flex; align-items: center; gap: 8px;
    }
    .stat-badge i { color: var(--accent); }
    
    .cta-group { display: flex; flex-wrap:wrap; justify-content: center; gap: 15px; }
    .btn {
        padding: 14px 35px; border-radius: 50px; text-decoration: none; font-weight: 700;
        border: none; cursor: pointer; box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.3);
        display: inline-flex; align-items: center; gap: 10px;
    }
    .btn-fill { background: var(--primary); color: white; }
    .btn-fill:hover { background: var(--accent); transform: translateY(-3px); }
    .btn-outline { border: 2px solid var(--text-color); color: var(--text-color); background: transparent; box-shadow: none; }
    .btn-outline:hover { border-color: var(--primary); color: var(--primary); }

        /* Make the dropdown work on hover */
    .resume-dropdown {
        position: relative;
        cursor: pointer;
    }

    .resume-dropdown .dropdown-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        border: 1px solid #ccc;
        list-style: none;
        padding: 0;
        margin: 0;
        width: 160px; /* adjust as needed */
        z-index: 10;
    }

    .resume-dropdown .dropdown-list li a {
        display: block;
        padding: 10px;
        color: #333;
        text-decoration: none;
    }

    .resume-dropdown .dropdown-list li a:hover {
        background: #f0f0f0;
    }

    .resume-dropdown:hover .dropdown-list {
        display: block;
    }


/* --- LOGO SLIDER --- */
.logo-slider {
    overflow: hidden;
    padding: 30px 0;
    /* Forces the background to always be white */
    background: #ffffff; 
    white-space: nowrap;
    position: relative;
    border-top: var(--glass-border);
    border-bottom: var(--glass-border);
    margin: 2rem 0;
}

/* Gradient Fades for the edges (Forced to white to match the background) */
.logo-slider::before,
.logo-slider::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
}

.logo-slider::before {
    left: 0;
    background: linear-gradient(to right, #ffffff, transparent);
}

.logo-slider::after {
    right: 0;
    background: linear-gradient(to left, #ffffff, transparent);
}

.logo-track {
    display: inline-flex;
    align-items: center;
    /* 30s is the speed - change to 15s to go faster */
    animation: scrollLogos 30s linear infinite; 
}

.logo-track img {
    /* Set a fixed height and a max-width to keep them uniform */
    height: 35px; 
    width: 100px; /* Forces a standard width */
    object-fit: contain; 
    margin: 0 30px; 
    opacity: 0.8; /* Slightly increased base opacity since colors are kept */
    transition: all 0.3s ease;
}

/* OVERRIDE: Prevent logos from changing color in dark mode */
[data-theme="dark"] .logo-track img {
    filter: none; 
}

.logo-track img:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Pause animation on hover so people can see the logos */
.logo-slider:hover .logo-track {
    animation-play-state: paused;
}

@keyframes scrollLogos {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}


/* --- VIDEO SECTION STYLING --- */
    #video-demo {
        position: relative;
        z-index: 1;
    }

    .video-wrapper {
        position: relative;
        max-width: 900px; /* Limits width on big screens */
        margin: 0 auto;
        border-radius: 20px;
        padding: 10px; /* Creates a frame effect */
        background: var(--surface-color);
        box-shadow: var(--shadow);
        border: 1px solid var(--glass-border);
    }


    .portfolio-video {
        width: 100%;
        aspect-ratio: 16 / 9; 
        border-radius: 12px;
        display: block;
        background: black;
        border: none; /* Remove default iframe border */
    }

    /* Glow effect behind the video */
    .video-glow {
        position: absolute;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        background: var(--primary);
        filter: blur(60px);
        opacity: 0.3;
        z-index: -1; /* Puts it behind the video wrapper */
        transition: opacity 0.3s ease;
    }

    /* Make the glow pulse slightly on hover */
    .video-wrapper:hover .video-glow {
        opacity: 0.5;
        background: var(--accent);
    }

    /* Customizing the video player controls (Webkit only) */
    video::-webkit-media-controls-panel {
        background-image: linear-gradient(transparent, rgba(0,0,0,0.5));
    }

    /* --- GLOBAL RELOCATION SECTION --- */
    .global-section {
        padding: 5rem 5%;
        position: relative;
        background: var(--surface-color);
        margin: 2rem 5%;
        border-radius: 30px;
        box-shadow: var(--shadow);
        overflow: hidden;
        display: flex; flex-wrap: wrap; align-items: center; justify-content: space-around; gap: 2rem;
    }

    .global-content { max-width: 450px; z-index: 2; }
    .global-content h2 { font-size: 2.5rem; margin-bottom: 1rem; color: var(--primary); }
    .global-content p { font-size: 1.1rem; color: var(--p-color); margin-bottom: 2rem; }

/* WhatsApp Button - bottom-right */
/* WhatsApp Button - bottom-right */
.whatsapp-btn {
  position: fixed;
  bottom: 40px; /* Increased from 20px to move up */
  right: 40px;  /* Increased from 20px to move away from edge */
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 30px;
  box-shadow: 0 0 10px #25D366, 0 0 20px #25D366;
  animation: jump 1s infinite, glow 2s infinite alternate;
  z-index: 9999;
  cursor: pointer;
}



    
    .map-container {
        position: relative;
        width: 400px;
        height: 400px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .world-bg {
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        background-image: url('https://upload.wikimedia.org/wikipedia/commons/8/80/World_map_-_low_resolution.svg');
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        opacity: 0.1;
    }
    [data-theme="dark"] .world-bg { filter: invert(1); opacity: 0.15; }

    .morocco-origin {
        width: 30px; height: 30px;
        background: var(--accent);
        border-radius: 50%;
        position: absolute;
        z-index: 10;
        animation: pulse-origin 2s infinite;
        border: 4px solid var(--surface-color);
    }

    .flight-paths {
        position: absolute;
        width: 100%; height: 100%;
    }
    .flight-path {
        stroke: var(--primary-light);
        stroke-width: 2;
        fill: none;
        stroke-dasharray: 500;
        stroke-dashoffset: 500;
        animation: draw-line 3s ease-out forwards infinite;
    }
    .path-2 { animation-delay: 0.5s; }
    .path-3 { animation-delay: 1s; }

    .destination-dot {
        fill: var(--accent);
        opacity: 0;
        animation: show-dot 3s ease-out forwards infinite;
    }
    .dot-2 { animation-delay: 0.5s; }
    .dot-3 { animation-delay: 1s; }

    @keyframes draw-line {
        to { stroke-dashoffset: 0; }
    }
    @keyframes show-dot {
        80% { opacity: 0; }
        100% { opacity: 1; }
    }
    @keyframes pulse-origin {
        0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); }
        70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(244, 63, 94, 0); }
        100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
    }

    /* --- TECHNICAL ARSENAL STYLING --- */
    section { padding: 5rem 10%; }
    .section-header { margin-bottom: 3rem; text-align: center; }
    .section-header h2 { font-size: 2.5rem; color: var(--text-color); font-weight: 800; }
    .section-header p { color: var(--p-color); max-width: 600px; margin: 0 auto; }

    .skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; }
    .skill-category {
        background: var(--surface-color);
        padding: 2rem;
        border-radius: 20px;
        box-shadow: var(--shadow);
        border: 1px solid var(--glass-border);
    }
    .skill-category:hover { 
        transform: translateY(-5px); 
        border-color: var(--primary);
    }
    .skill-category h3 {
        color: var(--primary);
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 1.2rem;
    }
    .skill-category h3 i {
        color: var(--accent);
        font-size: 1.5rem;
    }
    .skill-list {
        list-style: none;
        padding: 0;
    }
    .skill-list li {
        padding: 0.5rem 0;
        color: var(--p-color);
        font-weight: 500;
    }
    
    /* --- EXPERIENCE & EDUCATION --- */
    .timeline-container { border-left: 3px solid var(--primary-light); padding-left: 2rem; margin-left: 1rem; }
    .job-card {
        position: relative; margin-bottom: 3rem; background: var(--surface-color);
        padding: 2rem; border-radius: 16px; box-shadow: var(--shadow);
    }
    .job-card::before {
        content: ''; position: absolute; left: -2.6rem; top: 25px;
        width: 16px; height: 16px; background: var(--accent);
        border-radius: 50%; border: 4px solid var(--bg-color);
    }
    .job-title { color: var(--text-color); font-weight: 700; margin-bottom: 5px; }
    .job-company { color: var(--primary); font-weight: 600; margin-bottom: 10px; display: block; }
    
    .edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
    .edu-card {
        background: var(--surface-color); padding: 2.5rem; border-radius: 20px;
        text-align: center; box-shadow: var(--shadow); position: relative; overflow: hidden;
    }
    .edu-card::after {
        content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 5px;
        background: linear-gradient(90deg, var(--primary), var(--accent));
    }

    /* --- PROJECTS --- */
    .project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
    .project-card {
        background: var(--surface-color); border-radius: 20px; overflow: hidden;
        box-shadow: var(--shadow); transition: transform 0.3s;
    }
    .project-card:hover { transform: translateY(-10px); }
    .project-top {
        height: 140px; background: linear-gradient(135deg, var(--primary), #312e81);
        display: flex; align-items: center; justify-content: center; color: white; font-size: 3rem;
    }
    .project-content { padding: 1.5rem; }
    .project-content h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }

    /* --- CONTACT --- */
    footer {
        background: #0f172a; color: white; padding: 5rem 10%; text-align: center;
        border-top-left-radius: 50px; border-top-right-radius: 50px; margin-top: 4rem;
    }
    .social-row { display: flex; justify-content: center; gap: 20px; margin: 2rem 0; }
    .social-link {
        width: 55px; height: 55px; background: rgba(255,255,255,0.1);
        border-radius: 50%; display: flex; align-items: center; justify-content: center;
        color: white; text-decoration: none; font-size: 1.3rem; transition: 0.3s;
    }
    .social-link:hover { background: var(--accent); transform: rotate(360deg); }

    /* RTL Handling */
    body[dir="rtl"] { text-align: right; }
    body[dir="rtl"] .timeline-container { border-left: none; border-right: 3px solid var(--primary-light); padding-left: 0; padding-right: 2rem; }
    body[dir="rtl"] .job-card::before { left: auto; right: -2.6rem; }
    body[dir="rtl"] .skill-category h3 { flex-direction: row-reverse; }
    body[dir="rtl"] .btn { flex-direction: row-reverse; }

    @media (max-width: 768px) {
        h1 { font-size: 2.8rem; }
        .global-section { flex-direction: column-reverse; text-align: center; }
        .map-container { width: 300px; height: 300px; transform: scale(0.9); }
        .bio-stats { flex-direction: column; width: 100%; }
    }


