@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&family=Amiri:wght@400;700&family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Colors - Purplish Theme */
    --primary: #8A2BE2;
    /* BlueViolet */
    --primary-hover: #9932CC;
    /* DarkOrchid */
    --secondary: #9370DB;
    /* MediumPurple */
    --accent: #FFD700;
    /* Gold for subtle highlights */

    /* Dark Mode (Default) */
    --bg-body: #0F0F16;
    /* Very dark blue/purple black */
    --bg-card: #1A1A24;
    /* Dark purple/grey */
    --bg-nav: rgba(15, 15, 22, 0.95);
    --text-main: #FFFFFF;
    --text-muted: #B0B0C0;
    --border-color: #2D2D44;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

    /* Fonts */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-arabic: 'Cairo', sans-serif;
    --font-arabic-heading: 'Amiri', serif;

    /* Transitions */
    --transition: all 0.3s ease;
}

/* Light Mode Variables via class */
body.light-mode {
    --bg-body: #F5F5FA;
    --bg-card: #FFFFFF;
    --bg-nav: rgba(255, 255, 255, 0.95);
    --text-main: #2D2D3A;
    --text-muted: #666677;
    --border-color: #E0E0E8;
    --shadow: 0 8px 32px rgba(138, 43, 226, 0.1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.7;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* RTL Support */
[dir="rtl"],
.rtl {
    direction: rtl;
    text-align: right;
    font-family: var(--font-arabic);
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
.rtl h1,
.rtl h2,
.rtl h3,
.rtl h4,
.rtl h5,
.rtl h6 {
    font-family: var(--font-arabic-heading);
}

[dir="rtl"] .partnership-item {
    border-left: none;
    border-right: 5px solid var(--primary);
}

[dir="rtl"] .timeline::after {
    left: auto;
    right: 50%;
    margin-right: -1px;
}

[dir="rtl"] .timeline-item.right {
    left: 0;
}

[dir="rtl"] .timeline-item.left {
    left: 50%;
}

[dir="rtl"] .timeline-item::after {
    right: auto;
    left: -10px;
}

[dir="rtl"] .timeline-item.right::after {
    left: auto;
    right: -10px;
}

[dir="rtl"] .service-card {
    text-align: right;
}

[dir="rtl"] .nav-links {
    margin-right: auto;
    margin-left: initial;
}

[dir="rtl"] .dropdown-content {
    left: auto;
    right: 0;
}

[dir="rtl"] .dropdown .dropbtn i {
    margin-left: 0;
    margin-right: 5px;
}

/* Language Switcher */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
}

[dir="rtl"] .lang-switch {
    margin-left: 0;
    margin-right: 15px;
}

.lang-switch a {
    transition: var(--transition);
    padding: 4px 8px;
    border-radius: 4px;
}

.lang-switch a:hover {
    background: rgba(138, 43, 226, 0.1);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 4rem;
    font-size: 1.1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 14px 34px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(138, 43, 226, 0.5);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    margin-left: 10px;
}

.btn-secondary:hover {
    background-color: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}

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

.show-scroll {
    opacity: 1;
    transform: translateY(0);
}

/* Tag style for partnerships */
.tag {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Big Style Bullet Points for Partnerships */
.partnership-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 40px;
    list-style: none;
    text-align: left;
}

.partnership-item {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border-left: 5px solid var(--primary);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.partnership-item i {
    font-size: 1.8rem;
    color: var(--primary);
}

.partnership-item:hover {
    transform: translateX(10px);
    background: rgba(138, 43, 226, 0.05);
}

@media (max-width: 768px) {
    .partnership-item {
        font-size: 1.2rem;
        padding: 1.5rem;
    }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: -0.5px;
}

.logo .dot {
    color: var(--primary);
}

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

.nav-links a {
    font-weight: 500;
    font-size: 1rem;
    position: relative;
}

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

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

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

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

#theme-toggle:hover {
    color: var(--primary);
    transform: rotate(15deg);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}


/* Hero Section */
/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-nav);
    min-width: 220px;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-top: 2px solid var(--primary);
    border-radius: 0 0 8px 8px;
    backdrop-filter: blur(12px);
    top: 100%;
    /* Position right below the link */
    left: 0;
    padding: 10px 0;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: rgba(138, 43, 226, 0.1);
    color: var(--primary);
    padding-left: 20px;
    /* Slide effect */
}

/* Show on Hover */
.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Highlight Dropdown Parent when Active */
.nav-links a.active+.dropdown-content,
/* If active is on the link */
.dropdown .dropbtn.active {
    color: var(--primary);
}

.dropdown:hover .dropbtn {
    color: var(--primary);
}

.dropdown .dropbtn i {
    font-size: 0.8em;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropbtn i {
    transform: rotate(180deg);
}

/* Mobile Dropdown Adjustments */
@media (max-width: 768px) {
    .dropdown {
        display: block;
        width: 100%;
        text-align: center;
    }

    .dropdown-content {
        position: static;
        /* Flow naturally in mobile menu */
        display: none;
        /* Javascript/Hover needed or simple stacking */
        width: 100%;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.05);
        padding-left: 0;
        border-top: none;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        padding-left: 0;
        font-size: 0.9rem;
    }

    .dropdown-content a:hover {
        padding-left: 0;
        background: none;
        color: var(--primary);
    }
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 100px;
    padding-bottom: 50px;
    background: radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.15), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(32, 178, 170, 0.1), transparent 40%);
    overflow: hidden;
}

.hero-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.hero-content {
    flex: 1;
    max-width: 650px;
    animation: fadeIn 1.2s ease forwards;
    position: relative;
    z-index: 2;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    animation: fadeIn 1.5s ease forwards;
    position: relative;
    z-index: 1;
}

.hero-profile-img {
    max-width: 100%;
    width: 400px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    object-fit: cover;
}

@media (max-width: 991px) {
    .hero-grid {
        flex-direction: column-reverse;
        /* Text on top, image below? Or Image top? User asked for image right side usually implies desktop. On mobile, usually image top or bottom. Let's do Text Top (column) as originally designed, or maybe Image top for branding. Let's keep typical column: Image then Text or Text then Image. With column-reverse it connects to the visual flow. Let's just do column which puts content first then image. Wait, code below: flex-direction: column; would mean content then image. */
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }

    .hero-content {
        max-width: 100%;
        order: 1;
        /* Content first */
    }

    .hero-image {
        order: 2;
        /* Image second on mobile */
        margin-bottom: 20px;
    }

    .hero-profile-img {
        width: 300px;
    }

    .role {
        border-left: none;
        border-bottom: 3px solid var(--primary);
        padding-left: 0;
        padding-bottom: 1rem;
        display: inline-block;
    }
}

.eyebrow {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    display: block;
}

.hero h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 1.2rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--text-main), #a0a0a0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* Fallback will be set by the gradient */
    color: var(--text-main);
    /* Ensure visibility if bg-clip fails or simplify */
}

@supports (-webkit-background-clip: text) {
    .hero h1 {
        background: linear-gradient(to right, #fff, #999);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }

    body.light-mode .hero h1 {
        background: linear-gradient(to right, #333, #666);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}


.role {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-weight: 300;
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
}

.intro-text {
    font-size: 1.15rem;
    margin-bottom: 3rem;
    max-width: 650px;
    line-height: 1.8;
}

/* Page Header (Subpages) */
.page-header {
    background: radial-gradient(circle at 50% 0%, rgba(138, 43, 226, 0.15), transparent 60%);
    text-align: center;
    padding: 160px 0 80px;
    animation: fadeIn 1s ease forwards;
}

.page-header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about-section {
    padding: 120px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 5rem;
    align-items: center;
}

.about-image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-img {
    width: 100%;
    height: auto;
    transition: transform 0.6s ease;
    filter: grayscale(20%);
}

.about-image-wrapper:hover .about-img {
    transform: scale(1.03);
    filter: grayscale(0%);
}

.about-text h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.about-text h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 2rem;
    font-weight: 500;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.stats-grid {
    display: flex;
    gap: 4rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Timeline / Experience */
.experience-section {
    padding: 100px 0;
    background: var(--bg-card);
    /* Ensure contrast */
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-card);
    border: 4px solid var(--primary);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 28px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid var(--border-color);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--border-color);
}

.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 28px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid var(--border-color);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--border-color) transparent transparent;
}

.right::after {
    left: -10px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: var(--bg-body);
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
}

.company {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Services Grid */
.services-section {
    padding: 120px 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: left;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-12px);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.15);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}


.service-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    flex-grow: 1;
}

.service-card a {
    color: var(--primary);
    text-decoration: underline;
    transition: var(--transition);
}

.service-card a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}


/* Projects / Portfolio Grid (Placeholder) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.project-img {
    height: 220px;
    background: #2D2D44;
    /* Placeholder color */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.project-info {
    padding: 1.5rem;
}

/* Contact Section */
.contact-section {
    padding: 120px 0;
    background: linear-gradient(to top, var(--bg-card), var(--bg-body));
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: flex-start;
}

.contact-info h3 {
    font-size: 2.2rem;
}

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

.social-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
    margin-bottom: 1rem;
    font-weight: 500;
}

.social-link:hover {
    border-color: var(--primary);
    transform: translateX(10px);
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-body);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

/* Responsive */
@media (max-width: 900px) {
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::after {
        left: 21px;
    }

    .left::before,
    .right::before {
        left: 31px;
        /* Adjust arrow position */
        border: medium solid var(--border-color);
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--border-color) transparent transparent;
    }

    .right {
        left: 0%;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

/* PDF Modal Styles */
.modal {
    display: none;
}

.hero h1 {
    font-size: 3rem;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 75%;
        background: var(--bg-nav);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.nav-active {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
        color: var(--text-main);
    }

    .hero {
        text-align: center;
    }

    .hero-content {
        margin: 0 auto;
    }

    .role {
        border: none;
        border-left: none;
    }
}