:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(15, 23, 42, 0.6);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Animation */
.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: #3b82f6;
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.globe-2 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    bottom: 20%;
    right: -5%;
    animation-delay: -5s;
}

.globe-3 {
    width: 250px;
    height: 250px;
    background: #06b6d4;
    top: 40%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, -30px);
    }
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-speed);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 1px;
}

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

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

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

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

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

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 1rem;
    position: relative;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.highlight {
    color: transparent;
    background: linear-gradient(90deg, var(--accent-color), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.cta-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--accent-color);
    color: #0f172a;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px var(--accent-glow);
}

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

.btn-secondary:hover {
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-3px);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-secondary);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 2px;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(15px);
        opacity: 0;
    }
}

/* Sections General */
.section {
    padding: 6rem 5%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-secondary);
    margin-bottom: 4rem;
    font-size: 1.1rem;
}

/* Glass Card Style */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform var(--transition-speed);
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.3);
}

/* Experience Timeline */
.timeline {
    position: relative;
    margin-top: 3rem;
    padding-left: 2rem;
    border-left: 2px solid var(--glass-border);
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 0.5rem;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    border: 3px solid var(--bg-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-role {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.timeline-company {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.timeline-date {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-style: italic;
}

/* Projects & Grid */
.grid-container,
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card,
.pub-card {
    padding: 1.5rem;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card:hover,
.pub-card:hover {
    transform: translateY(-5px);
}

.project-meta {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.project-link {
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Certifications */
.certs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.cert-tag {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.cert-tag:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--primary-color);
}

/* Publications Grid */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.pub-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.pub-type {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.pub-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.pub-venue {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.pub-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-color);
    font-weight: 500;
    margin-top: auto;
}

.pub-link:hover {
    text-decoration: underline;
}

/* Contact */
.contact-card {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-methods {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.contact-item i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.9);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s forwards ease-out;
}

.fade-in-delay-1 {
    animation-delay: 0.2s;
}

.fade-in-delay-2 {
    animation-delay: 0.4s;
}

.fade-in-delay-3 {
    animation-delay: 0.6s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    /* Simplified mobile handling */
    .hamburger {
        display: flex;
    }

    .timeline {
        padding-left: 1.5rem;
    }

    .timeline-item::before {
        left: -2.1rem;
    }
}

/* Navbar Extras */
.nav-extras {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-right: 2rem;
}

.lang-switch {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #0f172a;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--accent-color);
}

/* About Section Update */
.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-image {
    flex: 0 0 300px;
    position: relative;
    order: 0;
}

.profile-pic {
    width: 300px;
    height: 300px;
    border-radius: 20px;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 30px var(--accent-glow);
    object-position: top;
}

.about-text {
    flex: 1;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Amiri', 'Inter', sans-serif;
}

[dir="rtl"] .nav-links {
    margin-right: auto;
    margin-left: 0;
    gap: 1rem;
}

[dir="rtl"] .nav-extras {
    margin-right: 0;
    margin-left: 2rem;
}

[dir="rtl"] .timeline {
    border-left: none;
    border-right: 2px solid var(--glass-border);
    padding-left: 0;
    padding-right: 2rem;
}

[dir="rtl"] .timeline-item::before {
    left: auto;
    right: -2.6rem;
    /* Adjust for padding + border width */
}

/* Analytics Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: 10% auto;
    width: 90%;
    max-width: 800px;
    position: relative;
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.close-modal {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: var(--text-primary);
}

[dir="rtl"] .close-modal {
    float: left;
}

.analytics-dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.chart-container {
    grid-column: span 2;
    height: 300px;
    position: relative;
}

.note {
    grid-column: span 2;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 1rem;
}

/* Responsive Updates */
@media (max-width: 900px) {
    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-image {
        margin-bottom: 2rem;
        order: -1;
    }

    /* Keep nav clean on mobile */
    .nav-extras {
        display: none;
    }

    /* We should probably add lang switch to mobile menu via JS or CSS if critical */
}