/* ============================================================
   CYBER PHASE PAGES - SHARED CSS
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Poppins:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #050508;
  --bg2: #0a0a0f;
  --card: rgba(255,255,255,0.03);
  --card-h: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.07);
  --border-h: rgba(255,255,255,0.15);
  --text: #f0f0f5;
  --text2: #8888a0;
  --muted: #4a4a60;
  --cyan: #06b6d4;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #a855f7;
  --blue: #4f8ef7;
  --pink: #ec4899;
  --glow-cyan: rgba(6,182,212,0.3);
  --glow-green: rgba(16,185,129,0.3);
  --glow-red: rgba(239,68,68,0.3);
  --grad1: linear-gradient(135deg, #06b6d4 0%, #4f8ef7 100%);
  --grad2: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --grad3: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
  --font-body: 'Cairo', sans-serif;
  --font-head: 'Poppins', 'Cairo', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
  --tr: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--cyan) var(--bg2); }
html::-webkit-scrollbar { width: 6px; }
html::-webkit-scrollbar-track { background: var(--bg2); }
html::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 3px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
  direction: rtl;
  padding-top: 68px;
}

/* NAV */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: 0 clamp(16px, 3vw, 24px); transition: var(--tr); }
.nav-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 68px; border-bottom: 1px solid transparent; transition: var(--tr); }
nav.scrolled .nav-inner { border-bottom-color: var(--border); }
nav.scrolled { background: rgba(5,5,8,0.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.nav-logo i { font-size: 20px; color: var(--cyan); }
.nav-logo-text { font-weight: 800; font-size: clamp(0.8rem, 1.8vw, 1rem); font-family: var(--font-head); }
.nav-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: clamp(0.7rem, 1.2vw, 0.82rem); color: var(--muted); }
.nav-breadcrumb a { color: var(--text2); text-decoration: none; transition: var(--tr); }
.nav-breadcrumb a:hover { color: var(--cyan); }
.nav-breadcrumb .sep { color: var(--border); }
.nav-back { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 8px 18px; border-radius: var(--r-sm); font-size: clamp(0.7rem, 1.2vw, 0.82rem); font-weight: 700; text-decoration: none; transition: var(--tr); font-family: var(--font-body); }
.nav-back:hover { border-color: var(--border-h); background: var(--card-h); transform: translateY(-1px); }
.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-burger span { width: 24px; height: 2px; background: var(--text2); border-radius: 2px; transition: var(--tr); display: block; }
.mobile-menu { display: none; position: fixed; top: 68px; left: 0; right: 0; background: rgba(5,5,8,0.97); backdrop-filter: blur(20px); padding: 20px 24px 28px; border-bottom: 1px solid var(--border); z-index: 999; flex-direction: column; gap: 4px; }
.mobile-menu.open { display: flex; }
.mobile-menu a { color: var(--text2); text-decoration: none; font-size: 1rem; font-weight: 600; padding: 12px 16px; border-radius: var(--r-sm); transition: var(--tr); }
.mobile-menu a:hover { color: var(--text); background: var(--card); }

/* CONTAINER */
.container { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 24px); }

/* HERO */
.phase-hero { padding: clamp(50px, 8vh, 80px) 0 clamp(30px, 5vh, 50px); text-align: center; position: relative; }
.phase-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center top, var(--glow, var(--glow-cyan)), transparent 70%); opacity: 0.25; pointer-events: none; }
.phase-icon { font-size: clamp(3rem, 6vw, 4.5rem); margin-bottom: 20px; display: inline-block; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.phase-title { font-size: clamp(1.6rem, 4vw, 2.8rem); font-weight: 900; margin-bottom: 12px; font-family: var(--font-head); }
.phase-subtitle { font-size: clamp(0.85rem, 1.8vw, 1.05rem); color: var(--text2); max-width: 600px; margin: 0 auto; line-height: 1.9; }
.phase-badges { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.phase-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 16px; border-radius: 100px; font-size: clamp(0.65rem, 1.2vw, 0.78rem); font-weight: 700; background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.25); color: var(--cyan); }
.phase-badge.green { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.25); color: var(--green); }
.phase-badge.orange { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.25); color: var(--orange); }
.phase-badge.red { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); color: var(--red); }
.phase-stats { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: clamp(16px, 3vw, 32px); margin-top: clamp(24px, 4vw, 36px); padding-top: clamp(18px, 3vw, 28px); border-top: 1px solid var(--border); }
.p-stat { text-align: center; }
.p-stat-num { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 900; background: var(--grad1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-family: var(--font-mono); }
.p-stat-label { font-size: clamp(0.65rem, 1.2vw, 0.78rem); color: var(--muted); margin-top: 4px; font-weight: 600; }

/* SECTIONS */
.content-section { padding: clamp(30px, 5vh, 60px) 0; }
.content-section + .content-section { border-top: 1px solid var(--border); }
.section-title { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 800; margin-bottom: clamp(16px, 3vw, 24px); display: flex; align-items: center; gap: 10px; font-family: var(--font-head); }
.section-title .icon { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

/* CARDS */
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 28px); margin-bottom: 16px; transition: var(--tr); }
.info-card:hover { border-color: var(--border-h); background: var(--card-h); }
.info-card h3 { font-size: clamp(1rem, 1.8vw, 1.15rem); font-weight: 800; margin-bottom: 10px; color: var(--text); font-family: var(--font-head); }
.info-card p { color: var(--text2); line-height: 1.9; font-size: clamp(0.8rem, 1.5vw, 0.92rem); }

/* FEATURE GRID */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: clamp(12px, 2vw, 16px); margin-top: 16px; }
.feature-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); padding: clamp(16px, 2.5vw, 24px); transition: var(--tr); }
.feature-item:hover { border-color: var(--border-h); transform: translateY(-2px); }
.feature-item .fi-icon { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-bottom: 10px; }
.feature-item h4 { font-size: clamp(0.85rem, 1.6vw, 1rem); font-weight: 700; margin-bottom: 8px; color: var(--text); font-family: var(--font-head); }
.feature-item p { font-size: clamp(0.75rem, 1.4vw, 0.85rem); color: var(--text2); line-height: 1.7; }

/* CODE */
.code-block { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--r-md); margin: 12px 0; overflow: hidden; }
.code-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); font-family: var(--font-mono); direction: ltr; }
.code-copy { background: none; border: 1px solid var(--border); color: var(--muted); padding: 4px 12px; border-radius: 6px; font-size: 0.75rem; cursor: pointer; transition: var(--tr); font-family: var(--font-mono); }
.code-copy:hover { color: var(--cyan); border-color: var(--cyan); }
.code-content { padding: 16px; overflow-x: auto; font-family: var(--font-mono); font-size: clamp(0.75rem, 1.3vw, 0.85rem); line-height: 1.7; color: var(--text2); direction: ltr; text-align: left; white-space: pre; }
.code-content .cmt { color: #6a9955; }
.code-content .kw { color: #569cd6; }
.code-content .str { color: #ce9178; }
.code-content .cmd { color: #dcdcaa; }
.code-content .flag { color: #9cdcfe; }
.code-content .out { color: #6a9955; opacity: 0.7; }

/* TABLE */
.tech-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: clamp(0.75rem, 1.4vw, 0.88rem); }
.tech-table th, .tech-table td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--border); }
.tech-table th { background: var(--card); font-weight: 700; color: var(--text); font-family: var(--font-head); font-size: clamp(0.7rem, 1.3vw, 0.82rem); }
.tech-table td { color: var(--text2); }
.tech-table tr:hover td { background: var(--card-h); }
.tech-table code { font-family: var(--font-mono); background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; color: var(--cyan); direction: ltr; display: inline-block; }

/* ALERT */
.alert { padding: clamp(14px, 2vw, 18px) clamp(16px, 2.5vw, 24px); border-radius: var(--r-md); margin: 16px 0; display: flex; align-items: flex-start; gap: 12px; font-size: clamp(0.78rem, 1.4vw, 0.88rem); line-height: 1.8; }
.alert .a-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.alert-info { background: rgba(79,142,247,0.08); border: 1px solid rgba(79,142,247,0.2); color: var(--blue); }
.alert-warn { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); color: var(--orange); }
.alert-ok { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); color: var(--green); }
.alert-danger { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: var(--red); }

/* INLINE CODE */
p code, li code, td code { font-family: var(--font-mono); background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; color: var(--cyan); direction: ltr; display: inline-block; }

/* STEP LIST */
.step-list { list-style: none; counter-reset: step; }
.step-list li { counter-increment: step; display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.step-list li:last-child { border-bottom: none; }
.step-list li::before { content: counter(step, decimal-leading-zero); min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-sm); font-family: var(--font-mono); font-weight: 700; font-size: 0.8rem; color: var(--cyan); flex-shrink: 0; }
.step-content h4 { font-size: clamp(0.85rem, 1.5vw, 0.95rem); font-weight: 700; margin-bottom: 4px; color: var(--text); }
.step-content p { font-size: clamp(0.75rem, 1.3vw, 0.85rem); color: var(--text2); line-height: 1.7; }

/* NAV LINKS */
.phase-nav { display: flex; align-items: center; justify-content: space-between; padding: clamp(24px, 4vw, 40px) 0; margin-top: 32px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 12px; }
.phase-nav-link { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); color: var(--text); padding: clamp(10px, 2vw, 14px) clamp(16px, 2.5vw, 24px); border-radius: var(--r-md); font-size: clamp(0.75rem, 1.3vw, 0.88rem); font-weight: 700; text-decoration: none; transition: var(--tr); font-family: var(--font-body); }
.phase-nav-link:hover { border-color: var(--border-h); background: var(--card-h); transform: translateY(-2px); }

/* FOOTER */
footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 40px 24px; text-align: center; }
.footer-copy { font-size: clamp(0.72rem, 1.3vw, 0.85rem); color: var(--muted); }
.footer-copy span { background: var(--grad1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700; }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-breadcrumb { display: none; }
  .nav-burger { display: flex; }
  .phase-stats { flex-direction: column; gap: 14px; }
  .feature-grid { grid-template-columns: 1fr; }
  .phase-nav { flex-direction: column; }
  .phase-nav-link { width: 100%; justify-content: center; }
  .tech-table { font-size: 0.72rem; }
  .tech-table th, .tech-table td { padding: 8px 10px; }
}
