:root {
    /* Spatial Glassmorphism Theme - VisionOS Style */
    --primary-bg: #0a0c10;
    --secondary-bg: #14171c;
    --accent-blue: #38bdf8;
    --accent-blue-glow: rgba(56, 189, 248, 0.4);
    --text-pure: #ffffff;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --header-bg: rgba(10, 12, 16, 0.7);
    --spatial-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--primary-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

body {
    background-color: var(--primary-bg);
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(30, 41, 59, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(15, 23, 42, 0.4) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.8;
    overflow-x: hidden;
    font-family: 'Poppins', sans-serif;
}

[lang="ar"] body {
    font-family: 'Cairo', sans-serif;
}

h1, h2, h3, .nav-logo {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 40px;
}

.section-padding { padding: 120px 0; }
.bg-accent { background: rgba(255, 255, 255, 0.02); }

/* RTL Support */
[dir="rtl"] { direction: rtl; }
[dir="rtl"] .vertical-timeline { border-left: none; border-right: 2px solid var(--glass-border); padding-left: 0; padding-right: 30px; }
[dir="rtl"] .timeline-dot { left: auto; right: -41px; }
[dir="rtl"] .exp-list li { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .exp-list li::before { left: auto; right: 0; content: "←"; }
[dir="rtl"] .fab-cv { right: auto; left: 40px; }
[dir="rtl"] .hero-btns { gap: 20px; }

.text-start { text-align: left; }
[dir="rtl"] .text-start { text-align: right; }

@media (max-width: 768px) {
    [dir="rtl"] .fab-cv { left: 20px; right: auto; }
}

/* Header */
.header {
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.header.scrolled {
    padding: 10px 0;
    background: rgba(10, 12, 16, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.nav-logo {
    font-size: 1.25rem;
    color: var(--text-pure);
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 800;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    margin: 0 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
}

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

.nav-links a:hover { 
    color: var(--text-pure);
}

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

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-pure);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
}

.mobile-only { display: none; }

.btn-cv-header {
    background: var(--accent-blue);
    color: #fff;
    padding: 10px 22px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px var(--accent-blue-glow);
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 30px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: var(--spatial-shadow);
}

.glass-card:hover { 
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-blue);
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(56, 189, 248, 0.15);
}

/* Hero Section */
.hero { min-height: 100vh; display: flex; align-items: center; position: relative; }

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 60px;
    width: 100%;
}

.hero-name {
    font-size: 5.5rem;
    color: var(--text-pure);
    margin-bottom: 10px;
    line-height: 0.9;
    letter-spacing: -3px;
    background: linear-gradient(180deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--accent-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 25px;
}

.headline { font-size: 2.5rem; color: var(--text-pure); margin-bottom: 25px; line-height: 1.1; letter-spacing: -1px; }
.sub-headline { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 45px; max-width: 650px; line-height: 1.8; }

.btn-primary-pill {
    background: var(--accent-blue);
    color: #fff;
    padding: 16px 36px;
    border-radius: 18px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px var(--accent-blue-glow);
}

.btn-primary-pill.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-pure);
    box-shadow: none;
}

.hero-img-card {
    width: 100%;
    max-width: 370px;
    aspect-ratio: 4/5;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: var(--spatial-shadow);
    margin-top: -50px;
    animation: float 6s ease-in-out infinite;
    perspective: 1000px;
}

@keyframes float {
    0% { transform: translateY(0px) rotateX(0deg) rotateY(0deg); }
    33% { transform: translateY(-20px) rotateX(2deg) rotateY(2deg); }
    66% { transform: translateY(-10px) rotateX(-2deg) rotateY(-2deg); }
    100% { transform: translateY(0px) rotateX(0deg) rotateY(0deg); }
}

.img-placeholder img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    object-position: center 30%; 
    transform: scale(1.5);
    transition: transform 0.3s ease;
}

.quote-card {
    background: rgba(56, 189, 248, 0.03);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

[dir="rtl"] .quote-card {
    border-left: none;
    border-right: 4px solid var(--accent-blue);
}

.section-title { font-size: 3.2rem; color: var(--text-pure); margin-bottom: 60px; text-align: center; }

/* Grid Layouts */
.dual-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 30px; }
.sectors-grid, .services-grid, .education-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

/* Skills Tags */
.skills-tags { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.skills-tags > span { 
    background: rgba(255, 255, 255, 0.03); 
    padding: 14px 18px; 
    border-radius: 12px; 
    border: 1px solid var(--glass-border); 
    display: flex; 
    align-items: center; 
    gap: 12px;
    transition: all 0.3s ease;
}
.skills-tags > span:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--accent-blue);
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 10px 30px var(--accent-blue-glow);
    color: var(--text-pure);
}
.skills-tags i { color: var(--accent-blue); font-size: 1.1rem; }
.skill-highlight { grid-column: 1 / -1; background: linear-gradient(90deg, rgba(56, 189, 248, 0.1), transparent) !important; border-color: var(--accent-blue) !important; }

/* Floating Action Button (CV) */
.fab-cv {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 2000;
    background: var(--accent-blue);
    color: #fff;
    padding: 16px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 15px 35px var(--accent-blue-glow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.fab-cv:hover { transform: scale(1.1) translateY(-5px); }

.whatsapp-fab {
    background: #25d366;
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.4);
}

/* Timeline */
.vertical-timeline {
    position: relative;
    padding-left: 30px;
    border-left: 2px solid var(--glass-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
}

.timeline-dot {
    position: absolute;
    left: -41px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent-blue-glow);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.exp-date {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.company-name {
    color: var(--text-pure);
    font-weight: 600;
    margin-bottom: 15px;
}

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

.exp-list li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
    color: var(--text-muted);
}

.exp-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

/* Portfolio Slider */
.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 20px 0 60px;
}

.lab-grid { 
    display: flex; 
    gap: 40px; 
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: grab;
    padding: 0 10px;
}

.lab-grid:active {
    cursor: grabbing;
}

.portfolio-item { 
    flex: 0 0 80%; 
    min-width: 350px;
    max-width: 900px;
}

.video-container { 
    width: 100%; 
    aspect-ratio: 16/9; 
    background: #000; 
    border-radius: 20px; 
    overflow: hidden; 
    margin-bottom: 30px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.portfolio-video { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; /* Changed to contain to show full video without cropping */
}

.slider-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.slider-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-pure);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px var(--accent-blue-glow);
}

.slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--accent-blue);
    width: 30px;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .portfolio-item { 
        flex: 0 0 95%; 
    }
}

/* Animations */
.reveal-hidden { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal-visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 1200px) {
    .container { padding: 0 30px; }
    .hero-name { font-size: 4rem; }
}

@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .hero-img-card { margin: 0 auto; max-width: 350px; }
    .sub-headline { margin-left: auto; margin-right: auto; }
    .hero-btns { justify-content: center; }
    .dual-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .section-padding { padding: 80px 0; }
    .section-title { font-size: 2.2rem; margin-bottom: 40px; }
    
    .mobile-only { display: flex; }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 12, 16, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        padding: 40px 0;
        gap: 30px;
        text-align: center;
        border-bottom: 1px solid var(--glass-border);
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
    }
    
    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
    
    .nav-links a {
        margin: 0;
        font-size: 1.1rem;
    }

    .hero-name { font-size: 3rem; }
    .headline { font-size: 1.8rem; }
    
    .btn-cv-header { display: none; }
    
    .sectors-grid, .services-grid, .lab-grid {
        grid-template-columns: 1fr;
    }

    .fab-cv {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 20px; }
    .hero-name { font-size: 2.5rem; }
    .headline { font-size: 1.5rem; }
    .hero-btns { flex-direction: column; width: 100%; }
    .btn-primary-pill { width: 100%; justify-content: center; }
}
