/* ============================================
   H.DIRECT – Dark Mode Design System (Unified)
   ============================================ */

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

:root {
  /* Blues */
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-800: #1E40AF;
  --blue-900: #1E3A8A;

  /* Purples */
  --purple-400: #A78BFA;
  --purple-500: #8B5CF6;
  --purple-600: #7C3AED;

  /* Accent */
  --emerald-400: #34D399;
  --emerald-500: #10B981;
  --amber-400: #FBBF24;
  --amber-500: #F59E0B;
  --rose-400: #FB7185;
  --rose-500: #F43F5E;

  /* Dark Palette */
  --bg-base: #0A0F1E;
  --bg-surface: #0F1628;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-elevated: rgba(255, 255, 255, 0.06);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* Text */
  --text-primary: #FFFFFF;
  --text-body: rgba(255, 255, 255, 0.85);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.45);
  --text-disabled: rgba(255, 255, 255, 0.25);

  /* Brand Gradients */
  --g-primary: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  --g-hero-mesh: radial-gradient(at 30% 10%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
                 radial-gradient(at 80% 90%, rgba(59, 130, 246, 0.4) 0%, transparent 50%),
                 linear-gradient(135deg, #1E3A8A 0%, #312E81 50%, #581C87 100%);
  --g-sunset: linear-gradient(135deg, #F59E0B 0%, #F43F5E 100%);
  --g-forest: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --g-ocean: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  --g-aurora: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);

  /* App bg - subtle mesh */
  --bg-mesh: radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
             radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
             radial-gradient(at 50% 100%, rgba(236, 72, 153, 0.06) 0%, transparent 50%),
             #0A0F1E;

  /* Typography */
  --font-ar: 'Cairo', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-en: 'Inter', system-ui, -apple-system, sans-serif;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-3xl: 32px;
  --r-full: 9999px;

  /* Shadows */
  --sh-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --sh-md: 0 8px 16px rgba(0, 0, 0, 0.25);
  --sh-lg: 0 16px 32px rgba(0, 0, 0, 0.35);
  --sh-xl: 0 24px 48px -12px rgba(0, 0, 0, 0.5);
  --sh-glow-blue: 0 0 40px rgba(37, 99, 235, 0.4);
  --sh-glow-purple: 0 0 40px rgba(139, 92, 246, 0.4);

  /* Ease */
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

body {
  font-family: var(--font-ar);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text-primary);
  direction: rtl;
  font-weight: 400;
  line-height: 1.5;
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LTR for numbers */
.num, input[type="tel"], input[type="number"] {
  font-family: var(--font-en);
  direction: ltr;
  text-align: left;
  font-feature-settings: "tnum";
}

button { font-family: inherit; border: none; background: none; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ========== Device Frame (Dark) ========== */
.device {
  width: 390px;
  height: 844px;
  background: var(--bg-base);
  border-radius: 56px;
  box-shadow:
    0 0 0 12px #0a0a0a,
    0 0 0 13px #333,
    0 60px 120px -20px rgba(0, 0, 0, 0.5),
    0 30px 60px -30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  position: relative;
  margin: 40px auto;
}

.device::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 32px;
  background: #0a0a0a;
  border-radius: 20px;
  z-index: 1000;
}

/* Gradient fade above bottom nav - prevents content sticking to nav */
.device::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top,
    var(--bg-base) 0%,
    rgba(10, 15, 30, 0.95) 30%,
    rgba(10, 15, 30, 0.7) 60%,
    rgba(10, 15, 30, 0.3) 85%,
    transparent 100%);
  pointer-events: none;
  z-index: 80;
}

/* Status Bar */
.status-bar {
  position: relative;
  z-index: 500;
  height: 54px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 32px 8px;
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 600;
  color: white;
}

/* Top blur overlay - separates status bar from scrolling content */
.device > .status-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom,
    rgba(10, 15, 30, 0.3) 0%,
    transparent 100%);
  pointer-events: none;
  z-index: -1;
}

.status-icons {
  display: flex;
  gap: 6px;
  align-items: center;
  color: white;
}

/* SVG Icons */
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* ========== Screen Container ========== */
.screen {
  height: calc(100% - 54px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-mesh);
}

/* Hide scrollbar */
.screen::-webkit-scrollbar { display: none; }
.screen { scrollbar-width: none; -ms-overflow-style: none; }

.screen-pad {
  padding: 0 20px;
}

/* ========== Generic Header ========== */
.top-header {
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title-wrap {
  text-align: center;
  flex: 1;
}

.header-title-wrap .eyebrow {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 700;
  letter-spacing: 2px;
  font-family: var(--font-en);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.header-title-wrap .title {
  font-size: 17px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.3px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: all 200ms var(--ease-smooth);
  position: relative;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

.icon-btn .dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: var(--rose-500);
  border-radius: 50%;
  border: 2px solid var(--bg-base);
}

/* ========== Typography ========== */
.display-xl { font-size: 48px; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.display-lg { font-size: 40px; font-weight: 800; line-height: 1.05; letter-spacing: -1.5px; }
.display-md { font-size: 32px; font-weight: 800; line-height: 1.1; letter-spacing: -1px; }
.h1 { font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -0.8px; }
.h2 { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -0.5px; }
.h3 { font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -0.3px; }
.body-lg { font-size: 16px; line-height: 1.5; }
.body { font-size: 14px; line-height: 1.5; }
.body-sm { font-size: 13px; line-height: 1.4; }
.caption { font-size: 12px; font-weight: 500; line-height: 1.4; }
.tiny { font-size: 10px; font-weight: 700; line-height: 1.2; letter-spacing: 1.5px; text-transform: uppercase; font-family: var(--font-en); }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--r-full);
  font-family: var(--font-ar);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms var(--ease-smooth);
  letter-spacing: -0.2px;
  white-space: nowrap;
  border: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 13px; }
.btn-lg { padding: 18px 28px; font-size: 16px; }

.btn-primary {
  background: var(--g-primary);
  color: white;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-glass:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.btn-white {
  background: white;
  color: var(--blue-700);
}

/* ========== Input ========== */
.input-m {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-xl);
  font-family: var(--font-ar);
  font-size: 15px;
  font-weight: 500;
  color: white;
  transition: all 200ms var(--ease-smooth);
  letter-spacing: -0.2px;
}

.input-m::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
}

.input-m:focus {
  outline: none;
  border-color: var(--blue-500);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.label-m {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

/* ========== Cards ========== */
.card-dark {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-2xl);
  padding: 20px;
  transition: all 250ms var(--ease-smooth);
}

.card-dark-hover:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

/* ========== Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.1px;
}

.badge-primary { background: rgba(59, 130, 246, 0.15); color: #93C5FD; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #6EE7B7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #FCD34D; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: #C4B5FD; border: 1px solid rgba(139, 92, 246, 0.3); }

/* ========== Dots Indicator ========== */
.dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.dot {
  height: 8px;
  width: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--r-full);
  transition: all 300ms var(--ease-smooth);
}

.dot.active {
  width: 32px;
  background: var(--g-primary);
}

/* ========== Bottom Nav (Dark Floating) ========== */
.bottom-nav {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 100;
}

.nav-container {
  background: rgba(15, 22, 40, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 8px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.nav-item {
  padding: 10px 14px;
  border-radius: var(--r-full);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 200ms var(--ease-smooth);
  font-family: var(--font-ar);
  font-size: 12px;
  font-weight: 700;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.nav-item:hover { color: rgba(255, 255, 255, 0.7); }

.nav-item.active {
  background: white;
  color: var(--bg-base);
}

.nav-item .label { display: none; }
.nav-item.active .label { display: inline; }

.nav-center-fab {
  width: 44px;
  height: 44px;
  background: var(--g-primary);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
  transition: all 200ms;
}

.nav-center-fab:hover {
  transform: scale(1.05) rotate(90deg);
}

/* ========== Utilities ========== */
.hide-scroll::-webkit-scrollbar { display: none; }
.hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }

.pb-nav { padding-bottom: 110px; }

.text-gradient {
  background: linear-gradient(135deg, #FFFFFF 0%, #93C5FD 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animations */
@keyframes floatIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.anim-float { animation: floatIn 600ms var(--ease-out-expo); }
.anim-scale { animation: scaleIn 400ms var(--ease-out-expo); }

.delay-1 { animation-delay: 80ms; animation-fill-mode: backwards; }
.delay-2 { animation-delay: 160ms; animation-fill-mode: backwards; }
.delay-3 { animation-delay: 240ms; animation-fill-mode: backwards; }
.delay-4 { animation-delay: 320ms; animation-fill-mode: backwards; }

/* Blur decorations */
.blur-deco {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.6;
}

.blur-blue { background: var(--blue-500); }
.blur-purple { background: var(--purple-500); }
.blur-pink { background: #EC4899; }
