:root {
    --background-color: #000000;
    --text-color: #ffffff;
    --secondary-text-color: #ffffff;
    --border-color: #222222;
    --surface-color: #0a0a0a;
    --accent-color: #ffffff; /* تم تغييره من الأزرق إلى الأبيض */
    --accent-hover: #ffffff; /* تم تغييره ليتناسب مع لون التمرير */

    /* --- ألوان إضافية للتحسينات --- */
    --glow-color: rgba(255, 255, 255, 0.1);

    /* Glitch Effect Colors (يمكنك تعديلها) */
    --glitch-color-1: #00FFFF; /* لون سماوي */
    --glitch-color-2: #FF00FF; /* لون بنفسجي */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
    /* --- إضافة لإخفاء مؤشر الفأرة الافتراضي --- */
    cursor: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* --- HEADER --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 25px 0;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.main-header.scrolled {
    padding: 15px 0;
    background-color: rgba(10, 10, 10, 0.95);
    border-bottom: 1px solid var(--border-color);
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-weight: 700;
    font-size: 22px;
    color: var(--text-color);
}

/* We wrap the nav links and switcher in a container for better alignment */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 40px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Language Switcher Styles */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 1px solid var(--border-color);
    padding-left: 20px;
}

.lang-switcher a {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-text-color);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lang-switcher a.active {
    opacity: 1;
}

.lang-switcher span {
    color: var(--border-color);
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 101;
}

.progress-bar {
    height: 4px;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.1s linear;
}

/* --- HERO SECTION --- */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: +10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-image: url('abalahb.JPEG');
    background-size: cover;
    background-position: center;
    z-index: -2;
    filter: brightness(0.6);
    /* --- إضافة حركة التنفس للخلفية --- */
    animation: heroBreathing 8s ease-in-out infinite;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-content {
    z-index: 1;
    padding: 0 20px;
    padding-top: 150px;
}

.hero-content h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    color: var(--text-color);
}

.hero-content p {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-color);
    margin-top: 20px;
    max-width: 600px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    font-size: 14px;
    color: var(--secondary-text-color);
    letter-spacing: 1px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scroll-indicator::after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    background: var(--secondary-text-color);
    margin-top: 10px;
    animation: scrollBounce 1.5s infinite;
}

/* --- MAIN CONTENT --- */
.content-wrapper {
    position: relative;
    z-index: 10;
    background-color: var(--background-color);
}

.section {
    padding: 120px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 80px;
    gap: 40px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-top: 5px;
    white-space: nowrap;
}

.section-header p {
    max-width: 500px;
    font-size: 22px;
    line-height: 1.7;
    color: var(--text-color);
}

/* --- PROJECTS SECTION --- */
.projects-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.project-item {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    /* --- تحسين الظل للتوهج --- */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 15px var(--accent-color), 0 0 30px var(--glow-color);
}

.project-item h3 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    color: var(--text-color);
}

.project-item p {
    font-size: 16px;
    color: var(--secondary-text-color);
    margin-bottom: 25px;
    max-width: 700px;
    position: relative;
    z-index: 1;
}

.project-tags {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tags span {
    display: inline-block;
    background-color: rgba(34, 34, 34, 0.8);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.project-tags span:hover {
    background-color: var(--accent-color);
    color: var(--background-color);
    transform: translateY(-2px);
}

/* --- SKILLS SECTION --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
}

.skill-category {
    position: relative;
    padding: 20px;
    border-radius: 12px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    /* --- تحسين الظل للتوهج --- */
    box-shadow: 0 0 15px var(--accent-color), 0 0 20px var(--glow-color);
}

.skill-category h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    color: var(--accent-color);
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    color: var(--secondary-text-color);
    margin-bottom: 12px;
    font-size: 16px;
    position: relative;
    padding-left: 20px;
    /* --- إضافة للظهور التدريجي --- */
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.skill-category li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* --- كلاس إضافي لتفعيل الأنيميشن --- */
.skill-category.is-visible li {
    opacity: 1;
    transform: translateX(0);
}

.certifications {
    margin-top: 80px;
    text-align: center;
    padding: 30px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.certifications:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    /* --- تحسين الظل للتوهج --- */
    box-shadow: 0 0 15px var(--accent-color), 0 0 20px var(--glow-color);
}

.certifications h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.certifications p {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
}

.certifications p:first-of-type {
    margin-bottom: 10px;
}

/* --- FOOTER / CONTACT --- */
footer {
    padding: 120px 0;
    text-align: center;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
}

footer .section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 30px;
    max-width: 900px;
    margin: 0 auto 30px;
}

footer .section-subtitle {
    font-size: 18px;
    color: var(--secondary-text-color);
    margin-bottom: 50px;
    max-width: 600px;
    margin: 0 auto 50px;
}

.footer-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.contact-card {
    background-color: rgba(20, 20, 20, 0.8);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.contact-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    /* --- تحسين الظل للتوهج --- */
    box-shadow: 0 0 15px var(--accent-color), 0 0 25px var(--glow-color);
}

.contact-card i {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.contact-card .contact-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.contact-card .contact-value {
    font-size: 16px;
    color: var(--secondary-text-color);
    transition: color 0.3s ease;
}

.contact-card:hover .contact-value {
    color: var(--text-color);
}

.footer-bottom {
    margin-top: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--secondary-text-color);
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.social-links a {
    color: var(--secondary-text-color);
    font-size: 20px;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        text-align: center;
    }

    .section-header p {
        margin: 0 auto;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
    }

    .nav-controls {
        gap: 20px;
    }

    .nav-links {
        gap: 7px;
    }

    .lang-switcher {
        padding-left: 20px;
    }

    /* --- إضافة لإخفاء مؤشر الفأرة المخصص على الموبايل --- */
    .cursor-aura {
        display: none !important;
    }

    body {
        cursor: auto !important;
    }
}

@media (max-width: 600px) {
    .nav-links {
        display: flex;
    }
}

/* --- CSS for Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--surface-color);
    padding: 40px 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 25px var(--glow-color);
}

.service-card i {
    font-size: 36px;
    color: var(--accent-color);
    margin-bottom: 25px;
    display: block;
}

.service-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.service-card p {
    font-size: 15px;
    color: var(--secondary-text-color);
    line-height: 1.7;
}

/* --- ANIMATIONS --- */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes scrollBounce {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* === التحسينات الجمالية المضافة === */

/* 1. مؤشر الفأرة المتوهج (Cursor Aura) */
.cursor-aura {
    width: 30px;
    height: 30px;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease-out, opacity 0.3s ease-out, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
    transform-origin: center center;
    opacity: 0; /* يبدأ مخفياً */
}

.cursor-aura.active {
    opacity: 0.5; /* يظهر عند أول حركة للمؤشر */
}

.cursor-aura.scaled {
    transform: scale(1.5); /* يتم تحديث transform بواسطة JS */
    border-color: var(--accent-color);
    opacity: 0.8; /* يصبح أكثر وضوحاً عند التفاعل */
}


/* 2. حركة تنفس لخلفية الـ Hero */
@keyframes heroBreathing {
    0% {
        transform: scale(1);
        filter: brightness(0.6);
    }
    50% {
        transform: scale(1.03);
        filter: brightness(0.7);
    }
    100% {
        transform: scale(1);
        filter: brightness(0.6);
    }
}

/* 3. تأثير الخلل (Glitch Effect) على العناوين */
.glitching {
    position: relative;
    overflow: hidden;
    animation: glitch-skew 0.3s infinite linear alternate-reverse;
}

/* تخزين النص الأصلي كسمة بيانات لاستخدامها في ::before و ::after */
.glitching[lang="en"]::before,
.glitching[lang="en"]::after {
    content: attr(data-en);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    pointer-events: none;
}

.glitching[lang="ar"]::before,
.glitching[lang="ar"]::after {
    content: attr(data-ar);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    pointer-events: none;
}


/* تأثيرات الظل والانحراف */
.glitching::before {
    left: -2px;
    text-shadow: 1px 0 var(--glitch-color-1);
    clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%);
    animation: glitch-text-1 0.3s infinite linear alternate-reverse;
}

.glitching::after {
    left: 2px;
    text-shadow: -1px 0 var(--glitch-color-2);
    clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%);
    animation: glitch-text-2 0.3s infinite linear alternate-reverse;
}

@keyframes glitch-text-1 {
    0% {
        clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%);
        transform: translate(1px, 0);
    }
    20% {
        clip-path: polygon(0 0, 100% 0, 100% 10%, 0 10%);
        transform: translate(-1px, 0);
    }
    40% {
        clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
        transform: translate(1px, 0);
    }
    60% {
        clip-path: polygon(0 0, 100% 0, 100% 20%, 0 20%);
        transform: translate(-1px, 0);
    }
    80% {
        clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
        transform: translate(1px, 0);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%);
        transform: translate(0, 0);
    }
}

@keyframes glitch-text-2 {
    0% {
        clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%);
        transform: translate(-1px, 0);
    }
    20% {
        clip-path: polygon(0 80%, 100% 80%, 100% 100%, 0 100%);
        transform: translate(1px, 0);
    }
    40% {
        clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
        transform: translate(-1px, 0);
    }
    60% {
        clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
        transform: translate(1px, 0);
    }
    80% {
        clip-path: polygon(0 90%, 100% 90%, 100% 100%, 0 100%);
        transform: translate(-1px, 0);
    }
    100% {
        clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%);
        transform: translate(0, 0);
    }
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }
    25% {
        transform: skew(1deg, -1deg);
    }
    50% {
        transform: skew(-1deg, 1deg);
    }
    75% {
        transform: skew(2deg, -2deg);
    }
    100% {
        transform: skew(0deg);
    }
}

/* === CSS لزر تبديل الصوت (الصوت) === */
.audio-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    color: var(--secondary-text-color);
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.audio-toggle-btn i {
    font-size: 20px;
}

.audio-toggle-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 10px var(--glow-color);
}

.audio-toggle-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}


/* Hide Arabic elements by default */
[lang="ar"] {
    display: none;
}

/* When body has .lang-ar class, switch to Arabic */
body.lang-ar {
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

body.lang-ar [lang="en"] {
    display: none;
}

body.lang-ar [lang="ar"] {
    display: inline;
}

/* Ensure block-level elements remain block-level */
body.lang-ar h1,
body.lang-ar h2,
body.lang-ar h3,
body.lang-ar h4,
body.lang-ar p,
body.lang-ar div[lang="ar"] {
    display: block;
}

/* Specific elements that need to be forced to LTR like phone numbers */
.force-ltr {
    direction: ltr;
}

/* === RTL Adjustments === */

/* Navigation underline */
body.lang-ar .nav-links a::after {
    left: auto;
    right: 0;
}

/* Language switcher border */
body.lang-ar .lang-switcher {
    border-left: none;
    border-right: 1px solid var(--border-color);
    padding-left: 0;
    padding-right: 20px;
}

/* Section headers */
body.lang-ar .section-header {
    text-align: right;
}

/* Project Items */
body.lang-ar .project-item {
    text-align: right;
}

/* Skills list bullet points */
body.lang-ar .skill-category li {
    padding-left: 0;
    padding-right: 20px;
}

body.lang-ar .skill-category li::before {
    content: '◃';
    left: auto;
    right: 0;
}

/* --- تعديل للظهور التدريجي في العربي --- */
body.lang-ar .skill-category li {
    transform: translateX(20px);
}

body.lang-ar .skill-category.is-visible li {
    transform: translateX(0);
}

/* Responsive fixes for RTL */
@media (max-width: 768px) {
    body.lang-ar .section-header {
        text-align: center;
    }

    body.lang-ar .lang-switcher {
        padding-right: 20px;
    }
}
