:root {
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.5);
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.3s ease;
    --container-width: 1200px;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent-color);
}

.navbar {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-color);
}

.btn-contact {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--accent-color);
    border-radius: 50px;
    color: var(--accent-color) !important;
}

.btn-contact:hover {
    background: var(--accent-color);
    color: var(--bg-color) !important;
}

.lang-toggle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

.lang-toggle .active {
    color: var(--text-primary);
    font-weight: 600;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.4;
    z-index: -1;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hero-text {
    flex: 1;
}

.greeting {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: block;
}

.hero h1 {
    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;
    background-clip: text;
}

.hero h2 {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero p {
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--bg-color);
    border: 2px solid var(--accent-color);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.blob {
    position: absolute;
    width: 450px;
    height: 450px;
    background: linear-gradient(45deg, var(--accent-color), #8b5cf6);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: blob-bounce 10s infinite ease-in-out;
    filter: blur(40px);
    opacity: 0.5;
    z-index: 0;
}

.profile-img {
    width: 380px;
    height: 380px;
    object-fit: cover;
    border-radius: 50%; /* Make it circular */
    border: 3px solid var(--glass-border);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes blob-bounce {
    0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; transform: translate(0, 0); }
    33% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; transform: translate(20px, -20px); }
    66% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; transform: translate(-20px, 20px); }
}

/* Sections General */
section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--accent-color);
    font-weight: 500;
}

/* About Section */
.about-content {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.skills-container {
    margin-top: 2rem;
}

.skills-container h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tags span {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: var(--transition);
}

.skill-tags span:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.service-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--glass-border);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: var(--accent-color);
    border-radius: 50%;
    position: absolute;
    top: 15px;
    right: -10px;
    z-index: 1;
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-date {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.timeline-content {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 15px;
    border: 1px solid var(--glass-border);
    position: relative;
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--accent-color);
}

.timeline-content h3 {
    margin-bottom: 0.2rem;
    font-size: 1.2rem;
}

.timeline-content h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Portfolio Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.project-info {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex: 1;
}

.btn-link {
    color: var(--accent-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-link:hover {
    gap: 0.8rem;
}

.view-all {
    text-align: center;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item i {
    width: 50px;
    height: 50px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.info-item h4 {
    margin-bottom: 0.2rem;
}

.info-item p {
    color: var(--text-secondary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Footer */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
}

.footer .container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.social-links a:hover {
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-btns {
        justify-content: center;
    }

    .hero-image {
        margin-bottom: 2rem;
    }

    .profile-img {
        width: 280px;
        height: 280px;
    }

    .blob {
        width: 320px;
        height: 320px;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-item:nth-child(odd) {
        text-align: left;
    }

    .timeline-dot {
        left: 21px;
    }
    
    .timeline-item:nth-child(even) .timeline-dot {
        left: 21px;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .hamburger {
        display: block;
    }

    .navbar .nav-links {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        flex-direction: column;
        background-color: var(--bg-secondary);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        border-bottom: 1px solid var(--glass-border);
    }

    .navbar .nav-links.active {
        left: 0;
    }
    
    .lang-toggle {
        display: block;
        margin-right: 1rem;
    }
}

/* RTL Support */
[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .logo {
    font-family: 'Outfit', sans-serif;
}

[dir="rtl"] .nav-links {
    gap: 2rem;
}

[dir="rtl"] .hero-text {
    text-align: right;
}

[dir="rtl"] .hero h1 {
    line-height: 1.3;
}

[dir="rtl"] .section-header {
    text-align: center;
}

[dir="rtl"] .service-card {
    text-align: center;
}

[dir="rtl"] .project-info {
    text-align: right;
}

[dir="rtl"] .btn-link i {
    transform: rotate(180deg);
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="rtl"] .contact-content {
    direction: rtl;
}

[dir="rtl"] .info-item {
    text-align: right;
}

[dir="rtl"] .form-group input, 
[dir="rtl"] .form-group textarea {
    text-align: right;
}

/* Timeline RTL */
[dir="rtl"] .timeline::after {
    left: 50%;
}

[dir="rtl"] .timeline-item:nth-child(odd) {
    left: auto;
    right: 0;
    text-align: left;
}

[dir="rtl"] .timeline-item:nth-child(even) {
    left: auto;
    right: 50%;
    text-align: right;
}

[dir="rtl"] .timeline-dot {
    right: auto;
    left: -10px;
}

[dir="rtl"] .timeline-item:nth-child(even) .timeline-dot {
    left: auto;
    right: -10px;
}

/* Responsive RTL */
@media (max-width: 768px) {
    [dir="rtl"] .timeline::after {
        left: auto;
        right: 31px;
    }

    [dir="rtl"] .timeline-item {
        padding-left: 25px;
        padding-right: 70px;
        text-align: right !important;
    }

    [dir="rtl"] .timeline-item:nth-child(even) {
        left: auto;
        right: 0;
    }

    [dir="rtl"] .timeline-dot {
        left: auto;
        right: 21px;
    }

    [dir="rtl"] .timeline-item:nth-child(even) .timeline-dot {
        left: auto;
        right: 21px;
    }
    
    [dir="rtl"] .navbar .nav-links {
        left: auto;
        right: -100%;
    }

    [dir="rtl"] .navbar .nav-links.active {
        left: auto;
        right: 0;
    }
}
