/* ====== VARIABLE THEMES ====== */
:root {
  --font-primary: 'Inter', 'Segoe UI', sans-serif;
  --bg-main: #0b0f19;
  --bg-navbar: rgba(11, 15, 25, 0.85);
  --bg-card: #151b2c;
  --border-color: rgba(255, 255, 255, 0.06);
  --accent-color: #00e5ff;
  --accent-hover: #00b4cc;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-navbar: rgba(248, 250, 252, 0.85);
  --bg-card: #ffffff;
  --border-color: rgba(0, 0, 0, 0.06);
  --accent-color: #0284c7;
  --accent-hover: #0369a1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

[dir="ar"] { --font-primary: 'Cairo', sans-serif; }

/* ====== GENERAL RESET ====== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-primary); }
body { background-color: var(--bg-main); color: var(--text-main); transition: background-color 0.4s, color 0.4s; overflow-x: hidden; line-height: 1.6; }
html { scroll-behavior: smooth; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.section { padding: 120px 0 60px; }

/* ====== NAVBAR ====== */
.navbar { position: fixed; top: 0; left: 0; width: 100%; background: var(--bg-navbar); backdrop-filter: blur(12px); z-index: 1000; border-bottom: 1px solid var(--border-color); padding: 18px 0; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.4rem; font-weight: 700; color: var(--text-main); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-menu { display: flex; gap: 4px; }
.nav-link { color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; padding: 8px 14px; border-radius: 8px; transition: 0.2s; }
.nav-link:hover, .nav-link.active { color: var(--text-main); background: var(--border-color); }
.nav-controls { display: flex; align-items: center; gap: 10px; }
.control-btn { background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-main); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.control-btn:hover { border-color: var(--accent-color); color: var(--accent-color); }
.menu-toggle { display: none; background: transparent; border: none; color: var(--text-main); font-size: 1.2rem; cursor: pointer; }

/* ====== HERO SECTION ====== */
.hero { min-height: 90vh; display: flex; align-items: center; padding-top: 80px; }
.hero-container { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 64px; align-items: center; }
.greeting { font-size: 0.95rem; color: var(--accent-color); letter-spacing: 2px; font-weight: 600; display: block; margin-bottom: 8px; }
.hero-title { font-size: 3.4rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.highlight { color: var(--accent-color); }
.typing-container { font-size: 1.5rem; font-weight: 500; margin-bottom: 16px; }
.hero-subtitle { color: var(--text-muted); margin-bottom: 32px; max-width: 540px; }
.hero-buttons { display: flex; gap: 16px; margin-bottom: 32px; }
.btn-primary { background: var(--accent-color); color: #000 !important; padding: 12px 24px; border-radius: 10px; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-secondary { border: 1px solid var(--border-color); color: var(--text-main); padding: 12px 24px; border-radius: 10px; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.btn-secondary:hover { background: var(--border-color); }
.social-links { display: flex; gap: 12px; }
.social-link { width: 42px; height: 42px; border-radius: 10px; background: var(--bg-card); color: var(--text-muted); display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 1.3rem; border: 1px solid var(--border-color); transition: 0.2s; }
.social-link:hover { color: var(--accent-color); border-color: var(--accent-color); transform: translateY(-2px); }
.profile-img { width: 100%; max-width: 340px; aspect-ratio: 1; object-fit: cover; border-radius: 24px; border: 1px solid var(--border-color); box-shadow: var(--card-shadow); }

/* ====== GENERAL HEADERS ====== */
.section-header { text-align: center; margin-bottom: 56px; }
.section-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 8px; }
.section-subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* ====== ABOUT ====== */
.about-container { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: center; }
.about-img { width: 100%; border-radius: 24px; border: 1px solid var(--border-color); }
.about-content { display: flex; flex-direction: column; gap: 24px; }
.about-description { font-size: 1.05rem; color: var(--text-muted); text-align: justify; }
.info-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.info-card-mini { background: var(--bg-card); border: 1px solid var(--border-color); padding: 18px; border-radius: 16px; display: flex; align-items: center; gap: 16px; }
.info-card-mini i { font-size: 1.5rem; color: var(--accent-color); }
.info-card-mini h4 { font-size: 1rem; margin-bottom: 4px; }
.info-card-mini p { font-size: 0.9rem; color: var(--text-muted); }

/* ====== SKILLS ====== */
.skills-modern-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.skill-modern-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 24px; padding: 32px; box-shadow: var(--card-shadow); }
.card-icon-header { width: 44px; height: 44px; background: var(--border-color); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--accent-color); font-size: 1.2rem; margin-bottom: 18px; }
.skill-modern-card h3 { font-size: 1.2rem; margin-bottom: 20px; }
.skill-per-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.skill-per-list li { display: flex; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); font-size: 0.95rem; }
.skill-per-list .per { color: var(--accent-color); font-weight: 600; }

/* ====== TIMELINE (EXPERIENCE) ====== */
.modern-timeline { max-width: 800px; margin: 0 auto; border-left: 2px solid var(--border-color); padding-left: 32px; position: relative; }
[dir="ar"] .modern-timeline { border-left: none; border-right: 2px solid var(--border-color); padding-left: 0; padding-right: 32px; }
.m-timeline-item { position: relative; margin-bottom: 48px; }
.m-timeline-item::before { content: ''; position: absolute; left: -41px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg-main); border: 3px solid var(--text-muted); }
.m-timeline-item.current::before { border-color: #10b981; }
[dir="ar"] .m-timeline-item::before { left: auto; right: -41px; }
.m-timeline-time { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.m-timeline-item.current .m-timeline-time { color: #10b981; }
.m-timeline-content { background: var(--bg-card); border: 1px solid var(--border-color); padding: 28px; border-radius: 20px; box-shadow: var(--card-shadow); position: relative; }
.status-badge { position: absolute; top: 24px; right: 24px; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; text-transform: uppercase; }
[dir="ar"] .status-badge { left: 24px; right: auto; }
.status-badge.busy { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.status-badge.completed { background: var(--border-color); color: var(--text-muted); }
.m-timeline-content h3 { font-size: 1.25rem; margin-bottom: 4px; padding-right: 70px; }
[dir="ar"] .m-timeline-content h3 { padding-right: 0; padding-left: 70px; }
.m-timeline-content h4 { font-size: 1rem; color: var(--accent-color); font-weight: 500; margin-bottom: 12px; }
.m-timeline-content p { font-size: 0.95rem; color: var(--text-muted); }
.forum-p { line-height: 1.8; }

/* ====== CERTIFICATES SECTIONS ====== */
.certificates-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.cert-card { background: var(--bg-card); border: 1px solid var(--border-color); padding: 24px; border-radius: 16px; box-shadow: var(--card-shadow); transition: transform 0.2s; }
.cert-card:hover { transform: translateY(-4px); border-color: var(--accent-color); }
.cert-icon { font-size: 1.6rem; color: var(--accent-color); margin-bottom: 14px; }
.cert-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.cert-card p { font-size: 0.85rem; color: var(--text-muted); }

/* ====== CONTACT ====== */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 32px; }
.contact-methods { display: flex; flex-direction: column; gap: 16px; }
.c-method-card { background: var(--bg-card); border: 1px solid var(--border-color); padding: 20px; border-radius: 16px; display: flex; align-items: center; gap: 16px; }
.c-method-card i { font-size: 1.4rem; color: var(--accent-color); }
.c-method-card h4 { font-size: 0.95rem; margin-bottom: 2px; }
.c-method-card a, .c-method-card p { font-size: 0.9rem; color: var(--text-muted); text-decoration: none; }
.contact-quick { background: var(--bg-card); border: 1px solid var(--border-color); padding: 28px; border-radius: 20px; }
.contact-quick h3 { font-size: 1.15rem; margin-bottom: 20px; }
.social-buttons-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.s-btn { padding: 12px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 0.9rem; text-align: center; color: #fff !important; display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity 0.2s; }
.s-btn:hover { opacity: 0.85; }
.whatsapp-color { background: #25d366; }
.github-color { background: #24292e; }
.instagram-color { background: #e1306c; }
.facebook-color { background: #1877f2; }
.snapchat-color { background: #fffc00; color: #000 !important; }

/* ====== FOOTER ====== */
.footer { border-top: 1px solid var(--border-color); padding: 32px 0; text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-top: 40px; }
.back-to-top { position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 10px; background: var(--accent-color); color: #000 !important; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: 0.2s; z-index: 99; }
.back-to-top.visible { opacity: 1; visibility: visible; }

/* ====== RESPONSIVE ====== */
@media (max-width: 992px) {
  .hero-container, .about-container, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-image { order: -1; display: flex; justify-content: center; }
  .profile-img { max-width: 260px; }
  .hero-title { font-size: 2.6rem; }
}
@media (max-width: 768px) {
  .nav-menu { position: fixed; top: 73px; left: -100%; width: 100%; background: var(--bg-card); flex-direction: column; padding: 24px; border-bottom: 1px solid var(--border-color); transition: 0.3s; }
  .nav-menu.active { left: 0; }
  [dir="ar"] .nav-menu { left: auto; right: -100%; }
  [dir="ar"] .nav-menu.active { right: 0; }
  .menu-toggle { display: flex; }
}