:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a25;
  --accent: #00e5ff;
  --accent2: #7c3aed;
  --accent3: #f59e0b;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --border: #2a2a3a;
  --glow: 0 0 30px rgba(0,229,255,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Lang Toggle */
.lang-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
}
.lang-btn.active {
  background: var(--accent);
  color: #000;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent2); border-radius: 2px; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; right: 0;
  width: 260px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  z-index: 100;
  overflow-y: auto;
}

.profile-ring {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent2), var(--accent3), var(--accent));
  padding: 3px;
  margin-bottom: 16px;
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.profile-ring img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
}

.sidebar-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  text-align: center;
}
.sidebar-title {
  font-size: 12px;
  color: var(--accent);
  text-align: center;
  margin-top: 4px;
  letter-spacing: 1px;
  font-family: 'Space Mono', monospace;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  color: var(--accent);
  margin: 14px 0;
  font-family: 'Space Mono', monospace;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.sidebar-nav {
  width: 100%;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(0,229,255,0.08);
  color: var(--accent);
}
.nav-link i { width: 18px; font-size: 13px; }

.sidebar-social {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.sidebar-social a {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 14px;
}
.sidebar-social a:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* Main */
.main-content {
  margin-right: 260px;
  min-height: 100vh;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 60px 60px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 50%, rgba(0,229,255,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 70% 30%, rgba(124,58,237,0.05) 0%, transparent 70%);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.15);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 12px;
  color: var(--accent);
  font-family: 'Space Mono', monospace;
  margin-bottom: 24px;
  letter-spacing: 1px;
}
.hero h1 {
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  color: var(--text);
}
.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 20px 0 36px;
  max-width: 500px;
}
.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 12px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: #00b8cc; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,229,255,0.25); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Floating cards */
.floating-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  animation: float 4s ease-in-out infinite;
}
.floating-card:nth-child(1) { top: 20%; right: 5%; animation-delay: 0s; }
.floating-card:nth-child(2) { bottom: 25%; right: 8%; animation-delay: 2s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.floating-card .card-label { font-size: 10px; color: var(--text-muted); font-family: 'Space Mono', monospace; }
.floating-card .card-value { font-size: 22px; font-weight: 900; color: var(--accent); margin-top: 2px; }

/* Sections */
.section {
  padding: 80px 60px;
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 50px;
}
.section-eyebrow {
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-title {
  font-size: 36px;
  font-weight: 900;
  color: var(--text);
}
.section-line {
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  margin-top: 12px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-text p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 2;
  margin-bottom: 16px;
}
.about-text strong { color: var(--text); }
.about-text .highlight { color: var(--accent); }

.info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}
.info-card:hover {
  border-color: var(--accent);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}
.info-card i { color: var(--accent); font-size: 18px; margin-bottom: 8px; }
.info-card .label { font-size: 11px; color: var(--text-muted); font-family: 'Space Mono', monospace; }
.info-card .value { font-size: 14px; font-weight: 700; margin-top: 2px; }

/* Experience */
.timeline { position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--accent), var(--accent2), transparent);
  opacity: 0.3;
}
.timeline-item {
  position: relative;
  padding-right: 36px;
  padding-bottom: 44px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  right: -5px; top: 6px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 12px rgba(0,229,255,0.5);
}
.timeline-date {
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.timeline-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  transition: all 0.2s;
}
.timeline-card:hover {
  border-color: rgba(0,229,255,0.3);
  box-shadow: var(--glow);
}
.timeline-card h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
}
.timeline-company {
  font-size: 12px;
  color: var(--accent2);
  font-family: 'Space Mono', monospace;
  font-weight: 700;
}
.timeline-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-top: 10px;
}
.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.tag {
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.12);
  color: var(--accent);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: 'Space Mono', monospace;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.skill-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.3s;
  cursor: default;
}
.skill-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,229,255,0.12);
}
.skill-card i {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}
.skill-card span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.skill-level {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 1s ease;
}

/* Portfolio */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.portfolio-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s;
}
.portfolio-item:hover {
  border-color: rgba(0,229,255,0.3);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.portfolio-img {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.portfolio-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.portfolio-item:hover .portfolio-img img { transform: scale(1.05); }
.portfolio-body {
  padding: 18px 20px;
}
.portfolio-body h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
}
.portfolio-body p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.portfolio-links {
  display: flex;
  gap: 8px;
}
.portfolio-links a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}
.link-demo {
  background: var(--accent);
  color: #000;
}
.link-demo:hover { background: #00b8cc; }
.link-code {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.link-code:hover { color: var(--text); border-color: var(--text-muted); }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}
.contact-item:hover {
  border-color: var(--accent);
  box-shadow: var(--glow);
  transform: translateX(-4px);
}
.contact-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}
.contact-label { font-size: 11px; color: var(--text-muted); font-family: 'Space Mono', monospace; }
.contact-value { font-size: 14px; font-weight: 700; margin-top: 2px; }

/* Footer */
footer {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  font-family: 'Space Mono', monospace;
}

/* ENGLISH MODE */
body.lang-en { direction: ltr; }
body.lang-en .sidebar { right: auto; left: 0; border-left: none; border-right: 1px solid var(--border); }
body.lang-en .main-content { margin-right: 0; margin-left: 260px; }
body.lang-en .timeline::before { right: auto; left: 0; }
body.lang-en .timeline-item { padding-right: 0; padding-left: 36px; }
body.lang-en .timeline-item::before { right: auto; left: -5px; }
body.lang-en .contact-item:hover { transform: translateX(4px); }
body.lang-en .lang-toggle { left: auto; right: 20px; }

body.lang-en .ar { display: none !important; }
body.lang-en .en { display: block !important; }

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    right: 0; bottom: 0;
    width: 100%; height: 60px;
    flex-direction: row;
    padding: 0 16px;
    top: auto;
    border-left: none;
    border-top: 1px solid var(--border);
    justify-content: space-around;
  }
  .sidebar .profile-ring, .sidebar .sidebar-name, .sidebar .sidebar-title, .sidebar .status-badge, .sidebar .sidebar-social { display: none; }
  .sidebar-nav { flex-direction: row; margin: 0; gap: 0; justify-content: space-around; width: 100%; }
  .nav-link span { display: none; }
  .nav-link { padding: 8px; border-radius: 8px; }
  .main-content { margin-right: 0; padding-bottom: 60px; }
  body.lang-en .main-content { margin-left: 0; }
  body.lang-en .sidebar { left: 0; right: 0; border-right: none; border-top: 1px solid var(--border); }
  .hero { padding: 40px 24px; }
  .section { padding: 50px 24px; }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}