/* ----------------------------------------------------
   DESIGN SYSTEM & VARIABLES
   Futuristic, Ultra-Clean Obsidian/Teal Theme
   ---------------------------------------------------- */
:root {
    --font-en: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-ar: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Theme: Obsidian & Green Glow (KFUPM theme) */
    --bg-base: #030712;
    --bg-surface: rgba(17, 24, 39, 0.55);
    --bg-card: rgba(31, 41, 55, 0.3);
    
    --border-color: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(16, 185, 129, 0.2);
    
    --text-primary: #ffffff;      /* Maximum white for readability */
    --text-secondary: #e5e7eb;    /* Bright slate-gray for text blocks */
    --text-muted: #9ca3af;        /* Muted elements are clearer */
    
    --primary: #6366f1; /* Vibrant Indigo */
    --primary-glow: rgba(99, 102, 241, 0.35);
    --secondary: #06b6d4; /* Neon Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.35);
    
    /* Domain Specific Colors */
    --uav: #f43f5e; /* Rose */
    --uav-glow: rgba(244, 63, 94, 0.25);
    --robotics: #3b82f6; /* Blue */
    --robotics-glow: rgba(59, 130, 246, 0.25);
    --control: #10b981; /* Emerald */
    --control-glow: rgba(16, 185, 129, 0.25);
    
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
    --glass-blur: blur(20px);
}

[data-theme="light"] {
    --bg-base: #cbd5e1;
    --bg-surface: rgba(226, 232, 240, 0.85);
    --bg-card: rgba(241, 245, 249, 0.9);
    
    --border-color: rgba(15, 23, 42, 0.12);
    --border-glow: rgba(5, 150, 105, 0.25);
    
    --text-primary: #090d16;      /* High-contrast obsidian */
    --text-secondary: #1e293b;    /* High-contrast slate-800 for descriptions */
    --text-muted: #334155;        /* Legible slate-700 */
    
    --primary: #059669;
    --primary-glow: rgba(5, 150, 105, 0.2);
    --secondary: #0891b2;
    --secondary-glow: rgba(8, 145, 178, 0.2);
    
    --card-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                color 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-base);
    scroll-padding-top: 90px; /* Offset for the sticky navigation bar */
}

html[lang="en"] {
    font-family: var(--font-en);
}

html[lang="ar"] {
    font-family: var(--font-ar);
    direction: rtl;
}

body {
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.75;
    background: var(--bg-base);
}

html[lang="ar"] body {
    line-height: 1.85; /* Increase height for Cairo Arabic font */
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.25s ease;
}

a:hover {
    color: var(--secondary);
}

main {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 90px - 120px); /* Sticky footer layout: viewport minus navbar and footer */
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ----------------------------------------------------
   LANGUAGE DISPLAY LOGIC
   ---------------------------------------------------- */
html[lang="en"] [lang="ar"] {
    display: none !important;
}

html[lang="ar"] [lang="en"] {
    display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glowing Background Blur Effects */
.bg-glow {
    position: absolute;
    width: 60vw;
    height: 60vw;
    max-width: 800px;
    border-radius: 50%;
    filter: blur(160px);
    z-index: -10;
    pointer-events: none;
    opacity: 0.12;
}

.bg-glow-1 {
    top: -100px;
    left: -200px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.bg-glow-2 {
    top: 600px;
    right: -200px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
}

/* ----------------------------------------------------
   TYPOGRAPHY & UTILITIES
   ---------------------------------------------------- */
.section-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 100px; /* Optimized paddings to prevent empty vertical space */
}

.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 50px;
    position: relative;
    display: inline-block;
    color: var(--text-primary);
}

html[lang="ar"] .section-title {
    letter-spacing: 0;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    bottom: -10px;
    border-radius: 99px;
}

html[lang="en"] .section-title::after { left: 0; }
html[lang="ar"] .section-title::after { right: 0; }

.section-desc {
    color: var(--text-secondary);
    max-width: 640px;
    margin: -20px auto 50px;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.7;
}

.text-center {
    text-align: center;
    width: 100%;
}

.text-center::after {
    left: 50% !important;
    transform: translateX(-50%);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 20%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glassmorphism Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--card-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-glow);
    box-shadow: 0 20px 40px -10px var(--primary-glow);
}

/* ----------------------------------------------------
   BUTTONS
   ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #059669);
    color: #ffffff;
    box-shadow: 0 4px 20px 0 var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px 0 var(--primary-glow);
    filter: brightness(1.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-secondary);
}

.btn-warning {
    background: var(--warning);
    color: #030712;
    font-weight: 700;
}

.btn-warning:hover {
    box-shadow: 0 8px 25px 0 rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 18px;
    font-size: 0.85rem;
}

.btn-outline:hover {
    background: var(--primary);
    color: #ffffff;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 10px;
}

.btn-xs {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* ----------------------------------------------------
   NAVIGATION BAR
   ---------------------------------------------------- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .navbar {
    background: rgba(248, 250, 252, 0.75);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

/* Feedback Loop Icon */
.logo-feedback-loop {
    width: 24px;
    height: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer circular loop representing feedback path */
.logo-feedback-loop::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(16, 185, 129, 0.4); /* Emerald feedback path */
    border-radius: 50%;
    border-top-color: transparent; /* Opening to make it look like a flow loop */
    animation: rotateLoop 3s linear infinite;
}

/* Pulse node representing Process/Summation node in the loop */
.loop-node {
    width: 8px;
    height: 8px;
    background: var(--primary); /* Glowing center node */
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    animation: pulseNode 2s infinite ease-in-out;
}

@keyframes rotateLoop {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseNode {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

/* Logo Text styling */
.logo-text {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    font-weight: 800;
}

.logo-first {
    color: var(--text-primary);
    font-weight: 300;
}

.logo-last {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
    font-weight: 800;
    transition: all 0.25s ease;
}

/* Hover effects */
.logo:hover .logo-feedback-loop::before {
    border-color: rgba(16, 185, 129, 0.8);
    animation-duration: 1.2s; /* Faster rotation showing dynamic speed */
}

.logo:hover .logo-last {
    color: var(--text-primary);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.nav-menu {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.25s ease;
    padding: 6px 0;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.25s ease, left 0.25s ease, right 0.25s ease;
}

html[lang="en"] .nav-link::after { left: 0; }
html[lang="ar"] .nav-link::after { right: 0; }

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    width: 100%;
}

.btn-contact-nav {
    border: 1px solid var(--primary);
    padding: 8px 20px;
    border-radius: 99px;
    color: var(--primary) !important;
}

.btn-contact-nav:hover {
    background: var(--primary);
    color: #ffffff !important;
}

.btn-contact-nav::after {
    display: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 7px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.8rem;
}

.lang-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.3rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* ----------------------------------------------------
   HERO SECTION
   ---------------------------------------------------- */
.hero-section {
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 160px 24px 80px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.06);
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 28px;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.hero-title-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
}

html[lang="ar"] .hero-title {
    letter-spacing: 0;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 28px;
    height: 48px;
}

html[lang="ar"] .hero-subtitle {
    font-size: 1.7rem;
}

.typewriter-text {
    border-right: 2px solid var(--primary);
    padding-right: 6px;
    animation: blink-cursor 0.75s step-end infinite;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.15rem;
    margin-bottom: 44px;
    max-width: 540px;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.hero-graphic {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
}

.glowing-orb {
    position: absolute;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(15px);
    animation: pulse 8s infinite ease-in-out;
}

.hero-image-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 0 !important;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    display: flex;
    z-index: 2;
}

.hero-drone-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-image-card:hover .hero-drone-img {
    transform: scale(1.06);
}

/* ----------------------------------------------------
   ABOUT & EDUCATION
   ---------------------------------------------------- */
.about-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 48px;
    align-items: start;
}

.profile-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-quick-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
}

.info-item i {
    width: 24px;
    color: var(--primary);
    font-size: 1.15rem;
    text-align: center;
    flex-shrink: 0;
}

.info-item a {
    color: var(--text-secondary);
    transition: color 0.25s ease;
    text-decoration: none;
}

.info-item a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.info-item span {
    color: var(--text-secondary);
}

.profile-image-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid var(--primary);
    box-shadow: 0 0 16px var(--primary-glow);
    margin-bottom: 8px;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.about-text {
    color: var(--text-secondary);
    line-height: 1.8;
}

.contact-quick-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.info-item i {
    color: var(--primary);
    font-size: 1.1rem;
    width: 18px;
    text-align: center;
}

.education-timeline {
    position: relative;
    padding-left: 24px;
}

html[lang="ar"] .education-timeline {
    padding-left: 0;
    padding-right: 24px;
}

.education-timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

html[lang="en"] .education-timeline::before { left: 4px; }
html[lang="ar"] .education-timeline::before { right: 4px; }

.timeline-item {
    position: relative;
}

.timeline-marker {
    position: absolute;
    top: 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 2px solid var(--primary);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    z-index: 2;
}

html[lang="en"] .timeline-marker { left: -33px; }
html[lang="ar"] .timeline-marker { right: -33px; }

.timeline-content {
    padding: 28px !important;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 10px;
}

.education-degree {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.4;
}

.education-school {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
}

.education-location {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.gpa-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.08);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* ----------------------------------------------------
   WORK EXPERIENCE
   ---------------------------------------------------- */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.experience-card {
    border-left: 4px solid var(--primary) !important;
}

html[lang="ar"] .experience-card {
    border-left: none !important;
    border-right: 4px solid var(--primary) !important;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.exp-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.exp-company {
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 4px;
}

.exp-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

html[lang="ar"] .exp-meta {
    text-align: left;
    align-items: flex-start;
}

.exp-date {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.exp-loc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.exp-details {
    padding-left: 20px;
}

html[lang="ar"] .exp-details {
    padding-left: 0;
    padding-right: 20px;
}

.exp-details li {
    list-style-type: square;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.exp-details li:last-child {
    margin-bottom: 0;
}

/* ----------------------------------------------------
   PID SIMULATOR
   ---------------------------------------------------- */
.simulator-section {
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.02) 0%, transparent 80%);
}

.simulator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch;
}

.simulator-visual-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #030712 !important;
    position: relative;
    min-height: 400px;
    border-color: var(--secondary-glow) !important;
}

.simulator-tag {
    position: absolute;
    top: 18px;
    left: 18px;
    background: rgba(6, 182, 212, 0.08);
    color: var(--secondary);
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

html[lang="ar"] .simulator-tag {
    left: auto;
    right: 18px;
}

#pid-canvas {
    width: 100%;
    max-width: 400px;
    height: 300px;
}

#apply-disturbance {
    margin-top: 16px;
}

.simulator-controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}

.control-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.slider-num {
    color: var(--primary);
    font-family: monospace;
    font-size: 1rem;
    font-weight: 700;
}

/* Custom Slider Track and Thumb Styles */
.control-row input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    height: 6px;
    border-radius: 99px;
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.slider-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sim-preset-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* ----------------------------------------------------
   PROJECTS
   ---------------------------------------------------- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.spotlight-card {
    border: 2.5px solid var(--primary) !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(17, 24, 39, 0.6) 100%) !important;
}

.project-card:has(.uav-color):hover {
    border-color: var(--uav) !important;
    box-shadow: 0 20px 40px -10px var(--uav-glow) !important;
}

.project-card:has(.robotics-color):hover {
    border-color: var(--robotics) !important;
    box-shadow: 0 20px 40px -10px var(--robotics-glow) !important;
}

.project-card:has(.control-color):hover {
    border-color: var(--control) !important;
    box-shadow: 0 20px 40px -10px var(--control-glow) !important;
}

.award-ribbon {
    position: absolute;
    top: 20px;
    right: -10px;
    background: var(--warning);
    color: #030712;
    padding: 6px 24px;
    font-weight: 800;
    font-size: 0.75rem;
    transform: rotate(15deg);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 2;
}

html[lang="ar"] .award-ribbon {
    right: auto;
    left: -10px;
    transform: rotate(-15deg);
}

.project-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}

.uav-color { background: rgba(245, 158, 11, 0.08); color: var(--warning); }
.robotics-color { background: rgba(6, 182, 212, 0.08); color: var(--secondary); }
.control-color { background: rgba(16, 185, 129, 0.08); color: var(--primary); }

.project-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--text-primary);
}

.project-card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

.project-card-desc strong {
    color: var(--text-primary);
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.tag {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 5px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 600;
}

.tag-uav { background: rgba(245, 158, 11, 0.1); color: var(--warning); border-color: rgba(245, 158, 11, 0.2); }
.tag-control { background: rgba(16, 185, 129, 0.1); color: var(--primary); border-color: rgba(16, 185, 129, 0.2); }
.tag-robotics { background: rgba(6, 182, 212, 0.1); color: var(--secondary); border-color: rgba(6, 182, 212, 0.2); }

/* ----------------------------------------------------
   TECHNICAL SKILLS
   ---------------------------------------------------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.skill-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.category-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.coding-color { background: rgba(99, 102, 241, 0.08); color: #818cf8; }

.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.skill-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill-list li {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ----------------------------------------------------
   CREDENTIALS & LEADERSHIP
   ---------------------------------------------------- */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.split-col {
    display: flex;
    flex-direction: column;
}

.certifications-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cert-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px !important;
}

.cert-icon {
    font-size: 1.25rem;
    color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.cert-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cert-authority {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.leadership-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.leadership-card {
    border-left: 2px dashed var(--border-color) !important;
    padding-left: 24px !important;
}

html[lang="ar"] .leadership-card {
    border-left: none !important;
    border-right: 2px dashed var(--border-color) !important;
    padding-left: 0 !important;
    padding-right: 24px !important;
}

.lead-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.lead-role {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.05rem;
}

.lead-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.lead-org {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ----------------------------------------------------
   CONTACT SECTION
   ---------------------------------------------------- */
.contact-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 48px;
}

.contact-info-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card-detailed {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px !important;
}

.icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.info-card-detailed h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.contact-link {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.contact-link:hover {
    color: var(--primary);
}

.contact-txt {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input, .input-group textarea {
    background: rgba(3, 7, 18, 0.3);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    width: 100%;
}

.input-group input:focus, .input-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-status-message {
    font-size: 0.9rem;
    font-weight: 600;
    display: none;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.form-status-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.08);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.form-status-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ----------------------------------------------------
   FOOTER
   ---------------------------------------------------- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 48px 24px;
    background: #02040a;
}

[data-theme="light"] footer {
    background: #f1f5f9;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-container p {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.footer-socials {
    display: flex;
    gap: 20px;
}

.footer-socials a {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

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

/* ----------------------------------------------------
   KEYFRAMES & ANIMATIONS
   ---------------------------------------------------- */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.12; }
    50% { transform: scale(1.15); opacity: 0.22; }
}

@keyframes blink-cursor {
    from, to { border-color: transparent }
    50% { border-color: var(--primary); }
}

.animate-glow {
    animation: pulse-glow 4s infinite alternate ease-in-out;
}

@keyframes pulse-glow {
    0% { border-color: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }
    100% { border-color: var(--secondary); box-shadow: 0 0 24px var(--secondary-glow); }
}

/* ----------------------------------------------------
   RESPONSIVE DESIGN
   ---------------------------------------------------- */
@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 130px;
        gap: 50px;
    }
    
    .hero-content {
        align-items: center;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .hero-desc {
        max-width: 600px;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .split-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .contact-layout {
        grid-template-columns: 1fr;
    }
    
    .simulator-layout {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 75px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 75px);
        background: var(--bg-base);
        flex-direction: column;
        align-items: center;
        padding: 60px 24px;
        transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 99;
        box-shadow: var(--card-shadow);
        border-top: 1px solid var(--border-color);
    }
    
    .nav-menu.active {
        left: 0;
    }
}

@media (max-width: 580px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

/* ----------------------------------------------------
   LIGHTBOX MODAL FOR CERTIFICATES
   ---------------------------------------------------- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 7, 18, 0.95); /* Very dark obsidian backdrop */
    backdrop-filter: blur(12px);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 85%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    object-fit: contain;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--text-primary);
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.lightbox-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.15);
}

#lightbox-caption {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    max-width: 80%;
}

/* RTL adjustment for Close Button position */
html[lang="ar"] .lightbox-close {
    right: auto;
    left: 40px;
}

/* Button to trigger certificates */
.btn-view-cert {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 12px;
    text-decoration: none;
}

.btn-view-cert:hover {
    background: var(--primary);
    color: #030712 !important;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-view-cert i {
    font-size: 0.8rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
    
    html[lang="ar"] .lightbox-close {
        left: 20px;
        right: auto;
    }
    
    .lightbox-content {
        max-width: 92%;
        max-height: 70vh;
    }
}

/* ----------------------------------------------------
   QUICK STATS / DASHBOARD SECTION
   ---------------------------------------------------- */
.dashboard-section {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
    margin-top: -30px;
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.dashboard-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px !important;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.15);
}

/* Hover effects for specific categories */
.dashboard-card:nth-child(1):hover { border-color: #10b981 !important; }
.dashboard-card:nth-child(2):hover { border-color: #3b82f6 !important; }
.dashboard-card:nth-child(3):hover { border-color: #ec4899 !important; }
.dashboard-card:nth-child(4):hover { border-color: #8b5cf6 !important; }

.dash-icon {
    font-size: 1.4rem;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-card:hover .dash-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border-color: rgba(16, 185, 129, 0.2);
}

.dashboard-card:nth-child(1):hover .dash-icon { color: #10b981; background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); }
.dashboard-card:nth-child(2):hover .dash-icon { color: #3b82f6; background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); }
.dashboard-card:nth-child(3):hover .dash-icon { color: #ec4899; background: rgba(236, 72, 153, 0.1); border-color: rgba(236, 72, 153, 0.2); }
.dashboard-card:nth-child(4):hover .dash-icon { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.2); }

.dash-info {
    display: flex;
    flex-direction: column;
}

.dash-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    font-family: 'Outfit', sans-serif;
}

.dash-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}

.dash-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .dashboard-section {
        margin-top: 0;
        margin-bottom: 20px;
    }
}

@media (max-width: 580px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .dashboard-card {
        padding: 16px 20px !important;
    }
}

/* ----------------------------------------------------
   ATTACHED CERTIFICATES & PREVIEWS
   ---------------------------------------------------- */
.attached-cert-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.cert-row-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.cert-row-label i {
    color: var(--primary);
}

.btn-view-cert {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--primary);
    background: rgba(99, 102, 241, 0.05); /* Very light primary tint */
    color: var(--primary) !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-view-cert:hover {
    background: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 6px 16px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-view-cert i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.btn-view-cert:hover i {
    transform: scale(1.1);
}

/* Light mode specific style overrides */
[data-theme="light"] .btn-view-cert {
    background: rgba(5, 150, 105, 0.04);
    border-color: var(--primary);
    color: var(--primary) !important;
}

[data-theme="light"] .btn-view-cert:hover {
    background: var(--primary);
    color: #ffffff !important;
}

/* ----------------------------------------------------
   SCROLL PROGRESS BAR
   ---------------------------------------------------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9999;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: width 0.1s ease-out;
}

html[lang="ar"] .scroll-progress {
    left: auto;
    right: 0;
}

/* ----------------------------------------------------
   BACK TO TOP BUTTON
   ---------------------------------------------------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--card-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 24px var(--primary-glow);
}

/* Reverse placement for RTL Arabic layouts */
html[lang="ar"] .back-to-top {
    right: auto;
    left: 30px;
}

/* ----------------------------------------------------
   SCROLL REVEAL ANIMATIONS
   ---------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ----------------------------------------------------
   READABILITY & LINE LENGTH LIMITS
   ---------------------------------------------------- */
.hero-desc {
    max-width: 700px;
    margin-top: 15px;
    margin-bottom: 35px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.about-text {
    max-width: 650px;
    color: var(--text-secondary);
}

/* Ensure timeline content text is highly readable */
.timeline-content p {
    color: var(--text-secondary);
}

.exp-details li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Lightbox Modal Tweaks */
.lightbox {
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ----------------------------------------------------
   PAGE ROUTING SYSTEM (Separated Pages)
   ---------------------------------------------------- */
.hidden-page {
    display: none !important;
}

.page-transition {
    animation: pageFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: opacity, transform;
}

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


