/* ============================================ */
/*  DESIGN SYSTEM — Elite Portfolio CV          */
/*  Glassmorphism + OKLCH + Micro-interactions  */
/* ============================================ */

/* --- Typography --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;700&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Background Colors */
  --cv-bg-base: #06080f;
  --cv-bg-elevated: #0d1117;
  --cv-bg-card: #111827;
  
  /* Accent Colors (Neon) */
  --cv-accent-cyan: #22d3ee;
  --cv-accent-blue: #3b82f6;
  --cv-accent-purple: #a78bfa;
  --cv-accent-emerald: #34d399;
  
  /* Glass Surface */
  --cv-glass-surface: rgba(15, 23, 42, 0.55);
  --cv-glass-border: rgba(255, 255, 255, 0.08);
  --cv-glass-highlight: rgba(255, 255, 255, 0.04);
  --cv-glass-blur: 20px;
  
  /* Text */
  --cv-text-primary: #f1f5f9;
  --cv-text-secondary: #94a3b8;
  --cv-text-muted: #64748b;
}

/* --- Base Styles --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--cv-bg-base);
  color: var(--cv-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .font-heading {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.font-arabic {
  font-family: 'Noto Sans Arabic', sans-serif;
}

/* --- Glass Panel (Universal Container) --- */
.glass-panel {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transform: translateZ(0);
}

/* --- Gradient Text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--cv-accent-cyan), var(--cv-accent-blue), var(--cv-accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-warm {
  background: linear-gradient(135deg, #f472b6, #fb923c, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Card Hover --- */
.card-hover {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -12px rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

/* --- Tech Badge --- */
.tech-badge {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.15);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--cv-accent-cyan);
  letter-spacing: 0.02em;
  transition: all 0.2s;
}
.tech-badge:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.3);
}

/* --- Modal (Native <dialog>) --- */
dialog#projectModal {
  background: transparent;
  border: none;
  padding: 1rem;
  max-width: 56rem;
  width: 100%;
  margin: auto;
}

dialog#projectModal::backdrop {
  background: rgba(2, 6, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

dialog#projectModal .modal-content {
  background: var(--cv-bg-elevated);
  border: 1px solid var(--cv-glass-border);
  border-radius: 1.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Subject Modal */
dialog#subjectModal {
  background: transparent;
  border: none;
  padding: 1rem;
  max-width: 32rem;
  width: 100%;
  margin: auto;
}

dialog#subjectModal::backdrop {
  background: rgba(2, 6, 15, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* --- Custom Scrollbar --- */
.custom-scrollbar::-webkit-scrollbar,
.content-scroll::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track,
.content-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb,
.content-scroll::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.2);
  border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover,
.content-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.4);
}

/* --- Prose / Code Blocks --- */
.prose pre {
  background-color: #0d1117 !important;
  padding: 1rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  border: 1px solid var(--cv-glass-border);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.prose code {
  color: var(--cv-accent-cyan) !important;
  background-color: transparent !important;
  font-family: 'JetBrains Mono', monospace;
}

/* --- Academic Section --- */
.academic-card {
  background: var(--cv-glass-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--cv-glass-border);
  border-radius: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.academic-card:hover {
  border-color: rgba(34, 211, 238, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.semester-badge {
  background: linear-gradient(135deg, var(--cv-accent-cyan), var(--cv-accent-blue));
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.03em;
}

.subject-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--cv-text-primary);
}
.subject-row:hover {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.2);
  transform: translateX(-4px);
}
.subject-row span:last-child {
  color: var(--cv-text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
}
.highlight-subject {
  border-right: 3px solid var(--cv-accent-cyan);
}

/* --- Filter Buttons --- */
.filter-btn {
  padding: 0.5rem 1.2rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cv-text-secondary);
  border: 1px solid var(--cv-glass-border);
  cursor: pointer;
  letter-spacing: 0.01em;
}
.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cv-text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}
.filter-btn.active {
  background: var(--cv-accent-cyan);
  color: #0f172a;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(34, 211, 238, 0.25);
  font-weight: 700;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

@keyframes fadeInGrid {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.grid-animate {
  animation: fadeInGrid 0.4s ease-out forwards;
}

@keyframes ambientPulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(1.05); }
}
.animate-ambient {
  animation: ambientPulse 6s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.animate-float {
  animation: floatSlow 4s ease-in-out infinite;
}

/* --- YouTube Facade --- */
.video-facade {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 1rem;
}
.video-facade .play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.video-facade .play-btn > div {
  width: 4rem;
  height: 4rem;
  background: rgba(220, 38, 38, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.5);
  transition: all 0.3s;
}
.video-facade:hover .play-btn > div {
  transform: scale(1.15);
  box-shadow: 0 0 50px rgba(220, 38, 38, 0.7);
}

/* --- Live Project Cards --- */
.live-project-card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.live-project-card:hover {
  transform: translateY(-8px);
}

/* --- Noise Texture Overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.012;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- Focus States (Accessibility) --- */
*:focus-visible {
  outline: 2px solid var(--cv-accent-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Selection Color --- */
::selection {
  background: rgba(34, 211, 238, 0.3);
  color: white;
}

/* =========================================================
   Modern Web Guidance: Card, Container Queries & RTL/LTR
   ========================================================= */
.live-project-card,
.nb-project-card {
  container-type: inline-size;
}

.live-project-card img,
.nb-project-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.hero-section-dvh {
  min-height: 100dvh;
}

.hero-fluid-title {
  font-size: clamp(2.25rem, 1.4rem + 3.2vw, 4.25rem);
  line-height: 1.12;
}

html[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', 'Inter', system-ui, sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .font-heading {
  font-family: 'Noto Sans Arabic', 'Space Grotesk', sans-serif;
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.lang-toggle-btn:hover {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.65);
  color: #ffffff;
}
