:root {
    /* Light Mode (Default) */
    --bg-dark: #ffffff;
    --bg-card: #f3f4f6;
    --text-primary: #1a1a1a;
    --text-secondary: #4b5563;
    --accent-primary: #2563eb;
    --accent-secondary: #7c3aed;
    --accent-glow: rgba(37, 99, 235, 0.3);

    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(0, 0, 0, 0.03);

    --title-gradient: linear-gradient(to right, #000000, #4b5563);
    --nav-bg-scrolled: rgba(255, 255, 255, 0.85);
    --nav-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'Space Grotesk', monospace;
    --font-ar: 'Cairo', sans-serif;
    /* Arabic Font */

    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-dark: #050505;
    --bg-card: #0e0e0e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-glow: rgba(59, 130, 246, 0.5);

    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.03);

    --title-gradient: linear-gradient(to right, #ffffff, #a0a0a0);
    --nav-bg-scrolled: rgba(5, 5, 5, 0.85);
    --nav-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(100px);
    z-index: -1;
    animation: float 20s infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(80px);
    z-index: -1;
    animation: float 15s infinite alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(100px, 50px);
    }
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--text-primary);
}

.cursor-outline {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: var(--title-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    color: var(--accent-primary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 3rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    display: inline-block;
    border: 1px solid transparent;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.2);
    margin-left: 1rem;
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.navbar .accent {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.theme-toggle,
.lang-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 10px;
    font-size: 1.1rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

.theme-toggle:hover,
.lang-toggle:hover {
    background: var(--accent-primary);
    color: white;
    transform: rotate(15deg);
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: var(--font-ar);
}

[dir="rtl"] body,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] p,
[dir="rtl"] a,
[dir="rtl"] span,
[dir="rtl"] button {
    font-family: var(--font-ar);
}

[dir="rtl"] .margin-left-auto {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .nav-links .btn-primary,
[dir="rtl"] .btn-secondary {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .theme-toggle,
[dir="rtl"] .lang-toggle {
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .hero-content h1 {
    line-height: 1.3;
}

[dir="rtl"] .skill-category h3 {
    flex-direction: row;
    gap: 10px;
}

[dir="rtl"] .timeline-item {
    margin-left: 0;
    margin-right: 50px;
    border-left: none;
}

[dir="rtl"] .timeline::after {
    left: auto;
    right: 20px;
}

[dir="rtl"] .timeline-item::after {
    left: auto;
    right: -38px;
}

[dir="rtl"] .contact-btn {
    text-align: right;
}

[dir="rtl"] .contact-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .hero-slider-nav {
    right: auto;
    left: 20px;
    flex-direction: row-reverse;
}

[dir="rtl"] .project-card,
[dir="rtl"] .skill-category,
[dir="rtl"] .timeline-content {
    text-align: right;
}

[dir="rtl"] .card-link i {
    transform: rotate(180deg);
}

/* Fix Hero Grid in RTL */
[dir="rtl"] .hero-container {
    direction: rtl;
}


.nav-links .btn-primary {
    padding: 8px 20px;
    margin-left: 0;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: var(--transition);
    background-color: var(--text-primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: center;
}

.hero-content .tagline {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 500px;
}

.social-links {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.social-links a:hover {
    color: var(--accent-primary);
    transform: translateY(-3px);
}

/* Profile Image */
.profile-img-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    border-radius: 20px;
    padding: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: var(--transition);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.profile-slider-wrapper:hover {
    transform: perspective(1000px) rotateY(0) rotateX(0);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.2);
}

.hero-slides {
    position: relative;
    width: 100%;
    /* Maintain aspect ratio */
    aspect-ratio: 3/4;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    border-radius: 15px;
    overflow: hidden;
}

.hero-slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.1);
    transition: var(--transition);
}

.profile-slider-wrapper:hover .hero-slide img {
    filter: grayscale(0%) contrast(1);
}

.video-container {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Cover effectively fills the wrapper, 'contain' shows black bars */
}

/* Removed validation placeholder styles */

.hero-slider-nav {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.nav-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-btn:hover {
    background: var(--accent-primary);
}

@keyframes floatImage {
    0% {
        transform: perspective(1000px) rotateY(-5deg) rotateX(5deg) translateY(0px);
    }

    50% {
        transform: perspective(1000px) rotateY(-5deg) rotateX(5deg) translateY(-15px);
    }

    100% {
        transform: perspective(1000px) rotateY(-5deg) rotateX(5deg) translateY(0px);
    }
}

/* Scroll Down */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-down a {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Sections */
.section {
    padding: 100px 0;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-category {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 16px;
    transition: var(--transition);
}

.skill-category:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.skill-category h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.skill-category h3 i {
    color: var(--accent-primary);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags span {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.skill-category:hover .tags span {
    background: rgba(37, 99, 235, 0.2);
    color: #fff;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--border-color);
    top: 0;
    bottom: 0;
    left: 20px;
    margin-left: -1px;
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    margin-left: 50px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: auto;
    left: -38px;
    top: 5px;
    border-radius: 50%;
    border: 3px solid var(--bg-dark);
    background: var(--accent-primary);
    z-index: 1;
}

.timeline-content {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 12px;
}

.timeline-content .date {
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.timeline-content h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.timeline-content h4 {
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 15px;
}

.timeline-content ul {
    list-style: disc;
    margin-left: 20px;
    color: var(--text-secondary);
}

.timeline-content li {
    margin-bottom: 8px;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-secondary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 25px;
}

.project-tags span {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.card-link {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-link:hover {
    gap: 12px;
}

/* Gallery Slider */
.gallery-slider {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.slider-wrapper {
    position: relative;
    width: 100%;
    /* 16:9 Aspect Ratio container */
    padding-top: 56.25%;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide img,
.slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Keeps aspect ratio entire image visible */
    background: #050505;
    /* Black bars for fit */
}

/* Video Placeholder Style */
.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: #fff;
    gap: 15px;
}

.video-placeholder i {
    font-size: 4rem;
    color: var(--accent-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.slide:hover .slide-caption {
    transform: translateY(0);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.slider-btn:hover {
    background: var(--accent-primary);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dots .dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.slider-dots .dot.active {
    background: var(--accent-primary);
    transform: scale(1.2);
}

/* Contact */
/* Contact - Redesigned */
.contact-container {
    display: flex;
    justify-content: center;
    padding-bottom: 50px;
}

.contact-box {
    text-align: center;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    padding: 60px 40px;
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.2);
}

/* Subtle Gradient Glow for Contact Box */
.contact-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.5;
}

.contact-box h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    background: var(--title-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-box p {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.contact-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    min-width: 280px;
    text-align: left;
}

[data-theme="light"] .contact-btn {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.contact-btn:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.contact-btn .icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .contact-btn .icon-box {
    background: #f3f4f6;
}

.email-btn .icon-box {
    color: var(--accent-primary);
}

.whatsapp-btn .icon-box {
    color: #25D366;
}

/* WhatsApp Green */

.btn-info {
    display: flex;
    flex-direction: column;
}

.btn-info .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.btn-info .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.social-links.large {
    margin-top: 20px;
}

.social-links.large a {
    font-size: 1.8rem;
    margin: 0 10px;
    color: var(--text-secondary);
    transition: var(--transition);
    background: transparent;
    border: 1px solid transparent;
}

.social-links.large a:hover {
    color: var(--accent-primary);
    transform: scale(1.1) rotate(5deg);
    background: transparent;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 900px) {
    .h1 {
        font-size: 3rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 40px;
    }

    .hero-content p {
        margin: 0 auto 30px;
    }

    .hero-btns {
        justify-content: center;
        display: flex;
    }

    .hero-visual {
        margin-top: 40px;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        width: 100%;
        text-align: center;
        padding: 40px 0;
        transition: 0.3s;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        right: 0;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .email-link {
        font-size: 1.2rem;
    }
}