/* ===== CSS VARIABLES ===== */
:root {
    /* Modern Tech Blue & Cyan Scheme */
    --primary-blue: #0ea5e9; /* Sky Blue */
    --primary-dark: #0284c7; /* Darker Sky */
    --secondary-navy: #0f172a; /* Slate 900 */
    --accent-teal: #2dd4bf; /* Teal Accent */
    --light-blue: #38bdf8; /* Light Sky */
    --dark-bg: #020617; /* Updated to requested sleek dark blue */
    --card-bg: #1e293b; /* Slate 800 */
    --text-light: #f8fafc; /* Slate 50 */
    --text-gray: #cbd5e1; /* Slate 300 */
    --border-color: #334155; /* Slate 700 */
    --header-bg: rgba(2, 6, 23, 0.8);
    --glow-opacity: 0.1;
    --shadow-color: rgba(0, 0, 0, 0.4);
    
    /* Typography */
    --font-sans: 'Outfit', sans-serif;
    --font-arabic: 'Tajawal', sans-serif;
    --font-logo: 'Oswald', sans-serif; /* New logo font */
    
    /* Spacing */
    --header-height: 70px;
    --section-spacing: 5rem;
    --container-width: 1200px;
    --border-radius: 8px;
    --border-radius-lg: 15px; /* Added for larger radius */
    --transition: all 0.3s ease;
}

body.light-mode {
    --secondary-navy: #f1f5f9; /* Slate 100 - For subtle sections */
    --dark-bg: #f8fafc; /* Slate 50 - Main background */
    --card-bg: #ffffff; /* Clean white card background */
    --text-light: #0f172a; /* Slate 900 */
    --text-gray: #475569; /* Slate 600 - Optimal for long descriptions */
    --border-color: #e2e8f0; /* Crisp subtle border */
    --header-bg: rgba(248, 250, 252, 0.85);
    --glow-opacity: 0.03; /* Minimal tint to avoid "dirty" look on white */
    --shadow-color: rgba(15, 23, 42, 0.06); /* Soft, airy shadows */
    --primary-blue: #0284c7; /* Deeper blue for better contrast on white */
}

/* Fix Skill Card Hover in Light Mode */
body.light-mode .skill-card:hover {
    background: #e0f2fe;
    border-color: var(--primary-blue);
}

/* Fix About Code Block in Light Mode (Frosted glass light version) */
body.light-mode .about-code-block {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 10px 30px var(--shadow-color);
}

/* Light Mode Cards Consistency */
body.light-mode .skill-card,
body.light-mode .tech-icon-item,
body.light-mode .timeline-content {
    background: var(--card-bg); /* Reverted to solid card background */
    border-color: var(--border-color); /* Reverted to general border color */
    box-shadow: 0 10px 25px var(--shadow-color); /* Reverted to general shadow */
}

body.light-mode .code-header {
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .logo:hover {
    color: var(--primary-dark);
}

body.light-mode .about-code-block pre {
    color: #1e293b; /* Ensure text is dark slate for readability */
}

/* Adjust syntax colors for light mode code block */
body.light-mode .code-keyword { color: #0550ae; } /* GitHub-like Blue */
body.light-mode .code-string { color: #24292f; }
body.light-mode .code-function { color: #8250df; } /* Purple */
body.light-mode .code-comment { color: #6e7781; } /* Gray */
body.light-mode .code-property { color: #953800; } /* Orange/Brown */

/* Fix scrollbar visibility in light mode */
body.light-mode .about-code-block pre::-webkit-scrollbar-thumb {
    background-color: rgba(15, 23, 42, 0.15);
}

body.light-mode .copy-code-btn {
    background: #e2e8f0;
    color: #475569;
}


/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--primary-blue);
    z-index: 2000;
}

/* ===== CURSOR SPOTLIGHT ===== */
.cursor-spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle 600px at var(--mouse-x, 0px) var(--mouse-y, 0px), rgba(14, 165, 233, var(--glow-opacity)), transparent 80%);
    z-index: 1;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    background-color: var(--dark-bg); /* Prevent white flash during transition */
}

body {
    font-family: var(--font-sans);
    background-color: var(--dark-bg);
    color: var(--text-gray);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.4s ease, opacity 0.3s ease-in-out;
}

body.lang-switching {
    opacity: 0;
    pointer-events: none;
}

body[dir="rtl"] {
    font-family: var(--font-arabic);
}

/* ===== CONTAINER ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== HEADER & NAVIGATION ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    height: var(--header-height);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-header.scrolled {
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.4);
    height: 62px;
}

body.light-mode .main-header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

body.light-mode .main-header.scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: 1.25rem;
    transition: padding 0.3s ease;
}

.main-header.scrolled .header {
    height: 62px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo {
    font-family: var(--font-logo);
    font-size: clamp(1.15rem, 3.5vw, 1.55rem);
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--primary-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    transition: color 0.25s ease, transform 0.2s ease;
}

.logo::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent-teal, #0ea5e9);
    box-shadow: 0 0 10px var(--accent-teal, #0ea5e9);
    flex-shrink: 0;
}

.logo:hover {
    color: var(--light-blue);
    transform: translateY(-1px);
}

/* Desktop Navigation */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 0.35rem;
    padding: 0;
    margin: 0;
    align-items: center;
}

.nav-link {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 600;
    padding: 0.48rem 0.85rem;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    position: relative;
    white-space: nowrap;
}

.nav-link i {
    font-size: 0.85rem;
    opacity: 0.8;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
    color: var(--primary-blue);
    background: rgba(14, 165, 233, 0.12);
}

body.light-mode .nav-link {
    color: #475569;
}

body.light-mode .nav-link:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.06);
}

body.light-mode .nav-link.active {
    color: var(--primary-blue);
    background: rgba(14, 165, 233, 0.12);
}

/* Header Actions (Language, Theme, Mobile Toggle) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.header-action-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: inherit;
}

.header-action-btn:hover {
    background: rgba(14, 165, 233, 0.16);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-1px);
}

.lang-btn {
    padding: 0.42rem 0.85rem;
    border-radius: 50px;
    gap: 0.45rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.lang-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.theme-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    font-size: 0.95rem;
}

.theme-btn:hover {
    transform: translateY(-1px) rotate(15deg);
}

body.light-mode .header-action-btn {
    background: #ffffff;
    border-color: var(--border-color);
    color: #0f172a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

body.light-mode .header-action-btn:hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.25s ease;
}

.nav-toggle:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

body.light-mode .nav-toggle {
    background: #ffffff;
    border-color: var(--border-color);
    color: #0f172a;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--header-height) 0 2rem;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--secondary-navy) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%230ea5e9" fill-opacity="0.05" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-text .subtitle {
    font-size: 1.25rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-gray);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    border-radius: 50px; /* More rounded modern look */
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid transparent;
    box-shadow: 0 4px 15px -5px rgba(14, 165, 233, 0.3), inset 0 -2px 0 rgba(0,0,0,0.2);
    z-index: 1;
}

.action-btn:hover {
    background: linear-gradient(135deg, var(--light-blue), var(--primary-blue));
    transform: translateY(-3px);
    box-shadow: 0 7px 20px -5px rgba(14, 165, 233, 0.4), inset 0 -2px 0 rgba(0,0,0,0.1);
    color: white;
    border-color: transparent;
}

/* Shine effect for buttons */
.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn.secondary-btn {
    background: rgba(30, 41, 59, 0.5);
    color: var(--text-light);
    border-color: var(--border-color);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2);
}

body.light-mode .action-btn.secondary-btn {
    background: rgba(226, 232, 240, 0.5); /* Slate 200 equivalent */
    border-color: var(--border-color);
}

.action-btn.secondary-btn:hover {
    background: rgba(14, 165, 233, 0.15); /* Subtle blue glow */
    color: var(--light-blue);
    border-color: var(--light-blue);
    box-shadow: 0 7px 20px -5px rgba(14, 165, 233, 0.2), inset 0 -2px 0 rgba(0,0,0,0.1);
}

.hero-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: clamp(180px, 40vw, 280px);
    aspect-ratio: 1/1;
    margin: 0 auto;
    z-index: 1;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.hero-image-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px; /* Adjust inset to account for border */
    border-radius: 50%; /* Circular border */
    background: radial-gradient(circle, var(--accent-teal), transparent 70%); /* Changed glow color */
    opacity: 0.3;
    transition: var(--transition);
    animation: heroGlow 1.5s ease-out 0.2s backwards;
    z-index: -1;
}

.hero-image {
    width: 100%;
    height: 100%;
}

.hero-image img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    object-position: center 25%; /* Focus on the face */
    border-radius: 50%; /* Circular image */
    border: 2px solid var(--primary-blue); /* Added a prominent border */
    padding: 6px; /* Add some space between image and border */
    background-color: var(--dark-bg); /* Add background color for padding */
    transition: all 0.4s ease; /* Adjusted transition */
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.2); /* Apply shadow by default */
    animation: heroImageReveal 1.2s cubic-bezier(0.23, 1, 0.32, 1) 0.4s backwards;
}

.hero-image-wrapper:hover img {
    box-shadow: 0 0 35px rgba(14, 165, 233, 0.4); /* Enhanced shadow on hover */
    transform: scale(1.02);
}

.hero-image-wrapper:hover::before {
    opacity: 0.6;
    transform: scale(1.1);
}

/* ===== SECTIONS COMMON STYLES ===== */
.section-spacing {
    padding: var(--section-spacing) 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-blue);
    border-radius: 2px;
}

/* ===== ABOUT SECTION ===== */
.about-content {
    display: grid;
    grid-template-columns: 1fr; /* Changed to single column */
    gap: 3rem;
    align-items: start; /* Align items to the top, allowing them to have their natural height */
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* About Actions */
.about-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Disabled Button Style */
.action-btn.disabled,
.project-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

/* ===== BRANDED BUTTONS STYLES ===== */

/* GitHub Button */
.action-btn[href*="github.com"],
.project-btn[href*="github.com"],
.social-links a[href*="github.com"] {
    transition: all 0.3s ease;
}
.action-btn[href*="github.com"]:hover,
.project-btn[href*="github.com"]:hover,
.social-links a[href*="github.com"]:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}
/* GitHub Vibrant Light Mode Override */
body.light-mode .action-btn[href*="github.com"]:hover,
body.light-mode .project-btn[href*="github.com"]:hover,
body.light-mode .social-links a[href*="github.com"]:hover {
    background: rgba(15, 23, 42, 0.08) !important;
    border-color: #0f172a !important;
    color: #0f172a !important;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.15) !important;
}

/* LinkedIn Button */
.action-btn[href*="linkedin.com"],
.social-links a[href*="linkedin.com"] {
    transition: all 0.3s ease;
}
.action-btn[href*="linkedin.com"]:hover,
.social-links a[href*="linkedin.com"]:hover {
    background: rgba(0, 119, 181, 0.1) !important;
    border-color: #0077b5 !important;
    color: #0077b5 !important;
    box-shadow: 0 5px 15px rgba(0, 119, 181, 0.4);
}
/* LinkedIn Vibrant Light Mode Override */
body.light-mode .action-btn[href*="linkedin.com"]:hover,
body.light-mode .social-links a[href*="linkedin.com"]:hover {
    background: rgba(0, 119, 181, 0.1) !important;
    border-color: #0077b5 !important;
    box-shadow: 0 5px 15px rgba(0, 119, 181, 0.2) !important;
}

/* Download CV Button (Teal) */
.action-btn[href*=".pdf"] {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background: transparent;
}
.action-btn[href*=".pdf"]:hover {
    background: var(--accent-teal) !important;
    color: white !important;
    border-color: var(--accent-teal) !important;
    box-shadow: 0 5px 15px rgba(45, 212, 191, 0.3);
}
/* CV Button Vibrant Light Mode */
body.light-mode .action-btn[href*=".pdf"]:hover {
    background: #0d9488 !important; /* Slightly deeper teal */
    border-color: #0d9488 !important;
    box-shadow: 0 5px 15px rgba(13, 148, 136, 0.25) !important;
}

/* Instagram Button */
.social-links a[href*="instagram.com"] {
    color: #E1306C;
    border-color: rgba(225, 48, 108, 0.3);
}
.social-links a[href*="instagram.com"]:hover {
    background: rgba(225, 48, 108, 0.1) !important;
    border-color: #E1306C !important;
    color: #E1306C !important;
    box-shadow: 0 5px 15px rgba(225, 48, 108, 0.4);
}
/* Instagram Vibrant Light Mode */
body.light-mode .social-links a[href*="instagram.com"]:hover {
    background: rgba(225, 48, 108, 0.12) !important;
    border-color: #E1306C !important;
    box-shadow: 0 5px 15px rgba(225, 48, 108, 0.2) !important;
}

/* Facebook Button */
.social-links a[href*="facebook.com"] {
    color: #1877F2;
    border-color: rgba(24, 119, 242, 0.3);
}
.social-links a[href*="facebook.com"]:hover {
    background: rgba(24, 119, 242, 0.1) !important;
    border-color: #1877F2 !important;
    color: #1877F2 !important;
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.4);
}
/* Facebook Vibrant Light Mode */
body.light-mode .social-links a[href*="facebook.com"]:hover {
    background: rgba(24, 119, 242, 0.12) !important;
    border-color: #1877F2 !important;
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.2) !important;
}

/* TikTok Button */
.social-links a[href*="tiktok.com"] {
    color: #ff0050; /* TikTok Red/Pink accent */
    border-color: rgba(255, 0, 80, 0.3);
}
.social-links a[href*="tiktok.com"]:hover {
    background: rgba(255, 0, 80, 0.1) !important;
    border-color: #ff0050 !important;
    color: #ff0050 !important;
    box-shadow: 0 5px 15px rgba(255, 0, 80, 0.4);
}
/* TikTok Vibrant Light Mode */
body.light-mode .social-links a[href*="tiktok.com"]:hover {
    background: rgba(255, 0, 80, 0.12) !important;
    border-color: #ff0050 !important;
    box-shadow: 0 5px 15px rgba(255, 0, 80, 0.2) !important;
}

/* WhatsApp Link */
.contact-item-team[href*="wa.me"]:hover {
    color: #25D366 !important;
}

/* hiveity Vibrant Light Mode Override */
body.light-mode .social-links a.hiveity-site:hover {
    background: rgba(132, 204, 22, 0.15) !important;
    border-color: #65a30d !important; /* Slightly darker lime for contrast */
    color: #65a30d !important;
    box-shadow: 0 5px 15px rgba(132, 204, 22, 0.3) !important;
}

/* hiveity Website Icon (Light Green) */
.social-links a.hiveity-site:hover {
    color: #84cc16 !important; /* Lime Green */
    border-color: #84cc16 !important;
    background: rgba(132, 204, 22, 0.1) !important;
    box-shadow: 0 5px 15px rgba(132, 204, 22, 0.4);
}
.social-links a.facebook-icon:hover {
    color: #84cc16 !important; /* Lime Green */
    border-color: #84cc16 !important;
    background: rgba(132, 204, 22, 0.1) !important;
    box-shadow: 0 5px 15px rgba(132, 204, 22, 0.4);
}
.social-links a.hiveity-site:hover {
    color: #84cc16 !important; /* Lime Green */
    border-color: #84cc16 !important;
    background: rgba(132, 204, 22, 0.1) !important;
    box-shadow: 0 5px 15px rgba(132, 204, 22, 0.4);
}
.social-links a.hiveity-site:hover {
    color: #84cc16 !important; /* Lime Green */
    border-color: #84cc16 !important;
    background: rgba(132, 204, 22, 0.1) !important;
    box-shadow: 0 5px 15px rgba(132, 204, 22, 0.4);
}
.social-links a.hiveity-site:hover {
    color: #84cc16 !important; /* Lime Green */
    border-color: #84cc16 !important;
    background: rgba(132, 204, 22, 0.1) !important;
    box-shadow: 0 5px 15px rgba(132, 204, 22, 0.4);
}
.social-links a.hiveity-site:hover {
    color: #84cc16 !important; /* Lime Green */
    border-color: #84cc16 !important;
    background: rgba(132, 204, 22, 0.1) !important;
    box-shadow: 0 5px 15px rgba(132, 204, 22, 0.4);
}

/* Personal Info Grid */
.personal-info {
    margin-top: 2rem;
}

.personal-info h3 {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.info-grid {
    /* Changed from grid to a simpler block layout */
    display: block;
    border-top: 1px solid var(--border-color); /* Add a top border */
}

.info-item {
    display: flex;
    justify-content: space-between; /* Pushes label and value apart */
    align-items: center;
    padding: 1rem 0; /* Add vertical padding */
    border-bottom: 1px solid var(--border-color); /* Add a bottom border for separation */
}

.info-label {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Space between icon and text */
}

.info-label i {
    color: var(--primary-blue);
    width: 20px; /* Ensure consistent icon alignment */
    text-align: center;
}

.info-item strong {
    color: var(--text-light);
    font-weight: 600; /* Make the label bolder */
}

.info-item span {
    text-align: right; /* Align value to the right */
}
/* Code Block */
.about-code-block {
    /* Glassmorphism effect */
    background: rgba(15, 23, 42, 0.4); /* Transparent dark background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* For Safari */

    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(14, 165, 233, 0.3); /* Light blue glowing border */
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0; /* Ensures grid item can shrink properly */
}

.code-header {
    background: rgba(255, 255, 255, 0.03); /* Subtle header bg */
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot.red { background: #ff5f56; }
.code-dot.yellow { background: #ffbd2e; }
.code-dot.green { background: #27c93f; }

.code-title {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.copy-code-btn {
    margin-left: auto;
}
body[dir="rtl"] .copy-code-btn {
    margin-left: 0;
    margin-right: auto;
}

.copy-code-btn {
    background: var(--border-color);
    border: none;
    color: var(--text-gray);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.copy-code-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

.copy-code-btn.copied {
    background: var(--accent-teal) !important;
    color: white;
}

.about-code-block pre {
    padding: 1.5rem 1.5rem 1.5rem 3.5rem; /* Add left padding for line numbers */
    margin: 0;
    background: transparent; /* Make pre background transparent */
    color: var(--text-light);
    flex-grow: 1; /* Allow the pre tag to fill available space */
    position: relative;
    counter-reset: line;
    overflow-x: auto; /* Allow horizontal scrolling for long lines */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Custom Scrollbar for Code Block */
.about-code-block pre::-webkit-scrollbar {
    height: 6px;
}
.about-code-block pre::-webkit-scrollbar-track {
    background: transparent;
}
.about-code-block pre::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

/* Ensure scrollbar remains visible on dark code block in light mode */
body.light-mode .about-code-block pre::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

.about-code-block pre code::before {
    content: counter(line);
    counter-increment: line;
    position: absolute;
    left: 0;
    width: 2.5rem;
    text-align: right;
    padding-right: 1rem;
    color: var(--border-color);
    font-size: 0.9rem;
    display: inline-block;
}

.about-code-block code {
    font-family: 'Fira Code', 'Courier New', monospace; /* Updated Font */
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-comment { color: #6a9955; }
.code-keyword { color: #569cd6; }
.code-string { color: #ce9178; }
.code-function { color: #dcdcaa; }
.code-property { color: #9cdcfe; }

/* Animation for code copy */
.about-code-block.code-copied-animation {
    animation: flash-success 0.7s ease-out;
}

/* ===== SKILLS SECTION ===== */
.skills-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.skill-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    margin-bottom: 0; /* Remove margin as gap is handled by grid */
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.skill-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-label i {
    color: var(--primary-blue);
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.skill-name {
    color: var(--text-light);
    font-weight: 600;
}

.skill-percent {
    color: var(--text-gray);
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background-color: var(--dark-bg); /* Darker background for contrast */
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid transparent; /* Remove border, use shadow instead */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4); /* Inner shadow for depth */
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.1);
    border-color: var(--primary-blue); /* Highlight border on hover */
}

.progress {
    width: 0; /* Initial width for animation */
    height: 100%;
    background-color: var(--primary-blue);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 40px 40px;
    border-radius: var(--border-radius);
    transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); /* Smooth animation */
    animation: progress-stripes 2s linear infinite;
}
.section-description {
    max-width: 700px;
    margin: -2rem auto 3rem auto;
}

/* ===== hiveity SECTION ===== */
.hiveity-content {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 3rem;
    align-items: start;
}

.hiveity-info h3 {
    color: var(--text-light);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.hiveity-info p {
    margin-bottom: 1.5rem;
}

.leader-text {
    font-style: italic;
    color: var(--primary-blue);
    font-weight: 600;
}

.team-contact-info {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.team-contact-info h4 {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.team-contact-info .social-links {
    justify-content: flex-start;
    margin-bottom: 1.5rem;
}

.contact-details-team {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item-team {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item-team:hover {
    color: var(--primary-blue);
}

/* Wrapper for projects grid and show more button */
.projects-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== PROJECTS SECTION ===== */
#projects {
    background-color: var(--secondary-navy);
    position: relative;
}

.projects-intro {
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    color: var(--text-gray);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    align-items: stretch;
    grid-auto-rows: 1fr;
    width: 100%; /* Ensure grid takes full width of its wrapper */
    justify-content: center; /* Center grid items horizontally */
    gap: 1.5rem;
}

.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.4s ease, background-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; 
    position: relative;
    box-shadow: 0 14px 30px -12px var(--shadow-color);
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--primary-blue);
    opacity: 0.7;
    z-index: 3;
}

/* Interactive Card Glow Overlay */
.project-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 300px at var(--card-x, 0px) var(--card-y, 0px), rgba(14, 165, 233, var(--glow-opacity)), transparent 80%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 2;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-blue);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.1);
}

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

.project-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    height: auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Overlay Gradient for Link Visibility */
.project-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(2, 6, 23, 0.6) 0%, transparent 40%);
    z-index: 2;
    pointer-events: none;
}

.project-external-link {
    position: absolute;
    top: 1rem;
    right: 1rem; /* تم النقل لليمين */
    width: 38px;
    height: 38px;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

body[dir="rtl"] .project-external-link {
    right: auto;
    left: 1rem; /* يعود لليسار في وضع العربي */
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 1;
}

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

/* Project External Link Icon */
.project-external-link {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 35px;
    height: 35px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

body.light-mode .project-external-link {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-blue);
    border-color: var(--border-color);
}

/* تحسين أيقونة الرابط عند التحويم */
.project-external-link:hover {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

body[dir="rtl"] .project-external-link {
    right: auto;
    left: 1rem;
}

.project-info {
    padding: 1.5rem;
    flex: 1; 
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* توزيع المحتوى بين الأعلى والأسفل */
    position: relative;
    z-index: 1;
}

.project-info h3 {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.project-description {
    margin-bottom: 1.25rem;
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* حصر الوصف في 3 أسطر لضمان التنسيق */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#show-more-projects {
    display: none; /* Hidden by default, shown by JS */
    margin-top: 2rem; /* Keep the top margin */
    padding: 0.75rem 2rem;
    width: fit-content;
    margin-inline: auto;
}

/* Filter Buttons */
.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-gray);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* Click Feedback Effects */
.action-btn:active, .project-btn:active, .filter-btn:active, .project-external-link:active {
    transform: scale(0.94);
}

.project-card.hidden {
    display: none !important;
}

.project-tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    list-style: none;
    margin-top: auto;
}

.project-tech-list li {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary-blue);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.project-links.center {
    justify-content: center;
}

.project-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem; /* Increased gap for better spacing */
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 50px;
    transition: var(--transition);
    font-size: 0.9rem;
    background: transparent;
}

.project-btn:not(.disabled):hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Telegram Bot Button - Green Glow */
.project-btn[href*="t.me"] {
    border-color: rgba(37, 211, 102, 0.5);
    color: #25D366;
}

.project-btn[href*="t.me"]:hover {
    background: rgba(37, 211, 102, 0.1);
    border-color: #25D366;
    color: #25D366;
    box-shadow: 0 0 15px rgba(37, 211, 102, 0.4);
}

/* ===== NEW PROJECTS SECTION STYLES ===== */
.project-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-image-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

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

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

.project-text-container {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tech-title {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-item {
    font-size: 0.8rem;
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary-blue);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.project-link svg {
    width: 18px;
    height: 18px;
}

.project-link.live-demo {
    color: var(--primary-blue);
}

.project-link.view-code {
    color: var(--text-gray);
}

.project-link:hover {
    text-decoration: underline;
    transform: translateY(-2px);
}

/* ===== SERVICES SECTION STYLES ===== */
.services-container {
    position: relative;
    padding: 2rem 0;
}

.service-bg-img {
    position: absolute;
    z-index: -1;
    opacity: 0.1;
    pointer-events: none;
}

.service-bg-img.img-1 { top: 10%; left: 5%; width: 300px; }
.service-bg-img.img-2 { bottom: 10%; right: 5%; width: 250px; }
.service-bg-img.img-3 { top: 40%; right: 15%; width: 150px; }

.service-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-blue);
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.15);
}

.service-icon {
    width: 50px;
    height: 50px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary-blue);
}

.service-icon svg {
    width: 28px;
    height: 28px;
}

.card-title {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.card-description {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===== TIMELINE STYLES ===== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: calc(100% - 20px);
    background: linear-gradient(to bottom, var(--primary-blue), rgba(14, 165, 233, 0.1));
}

.timeline-item {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
    width: 100%;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-date {
    flex: 1;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-blue);
    padding: 0.4rem 1rem;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    width: fit-content;
    margin-bottom: 0.5rem;
}

.timeline-content {
    flex: 2;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 1.5rem;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.timeline-content::before { 
    display: none; /* Hide old dot */
}

/* New Timeline Icon Styles */
.timeline-icon {
    position: absolute;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    background: var(--dark-bg);
    border: 2px solid var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-size: 1.2rem;
    z-index: 2;
    box-shadow: 0 0 0 6px var(--dark-bg), 0 0 15px rgba(14, 165, 233, 0.3); /* Glow effect */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timeline-item:hover .timeline-icon {
    background: var(--primary-blue);
    color: white;
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 0 0 6px var(--dark-bg), 0 0 25px rgba(14, 165, 233, 0.6);
}

.timeline-content h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.company {
    color: var(--primary-blue);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.event-details {
    margin-bottom: 1rem;
}

.focusflow-event p,
.spherex-event p {
    margin-bottom: 0.85rem;
}

.focusflow-event p:last-child,
.spherex-event p:last-child {
    margin-bottom: 0;
}

/* ===== CONTACT SECTION (Home CTA) ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-cta {
    background: var(--card-bg);
    padding: 3.5rem 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 35px var(--shadow-color);
    max-width: 900px;
    margin: 0 auto;
}

.contact-info h3 {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.contact-details {
    margin: 2rem 0;
}

.contact-details .contact-item {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.contact-details .contact-item:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    text-decoration: none;
}

.contact-item i {
    color: var(--primary-blue);
    width: 20px;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.social-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
/* The brand-specific hovers will override the background color */
.contact-form {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===== FOOTER ===== */
.main-footer {
    background: var(--secondary-navy);
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-blue);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-gray);
}

/* ===== CONTACT PAGE SPECIFIC STYLES ===== */
.contact-page {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--secondary-navy) 100%);
    min-height: 100vh;
}

.simple-header {
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 30px -10px var(--shadow-color);
}

.contact-form-section {
    padding: calc(var(--header-height) + 2rem) 0 var(--section-spacing);
}

.contact-header h1 {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.contact-intro {
    font-size: 1.2rem;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.contact-form-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Contact Info Sidebar */
.contact-info-sidebar {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + 2rem);
}

.contact-info-sidebar h3 {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 1.5rem;
    text-align: center;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-method {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.method-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.method-info h4 {
    color: var(--text-light);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.method-info p {
    color: var(--text-gray);
    margin: 0;
    font-size: 0.9rem;
}

.social-links-sidebar h4 {
    color: var(--text-light);
    margin-bottom: 1rem;
    text-align: center;
}

.social-links-sidebar .social-links {
    justify-content: center;
}

/* Contact Form */
#contact-form {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

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

#contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-submit {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.submit-btn {
    position: relative;
    width: auto;
    min-width: 200px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

#form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: none;
}

#form-status.success {
    background: #10b981;
    color: white;
    display: block;
}

#form-status.error {
    background: #ef4444;
    color: white;
    display: block;
}

.submit-btn .btn-text {
    transition: opacity 0.3s ease;
}

.submit-btn .loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: none; /* Hidden by default */
    animation: spin 1s linear infinite;
}

/* Loading state class will be added by JS */
.submit-btn.loading .btn-text {
    opacity: 0;
    visibility: hidden;
}

.submit-btn.loading .loading-spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.back-to-home {
    text-align: center;
    margin-top: 3rem;
}

/* ===== THANK YOU PAGE STYLES ===== */
.thank-you-page {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--secondary-navy) 100%);
    min-height: 100vh;
}

.thank-you-section {
    padding: calc(var(--header-height) + 2rem) 0 var(--section-spacing);
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.thank-you-content {
    max-width: 800px;
    margin: 0 auto;
}

.success-icon {
    font-size: 5rem;
    color: #10b981;
    margin-bottom: 2rem;
    animation: bounceIn 1s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.thank-you-content h1 {
    font-size: 3.5rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.success-message {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.next-steps {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.next-steps h3 {
    color: var(--text-light);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.5rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

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

.step-number {
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto 1rem;
}

.step-item p {
    color: var(--text-gray);
    margin: 0;
}

.contact-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.emergency-contact {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.emergency-contact p {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.contact-direct {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.direct-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    background: var(--card-bg);
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2);
}

.direct-contact:hover {
    background: var(--primary-dark);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3), inset 0 -1px 0 rgba(0,0,0,0.1);
}

/* ===== SIMPLE FOOTER (Used on sub-pages) ===== */
.simple-footer {
    background: var(--secondary-navy);
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

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

.footer-social-links {
    display: flex;
    gap: 1rem;
}

.footer-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.03);
}

.footer-social-links a:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    color: var(--primary-blue);
    background: rgba(14, 165, 233, 0.1);
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem; /* Fixed to left as requested */
    width: 50px;
    height: 50px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(14, 165, 233, 0.4);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.5);
}

body.light-mode .back-to-top {
    background: var(--card-bg); /* لون خلفية البطاقات في الوضع الفاتح */
    color: var(--primary-blue);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.1); /* ظل خفيف للوضع الفاتح */
}

body.light-mode .back-to-top:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.2); /* ظل أزرق خفيف عند التحويم */
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    animation: popIn 0.3s ease-out forwards;
}

.back-to-top:hover { 
    transform: translateY(-5px);
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-4 { margin-top: 4rem; }
.mb-4 { margin-bottom: 4rem; }

/* ===== ANIMATIONS ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
    will-change: opacity, transform; /* Performance optimization */
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== LOADED STATE ANIMATIONS ===== */
body.loaded .animate-on-scroll {
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
/* New custom keyframes for the hero image animation */
@keyframes heroGlow {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 0.3; /* Default opacity */
        transform: scale(1.1);
    }
}

@keyframes heroImageReveal {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-15deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Keyframe for animated progress bar stripes */
@keyframes progress-stripes {
    from { background-position: 40px 0; }
    to { background-position: 0 0; }
}

/* Keyframe for code copy success flash */
@keyframes flash-success {
    0% {
        box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.5), 0 15px 30px rgba(0,0,0,0.3);
    }
    100% {
        box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    }
}

/* ===== SKILLS SECTION (CARD-BASED) ===== */
#skills {
    background: linear-gradient(180deg, var(--secondary-navy) 0%, rgba(15, 23, 42, 0.94) 100%);
}

.skills-intro {
    max-width: 680px;
}

.skills-grid-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 1100px;
    margin: 0 auto 3.5rem;
}

.skill-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(14, 165, 233, 0.2);
    padding: 2rem 1.6rem;
    border-radius: 20px;
    text-align: left;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    box-shadow: 0 10px 30px -10px var(--shadow-color);
}

.skill-card::before {
    /* Soft glow from top */
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.skill-card:hover {
    transform: translateY(-10px);
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.15), rgba(15, 23, 42, 0.9)); /* لون خلفية جديد عند التمرير */
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: 0 20px 40px -10px rgba(14, 165, 233, 0.15);
}

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

.skill-card:hover::before {
    opacity: 1;
    transform: translateX(-50%);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    width: 70px;
    height: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 50%;
    color: var(--primary-blue);
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.1);
    -webkit-background-clip: border-box;
    -webkit-text-fill-color: initial;
}

.skill-card:hover .skill-icon {
    transform: scale(1.1);
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.4);
}

.skill-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.skill-description {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.6;
}

/* New Styles for Skill Level & Project Badge */
.skill-level {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary-blue);
    margin-bottom: 1rem;
    display: inline-block;
    font-weight: 500;
}

.project-badge {
    position: absolute;
    top: 15px;
    left: 15px; /* تم النقل لليسار لتجنب التداخل مع الأيقونة */
    background: rgba(15, 23, 42, 0.9);
    color: var(--primary-blue);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

body[dir="rtl"] .project-badge {
    left: auto;
    right: 15px;
}

/* --- New Skills Section Structure --- */
.subsection-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--text-light);
    margin-top: 4rem;
    margin-bottom: 2rem;
    position: relative;
}

.subsection-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--primary-blue);
    opacity: 0.5;
    border-radius: 2px;
}

.other-tech-section {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.tech-section-description {
    max-width: 560px;
    margin: -1rem auto 1.75rem;
    text-align: center;
    color: var(--text-gray);
}

.tech-icons-grid {
    display: flex;
    flex-wrap: wrap;
    display: grid;
    grid-template-columns: repeat(6, minmax(100px, 1fr));
    justify-content: center;
    gap: 2rem 3rem; /* row-gap column-gap */
    max-width: 800px;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    padding-top: 1rem;
}

.tech-icon-item {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem .75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    width: 130px;
    width: 100%;
    text-align: center;
    transition: var(--transition);
    min-height: 132px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.16);
    position: relative;
    overflow: hidden;
}

.tech-icon-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 40%);
    transition: opacity 0.5s ease;
    opacity: 0;
    z-index: 0;
}

.tech-icon-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.3);
}

.tech-icon-item:hover::before {
    opacity: 1;
}

.tech-icon-item i { font-size: 3rem; transition: var(--transition); z-index: 1; }
.tech-icon-item span { font-size: 1rem; color: var(--text-light); font-weight: 600; transition: var(--transition); z-index: 1; }
.tech-python { color: #3776ab; }
.tech-java { color: #f89820; }
.tech-c { color: #a8b9cc; }
.tech-git { color: #f05032; }
.tech-cloud { color: #55a946; }

.tech-icon-item:hover i {
    transform: scale(1.1);
    filter: none;
}

.tech-icon-item:hover span {
    color: var(--primary-blue);
}

/* ===== DIRECT & IMMEDIATE IMAGE LOADING ===== */
img {
    opacity: 1 !important;
    filter: none !important;
    content-visibility: visible !important;
}

img[data-src] {
    opacity: 1 !important;
    filter: none !important;
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .main-header,
    .back-to-top,
    .nav-toggle,
    .lang-switcher-wrapper {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero,
    .section-spacing {
        padding: 1rem 0 !important;
    }
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-blue: #0000ff;
        --text-light: #000000;
        --text-gray: #333333;
        --border-color: #000000;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .project-card:hover,
    .hero-image-wrapper:hover img,
    .hero-image-wrapper:hover::before {
        transform: none;
        filter: none;
    }
}

/* RTL specific adjustments */
body[dir="rtl"] .timeline::before {
    right: 20px;
    left: auto;
}

body[dir="rtl"] .back-to-top {
    left: auto;
    right: 2rem;
}

body[dir="rtl"] .lang-switcher-wrapper {
    /* This is now handled by nav-list padding */
}
body[dir="rtl"] .nav-list {
    padding-left: 0;
    padding-right: 2rem;
}

/* ===== AVAILABILITY STATUS ===== */
.availability-status {
    display: inline-flex;
    margin-top: 2rem; /* Added spacing from buttons */
    align-items: center;
    gap: 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: var(--transition);
}

.status-indicator {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
    animation: pulse-green 2s infinite;
}

.availability-status p {
    margin: 0;
    color: #10b981;
    font-weight: 500;
    font-size: 0.95rem;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.featured-project {
    border-color: rgba(45, 212, 191, 0.45);
}

.featured-project .project-badge {
    color: var(--accent-teal);
    border-color: rgba(45, 212, 191, 0.35);
}

.sandbox-category-header {
    margin-top: 1.5rem;
}

/* Project Category Headers */
.project-category-header {
    grid-column: 1 / -1;
    width: 100%;
    margin: 2.2rem 0 1rem;
    padding: 1.25rem 1.6rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.65));
    border-radius: 12px;
    border: 1px solid rgba(14, 165, 233, 0.25);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.25);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

[dir="ltr"] .project-category-header {
    text-align: left;
    border-left: 4px solid var(--primary-blue);
    border-right: 1px solid rgba(14, 165, 233, 0.25);
}

[dir="rtl"] .project-category-header {
    text-align: right;
    border-right: 4px solid var(--primary-blue);
    border-left: 1px solid rgba(14, 165, 233, 0.25);
}

.project-category-header:first-of-type {
    margin-top: 0.25rem;
}

.project-category-header h3.subsection-title {
    margin: 0 0 0.45rem;
    font-size: 1.35rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
}

.project-category-header h3.subsection-title i {
    color: var(--primary-blue);
    font-size: 1.15rem;
}

.project-category-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Light mode support for category headers */
body.light-mode .project-category-header {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.9));
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

body.light-mode .project-category-header h3.subsection-title {
    color: #0f172a;
}

body.light-mode .project-category-header p {
    color: #334155 !important;
    font-weight: 500 !important;
}

/* Final project gallery presentation */
#projects .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem;
}

#projects .project-card {
    min-height: 100%;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.9));
    border-color: rgba(148, 163, 184, 0.2);
}

#projects .project-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-blue);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.34), 0 0 0 1px rgba(14, 165, 233, 0.16);
}

#projects .project-image {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(2, 6, 23, 0.96), rgba(30, 41, 59, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .75rem;
}

#projects .project-image::before {
    content: '';
    position: absolute;
    inset: -14%;
    background-position: center;
    background-size: cover;
    filter: blur(18px) saturate(1.15);
    opacity: .34;
    transform: scale(1.08);
    z-index: 0;
}

#projects .project-image-focusflow::before { background-image: url('../assets/images/FocusFlow.png'); }
#projects .project-image-spherex::before { background-image: url('../assets/images/before_after_pqm.png'); }
#projects .project-image-miead::before { background-image: url('../assets/images/MieadScheduleBot.png'); }
#projects .project-image-nitd::before { background-image: url('../assets/images/NITD.png'); }
#projects .project-image-qaati::before { background-image: url('../assets/images/Qaati.png'); }
#projects .project-image-sentiment::before { background-image: url('../assets/images/emotion.ai.png'); }
#projects .project-image-itgs::before { background-image: url('../assets/images/ITGS220-AI-Bot.png'); }
#projects .project-image-snake::before { background-image: url('../assets/images/Snake_game.png'); }
#projects .project-image-feedback::before { background-image: url('../assets/images/Feedback_Bot.jpg'); }
#projects .project-image-todo::before { background-image: url('../assets/images/To-do.list.png'); }
#projects .project-image-jokes::before { background-image: url('../assets/images/joke_game.png'); }

#projects .project-image img {
    position: relative;
    z-index: 1;
    object-fit: contain;
    object-position: center;
    filter: saturate(0.96) contrast(1.05);
    border-radius: 6px;
    opacity: 1 !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

/* General Hover fallback for standard project images */
#projects .project-card:hover .project-image img {
    transform: scale(1.025);
}

/* ===== Unified Showcase Trio: Miead, Sensa, SPHEREx ===== */
#projects .project-image-miead,
#projects .project-image-sentiment,
#projects .project-image-spherex {
    aspect-ratio: 16 / 10;
    height: 220px;
    padding: 0.85rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(14, 165, 233, 0.16) 0%, rgba(15, 23, 42, 0.98) 100%);
    border-bottom: 1px solid rgba(14, 165, 233, 0.22);
}

/* Symmetrical framing for Square App Icons (Miead & Sensa) */
#projects .project-image-miead img,
#projects .project-image-sentiment img {
    position: relative;
    z-index: 1;
    height: 86%;
    width: auto;
    max-width: 86%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
    border-radius: 14px;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12);
    filter: saturate(1.06) contrast(1.08) brightness(1.02);
    image-rendering: -webkit-optimize-contrast;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, filter 0.4s ease;
}

/* Panoramic Framing for Scientific Streak Banner (SPHEREx) */
#projects .project-image-spherex img {
    position: relative;
    z-index: 1;
    width: 94%;
    height: auto;
    max-height: 84%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(14, 165, 233, 0.28);
    filter: saturate(1.08) contrast(1.1) brightness(1.03);
    image-rendering: -webkit-optimize-contrast;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, filter 0.4s ease;
}

/* Coordinated Interactive Hover Lift for the Showcase Trio */
#projects .project-card:hover .project-image-miead img,
#projects .project-card:hover .project-image-sentiment img,
#projects .project-card:hover .project-image-spherex img {
    transform: scale(1.045) translateY(-2px);
    filter: saturate(1.14) contrast(1.12) brightness(1.05);
    box-shadow: 0 16px 36px -4px rgba(14, 165, 233, 0.3), 0 0 0 1px rgba(14, 165, 233, 0.45);
}

#projects .project-card:hover .project-image-miead::before,
#projects .project-card:hover .project-image-sentiment::before,
#projects .project-card:hover .project-image-spherex::before {
    opacity: 0.46;
    transform: scale(1.14);
}

#projects .project-image-feedback,
#projects .project-image-todo,
#projects .project-image-jokes {
    padding: 0;
}

#projects .project-image-snake {
    aspect-ratio: 1 / 1;
    padding: .25rem;
}

#projects .project-image-itgs,
#projects .project-image-feedback,
#projects .project-image-todo,
#projects .project-image-jokes {
    aspect-ratio: 1 / 1;
    padding: .25rem;
}

#projects .project-image-feedback img,
#projects .project-image-todo img,
#projects .project-image-jokes img {
    object-fit: cover;
    object-position: center;
    transform: scale(1.08);
}

#projects .project-card:hover .project-image-feedback img,
#projects .project-card:hover .project-image-todo img,
#projects .project-card:hover .project-image-jokes img {
    transform: scale(1.12);
}


#projects .project-image-snake img {
    object-fit: contain;
}

#projects .project-image-itgs img,
#projects .project-image-feedback img,
#projects .project-image-todo img,
#projects .project-image-jokes img {
    object-fit: contain;
    object-position: center;
    transform: scale(1.03);
}

#projects .project-card:hover .project-image-snake img {
    transform: scale(1.12);
}

#projects .project-card:hover .project-image-itgs img,
#projects .project-card:hover .project-image-feedback img,
#projects .project-card:hover .project-image-todo img,
#projects .project-card:hover .project-image-jokes img {
    transform: scale(1.06);
}

#projects .project-info {
    min-height: 245px;
    padding: 1.35rem 1.4rem 1.4rem;
}

#projects .project-info h3 {
    min-height: 2.1em;
    margin-bottom: .6rem;
}

#projects .project-description {
    min-height: 4.6em;
    margin-bottom: 1rem;
}

#projects .project-tech-list {
    gap: .45rem;
    padding-top: .9rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
}

#projects .project-tech-list::before {
    content: 'Built with';
    flex: 0 0 100%;
    margin-bottom: .15rem;
    color: var(--text-gray);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

body[dir="rtl"] #projects .project-tech-list::before {
    content: 'التقنيات المستخدمة';
    letter-spacing: 0;
    text-align: right;
}

#projects .project-tech-list li {
    padding: .25rem .65rem;
    border-radius: 4px;
    font-size: .72rem;
}

#projects .project-btn:focus-visible,
#projects .project-external-link:focus-visible,
#projects .filter-btn:focus-visible {
    outline: 3px solid rgba(45, 212, 191, 0.65);
    outline-offset: 3px;
}

/* ===== LIGHT MODE COMPREHENSIVE OVERRIDES & HARMONIZATION ===== */
body.light-mode #skills {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%) !important;
}

body.light-mode #skills .section-title,
body.light-mode .subsection-title {
    color: #0f172a !important;
}

body.light-mode .skills-intro,
body.light-mode .tech-section-description {
    color: #334155 !important;
    font-weight: 500 !important;
}

body.light-mode .other-tech-section {
    border-top: 1px solid rgba(148, 163, 184, 0.25) !important;
}

/* 1. Main Skill Cards (Featured Trio: Frontend, UI/UX, Backend) */
body.light-mode .skill-card {
    background: #ffffff !important;
    border: 1px solid rgba(14, 165, 233, 0.22) !important;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode .skill-card:hover {
    background: linear-gradient(145deg, #f0f9ff, #e0f2fe) !important;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 18px 36px -8px rgba(14, 165, 233, 0.22) !important;
    transform: translateY(-8px);
}

body.light-mode .skill-card .skill-title {
    color: #0f172a !important;
    font-weight: 700 !important;
}

body.light-mode .skill-card .skill-description {
    color: #334155 !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
}

body.light-mode .skill-card .skill-icon {
    background: rgba(14, 165, 233, 0.12) !important;
    color: var(--primary-blue) !important;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.1) !important;
}

body.light-mode .skill-card:hover .skill-icon {
    background: var(--primary-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.35) !important;
}

/* 2. Languages & Tools Grid Items */
body.light-mode .tech-icon-item {
    background: #ffffff !important;
    border: 1px solid rgba(14, 165, 233, 0.2) !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
}

body.light-mode .tech-icon-item:hover {
    background: #f0f9ff !important;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 12px 25px rgba(14, 165, 233, 0.18) !important;
    transform: translateY(-6px);
}

body.light-mode .tech-icon-item span {
    color: #0f172a !important;
}

body.light-mode .tech-icon-item:hover span {
    color: var(--primary-blue) !important;
}

/* High-Contrast Colors for Tech Icons in Light Mode */
body.light-mode .tech-c { color: #00599c !important; }
body.light-mode .tech-python { color: #3776ab !important; }
body.light-mode .tech-java { color: #e76f00 !important; }
body.light-mode .tech-flask { color: #0f172a !important; }
body.light-mode .tech-django { color: #092e20 !important; }
body.light-mode .tech-database { color: #0284c7 !important; }
body.light-mode .tech-postgresql { color: #336791 !important; }
body.light-mode .tech-mysql { color: #00758f !important; }
body.light-mode .tech-ds { color: #0284c7 !important; }
body.light-mode .tech-algo { color: #7c3aed !important; }
body.light-mode .tech-git { color: #f05032 !important; }
body.light-mode .tech-cloudflare { color: #ea580c !important; }
body.light-mode .tech-cloud { color: #16a34a !important; }
body.light-mode .tech-icon-item .fa-github { color: #24292e !important; }

/* 3. Project Badges, Overlays, Images & Cards in Light Mode */
body.light-mode .project-image::after {
    display: none !important; /* Removes dark black gradient shadow curtain at the top of card images */
}

body.light-mode #projects .project-image::before {
    display: none !important; /* Eliminates muddy blurred dark halos behind icons/screenshots in light mode */
}

body.light-mode .project-badge,
body.light-mode .featured-project .project-badge {
    background: #0284c7 !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}

body.light-mode .project-external-link {
    background: #ffffff !important;
    color: #0284c7 !important;
    border: 1px solid rgba(14, 165, 233, 0.35) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
}

body.light-mode .project-external-link:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
}

body.light-mode #projects {
    background-color: #f8fafc !important;
}

body.light-mode #projects .project-card {
    background: #ffffff !important;
    border-color: rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode #projects .project-card:hover {
    border-color: var(--primary-blue) !important;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(14, 165, 233, 0.25) !important;
}

body.light-mode #projects .project-image,
body.light-mode #projects .project-image-miead,
body.light-mode #projects .project-image-sentiment,
body.light-mode #projects .project-image-spherex,
body.light-mode #projects .project-image-focusflow,
body.light-mode #projects .project-image-itgs,
body.light-mode #projects .project-image-feedback,
body.light-mode #projects .project-image-todo,
body.light-mode #projects .project-image-jokes,
body.light-mode #projects .project-image-snake {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
}

body.light-mode #projects .project-image img {
    filter: none !important;
}

body.light-mode #projects .project-image-miead img,
body.light-mode #projects .project-image-sentiment img,
body.light-mode #projects .project-image-focusflow img,
body.light-mode #projects .project-image-itgs img {
    border-radius: 14px !important;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12) !important;
}

body.light-mode #projects .project-image-spherex img {
    border-radius: 8px !important;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12) !important;
}

body.light-mode #projects .project-info h3 {
    color: #0f172a !important;
}

body.light-mode .project-description,
body.light-mode #projects .project-description {
    color: #1e293b !important; /* Deep dark slate for maximum legibility */
    font-weight: 500 !important;
}

body.light-mode #projects .project-tech-list li {
    background: #f1f5f9 !important;
    color: #0369a1 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 600 !important;
}

body.light-mode #projects .project-tech-list::before {
    color: #475569 !important;
    font-weight: 700 !important;
}

body.light-mode .project-btn {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(14, 165, 233, 0.35) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05) !important;
    font-weight: 600 !important;
}

body.light-mode .project-btn:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25) !important;
}

body.light-mode .project-btn[href*="t.me"] {
    color: #15803d !important;
    border-color: rgba(22, 163, 74, 0.45) !important;
}

body.light-mode .project-btn[href*="t.me"]:hover {
    background: #15803d !important;
    color: #ffffff !important;
    border-color: #15803d !important;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3) !important;
}

/* 4. Project Filters in Light Mode */
body.light-mode .filter-btn {
    background: #ffffff !important;
    border-color: rgba(14, 165, 233, 0.25) !important;
    color: #475569 !important;
}

body.light-mode .filter-btn.active,
body.light-mode .filter-btn:hover {
    background: var(--primary-blue) !important;
    color: #ffffff !important;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.25) !important;
}

/* 5. Timeline Section in Light Mode */
body.light-mode .timeline-date {
    color: #0f172a !important;
}

body.light-mode .timeline-content {
    background: #ffffff !important;
    border-color: rgba(14, 165, 233, 0.25) !important;
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode .timeline-content h3 {
    color: #0f172a !important;
}

body.light-mode .timeline-content p {
    color: #334155 !important;
    font-weight: 500 !important;
}

body.light-mode .timeline-icon {
    background: #ffffff !important;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 0 0 6px #f8fafc, 0 0 15px rgba(14, 165, 233, 0.2) !important;
}

body.light-mode .timeline-item:hover .timeline-icon {
    background: var(--primary-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 6px #f8fafc, 0 0 20px rgba(14, 165, 233, 0.4) !important;
}

/* 6. Contact Section & Form in Light Mode */
body.light-mode #contact-form {
    background: #ffffff !important;
    border-color: rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode #contact-form label {
    color: #0f172a !important;
}

body.light-mode #contact-form input,
body.light-mode #contact-form textarea {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-mode #contact-form input:focus,
body.light-mode #contact-form textarea:focus {
    background: #ffffff !important;
    border-color: var(--primary-blue) !important;
}

/* 7. Back to Top Button in Light Mode */
body.light-mode .back-to-top {
    background: #ffffff !important;
    color: var(--primary-blue) !important;
    border: 1px solid rgba(14, 165, 233, 0.3) !important;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.1) !important;
}

body.light-mode .back-to-top:hover {
    background: var(--primary-blue) !important;
    color: #ffffff !important;
    border-color: var(--primary-blue) !important;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3) !important;
}

/* 8. Contact Page & Thank You Page in Light Mode */
body.light-mode .contact-page,
body.light-mode .thank-you-page {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%) !important;
}

body.light-mode .contact-header h1,
body.light-mode .thank-you-content h1 {
    color: #0f172a !important;
}

body.light-mode .contact-intro,
body.light-mode .success-message {
    color: #334155 !important;
    font-weight: 500 !important;
}

body.light-mode .contact-info-sidebar {
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode .contact-info-sidebar h3 {
    color: #0f172a !important;
}

body.light-mode .method-info h4 {
    color: #0f172a !important;
    font-weight: 600 !important;
}

body.light-mode .method-info p {
    color: #334155 !important;
    font-weight: 500 !important;
}

body.light-mode .social-links-sidebar h4 {
    color: #0f172a !important;
}

body.light-mode .next-steps {
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode .next-steps h3 {
    color: #0f172a !important;
}

body.light-mode .step-item p {
    color: #334155 !important;
    font-weight: 500 !important;
}

body.light-mode .step-number {
    background: #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3) !important;
}

body.light-mode .direct-contact {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(14, 165, 233, 0.3) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}

body.light-mode .direct-contact:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25) !important;
    transform: translateY(-2px);
}

body.light-mode .emergency-contact p {
    color: #334155 !important;
    font-weight: 500 !important;
}

body.light-mode .simple-footer {
    background: #f1f5f9 !important;
    border-top: 1px solid #e2e8f0 !important;
}

body[dir="rtl"] .back-to-home .fa-arrow-left {
    transform: rotate(180deg);
}