:root {
    --bg: #050505; --accent: #00f2ff; --secondary: #7000ff; --card: #0f0f0f;
    --text: #ffffff; --dim: #a0a0a0; --container: 1200px;
}
.light-theme {
    --bg: #f8f9fa; --accent: #007aff; --secondary: #5856d6; --card: #ffffff;
    --text: #1d1d1f; --dim: #6e6e73;
}

* { margin:0; padding:0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: 'Space Grotesk', sans-serif; transition: 0.3s; line-height: 1.6; overflow-x: hidden; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

#bg-glow { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(0, 242, 255, 0.1) 0%, transparent 50%); z-index: -1; pointer-events: none; }
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--secondary)); z-index: 2000; transition: width 0.1s; }

/* Nav */
nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 5%; position: sticky; top: 0; z-index: 1000; background: rgba(5, 5, 5, 0.8); backdrop-filter: blur(10px); }
.light-theme nav { background: rgba(248, 249, 250, 0.8); }
.nav-right { display: flex; align-items: center; gap: 30px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--dim); font-size: 0.9rem; transition: 0.3s; }
.nav-links a:hover { color: var(--accent); }
#theme-toggle { background: none; border: 1px solid #333; color: var(--text); cursor: pointer; padding: 8px; border-radius: 50%; }
.hire-btn { background: var(--accent); color: #000 !important; padding: 10px 20px; border-radius: 8px; font-weight: 700; text-decoration: none; }

/* Hero */
.hero { padding: 80px 0; }
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 50px; }
.hero-text { flex: 1.2; }
.main-title { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.1; margin: 20px 0; }
.gradient-text { background: linear-gradient(90deg, var(--accent), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { color: var(--dim); max-width: 550px; margin-bottom: 30px; font-size: 1.1rem; }
.hero-actions { display: flex; gap: 15px; }
.primary-btn { background: #fff; color: #000; padding: 15px 30px; border-radius: 10px; text-decoration: none; font-weight: 700; transition: 0.3s; display: flex; align-items: center; gap: 10px; }
.primary-btn:hover { background: var(--accent); transform: translateY(-3px); }
.secondary-btn { border: 1px solid #333; color: var(--text); padding: 15px 30px; border-radius: 10px; text-decoration: none; transition: 0.3s; }

.hero-image-container { flex: 0.8; display: flex; justify-content: flex-end; }
.image-border { border: 1px solid var(--accent); padding: 12px; border-radius: 30px; display: inline-block; background: rgba(0, 242, 255, 0.05); }
.profile-img { width: 100%; max-width: 320px; border-radius: 20px; display: block; filter: grayscale(20%); transition: 0.5s; }
.profile-img:hover { filter: grayscale(0%); }

/* Stats Bar */
.stats-bar { display: flex; justify-content: space-around; padding: 50px 5%; background: rgba(255,255,255,0.02); margin: 40px 0; border-y: 1px solid rgba(255,255,255,0.05); }
.stat-item h3 { font-size: 2.8rem; color: var(--accent); font-weight: 700; }
.stat-item p { color: var(--dim); text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; }

/* About Section Redesign */
.about-section { padding: 80px 0; }
.section-label { text-align: center; margin-bottom: 60px; color: var(--accent); text-transform: uppercase; letter-spacing: 3px; font-size: 0.9rem; }
.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 60px; align-items: center; }
.about-content p { font-size: 1.15rem; line-height: 1.9; color: var(--text); text-align: justify; position: relative; }
.education-card { background: var(--card); padding: 40px; border-radius: 24px; border: 1px solid rgba(0,242,255,0.1); text-align: center; transition: 0.4s; }
.education-card:hover { border-color: var(--accent); box-shadow: 0 0 30px rgba(0,242,255,0.05); }
.education-card i { font-size: 3.5rem; color: var(--accent); margin-bottom: 25px; }
.education-card h3 { margin-bottom: 10px; color: var(--text); }
.education-card p { color: var(--dim); font-size: 0.95rem; }

/* --- Marquee Skills (The Highlight Tool) --- */
.marquee-skills { padding: 40px 0; background: rgba(0,0,0,0.2); overflow: hidden; white-space: nowrap; }
.marquee-content { display: inline-flex; animation: scroll 25s linear infinite; gap: 80px; }
.marquee-content span { 
    font-size: 1.4rem; font-weight: 500; color: rgba(255,255,255,0.15); /* مخفي تقريباً */
    transition: 0.4s; cursor: default; display: flex; align-items: center; gap: 12px;
}
.marquee-content span i { transition: 0.4s; opacity: 0.3; }
.marquee-content span:hover { color: var(--accent); transform: scale(1.1); }
.marquee-content span:hover i { opacity: 1; transform: translateY(-5px); }

@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- Testimonials Bubbles (No Overlap) --- */
.testimonials-section { padding: 100px 0; position: relative; background: radial-gradient(circle at bottom, rgba(0, 242, 255, 0.03) 0%, transparent 70%); }
.bubbles-container { 
    position: relative; height: 650px; width: 100%; margin-top: 40px; 
}
.testi-bubble { 
    position: absolute; background: rgba(255, 255, 255, 0.03); 
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 25px; border-radius: 24px; border: 1px solid rgba(255,255,255,0.08);
    width: 300px; animation: float 6s infinite ease-in-out; transition: 0.3s;
}
.testi-bubble:hover { background: rgba(255, 255, 255, 0.07); border-color: var(--accent); z-index: 100 !important; transform: scale(1.05); }
.testi-bubble p { font-size: 0.95rem; margin-bottom: 12px; line-height: 1.5; font-style: italic; }
.testi-bubble span { color: var(--accent); font-weight: 700; font-size: 0.85rem; display: block; }

/* توزيع مدروس للفقاعات */
.b1 { top: 5%; left: 5%; animation-delay: 0s; }
.b2 { top: 15%; right: 10%; animation-delay: 1s; }
.b3 { top: 40%; left: 15%; animation-delay: 2s; }
.b4 { top: 35%; right: 20%; animation-delay: 3s; }
.b5 { bottom: 10%; left: 10%; animation-delay: 4s; }
.b6 { bottom: 15%; right: 5%; animation-delay: 1.5s; }
.b7 { top: 55%; left: 45%; animation-delay: 2.5s; }
.b8 { bottom: 5%; right: 40%; animation-delay: 0.5s; }

@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-20px) rotate(1deg); } }

/* Projects */
.work-section { padding: 80px 0; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; }
.project-card { background: var(--card); padding: 35px; border-radius: 24px; border: 1px solid #1a1a1a; transition: 0.4s; position: relative; overflow: hidden; }
.project-card::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(45deg, transparent, rgba(0,242,255,0.03)); opacity: 0; transition: 0.3s; }
.project-card:hover { border-color: var(--accent); transform: translateY(-10px); }
.project-card:hover::after { opacity: 1; }
.project-card h3 { margin-bottom: 15px; font-size: 1.3rem; }
.project-card p { color: var(--dim); margin-bottom: 20px; font-size: 0.95rem; }
.project-card span { background: rgba(112, 0, 255, 0.1); color: var(--secondary); padding: 5px 12px; border-radius: 6px; font-size: 0.75rem; letter-spacing: 1px; }

/* Contact & Footer */
.cta-box { background: var(--card); padding: 60px; border-radius: 40px; border: 1px solid #1a1a1a; text-align: center; max-width: 900px; margin: 0 auto; }
.submit-btn { background: var(--accent); color: #000; padding: 18px; border-radius: 15px; border: none; font-weight: 700; cursor: pointer; transition: 0.3s; width: 100%; font-size: 1.1rem; }
.floating-cta { position: fixed; bottom: 30px; right: 30px; background: #25d366; color: #fff; padding: 15px 25px; border-radius: 50px; text-decoration: none; z-index: 1500; display: flex; align-items: center; gap: 10px; font-weight: 700; box-shadow: 0 10px 20px rgba(37,211,102,0.3); }

@media (max-width: 992px) {
    .about-grid { grid-template-columns: 1fr; }
    .bubbles-container { height: auto; display: flex; flex-direction: column; gap: 20px; }
    .testi-bubble { position: static; width: 100%; animation: none; }
    .hero-inner { flex-direction: column-reverse; text-align: center; }
    .hero-desc { margin: 0 auto 30px; }
    .hero-actions { justify-content: center; }
}
/* --- إصلاح قسم التواصل (Contact Fix) --- */
.contact-section { padding: 100px 0; }

.cta-box { 
    background: var(--card); 
    padding: 60px; 
    border-radius: 40px; 
    border: 1px solid rgba(255,255,255,0.05); 
    text-align: center; 
    max-width: 800px; 
    margin: 0 auto; 
}

.section-title { font-size: 2.5rem; margin-bottom: 30px; color: var(--text); }

#user-msg { 
    width: 100%; 
    height: 150px; 
    background: rgba(0,0,0,0.3) !important; /* خلفية داكنة واضحة */
    border: 1px solid #333; 
    border-radius: 15px; 
    color: #fff; 
    padding: 20px; 
    margin-bottom: 20px;
    resize: none; 
    font-family: inherit;
    font-size: 1rem;
}

.light-theme #user-msg { 
    background: #fff !important; 
    color: #000; 
    border: 1px solid #ddd; 
}

.submit-btn { 
    background: var(--accent); 
    color: #000; 
    padding: 18px 40px; 
    border-radius: 12px; 
    border: none; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.3s; 
    width: 100%;
    font-size: 1.1rem;
}

/* --- إصلاح الفوتر والأيقونات (Footer Fix) --- */
footer { padding: 60px 0; text-align: center; border-top: 1px solid rgba(255,255,255,0.05); }

.social-links { 
    margin-top: 25px; 
    display: flex; 
    justify-content: center; 
    gap: 25px; 
}

.social-links a { 
    color: var(--dim); /* اللون الرمادي الهادي */
    font-size: 1.5rem; 
    transition: 0.3s ease; 
}

.social-links a:hover { 
    color: var(--accent); /* يقلب لبني لما تقف عليه */
    transform: translateY(-5px); 
}

.light-theme .social-links a { color: #555; }
.light-theme .social-links a:hover { color: var(--accent); }
