:root {
    --primary: #6C63FF;
    --secondary: #00F5D4;
    --dark-bg: #0F172A;
    --card-bg: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --glass: rgba(30, 41, 59, 0.7);
    --glow: 0 0 20px rgba(108, 99, 255, 0.5);
    --font-en: 'Outfit', sans-serif;
    --font-ar: 'Tajawal', sans-serif;
}

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

body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    font-family: var(--font-en);
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* RTL Support */
body.rtl {
    direction: rtl;
    font-family: var(--font-ar);
}

/* Background Glow Effect */
.cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: -1;
    display: none;
    /* Can enable via JS for mouse tracking */
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: 1px;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

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

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

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

.lang-btn {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: var(--secondary);
    color: var(--dark-bg);
    box-shadow: var(--glow);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
}

.greeting {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s 0.2s forwards;
}

.name {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #94A3B8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    animation: fadeInUp 0.8s 0.4s forwards;
}

.role {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s 0.6s forwards;
}

.description {
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeInUp 0.8s 0.8s forwards;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s 1s forwards;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.6);
}

.btn.secondary {
    border: 2px solid var(--text-secondary);
    color: var(--text-primary);
}

.btn.secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tech-stack {
    margin-top: 3rem;
    display: flex;
    gap: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeInUp 0.8s 1.2s forwards;
}

.tech-stack i:hover {
    color: var(--secondary);
    transform: scale(1.2);
    transition: all 0.3s;
}

.hero-image {
    position: relative;
    opacity: 0;
    animation: fadeInRight 1s 0.5s forwards;
}

.img-wrapper {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    /* background: linear-gradient(45deg, var(--primary), var(--secondary)); */
    padding: 5px;
    /* Border width */
    position: relative;
    overflow: visible;
    /* Changed to visible for shadow/effects */
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(108, 99, 255, 0.3);
}

.floating-badge {
    position: absolute;
    background: var(--card-bg);
    padding: 0.8rem 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: float 3s ease-in-out infinite;
}

.badge-1 {
    top: 50px;
    left: -20px;
}

.badge-2 {
    bottom: 50px;
    right: -20px;
    animation-delay: 1.5s;
}

.badge-3 {
    top: 50%;
    right: -40px;
    animation-delay: 1s;
}

/* Staggered Animations */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.section-header,
.about-text p,
.stats,
.project-card,
.contact-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

section.visible .section-header,
section.visible .about-text p,
section.visible .stats,
section.visible .project-card,
section.visible .contact-item {
    opacity: 1;
    transform: translateY(0);
}

/* Sections */
section {
    padding: 5rem 10%;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header .line {
    width: 60px;
    height: 4px;
    background: var(--secondary);
    margin: 0 auto;
    border-radius: 2px;
}

/* About */
.about-container {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 5rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 3rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

/* Experience */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Vertical Line */
.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--secondary);
    top: 0;
    bottom: 0;
    left: 20px;
    /* Offset for line */
    border-radius: 2px;
}

body.rtl .timeline::after {
    left: auto;
    right: 20px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.8s forwards;
}

.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--secondary);
    left: 13px;
    /* Center on line at 20px */
    top: 15px;
    z-index: 1;
    box-shadow: 0 0 10px var(--secondary);
}

body.rtl .timeline-dot {
    left: auto;
    right: 13px;
}

.timeline-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s;
}

.timeline-content:hover {
    transform: translateX(10px);
}

body.rtl .timeline-content:hover {
    transform: translateX(-10px);
}

.timeline-content h3 {
    color: var(--text-primary);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    color: var(--secondary);
    font-size: 1rem;
    font-weight: 500;
}

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

.project-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-card:hover {
    transform: translateY(-10px);
}

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

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.project-card:hover .card-image img {
    transform: scale(1.1);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(108, 99, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.overlay i {
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 50%;
    transition: transform 0.3s;
}

.overlay i:hover {
    transform: scale(1.1);
    background: white;
    color: var(--primary);
}

.card-info {
    padding: 1.5rem;
}

.card-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.card-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tags span {
    background: rgba(108, 99, 255, 0.1);
    color: var(--secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* Contact */
.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
}

.contact-item i {
    color: var(--secondary);
    font-size: 1.5rem;
}

.social-links {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 2rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--secondary);
}

footer {
    padding: 2rem;
    text-align: center;
    background: black;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Media Queries */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 5%;
    }

    .nav-links {
        display: none;
        /* Mobile menu not implemented for brevity, but could be added */
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }

    .hero-content {
        margin-bottom: 3rem;
    }

    .cta-buttons {
        justify-content: center;
    }

    .tech-stack {
        justify-content: center;
    }

    .hero-image {
        animation: fadeInUp 0.8s 1.4s forwards;
        /* Change animation for mobile */
        opacity: 0;
    }

    .img-wrapper {
        width: 300px;
        height: 300px;
    }
}