﻿/* =============================================================
   BASE.CSS — Reset, Variables, Typography, Root Styles
   قدها وقدود — Arabic RTL Game Show Platform
   ============================================================= */

/* ── Google Fonts (Cairo — elegant Arabic display & body) ── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* ══════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES (Design Tokens)
   ══════════════════════════════════════════════════════════════ */
:root {
  /* ── Background Palette ── */
  --bg-lavender:    #EDE8F8;
  --bg-powder-blue: #E2EEFF;
  --bg-blush:       #FDE8F0;
  --bg-cream:       #FFF8F0;
  --bg-mint:        #E8F8F4;

  /* ── Main gradient (background) — brand-tinted ── */
  --gradient-main: linear-gradient(
    145deg,
    #FFF6E0 0%,     /* soft gold haze (top-right-ish)    */
    #FDFBF5 25%,
    #F5FBF9 55%,
    #E6FBF5 85%,    /* soft teal haze (bottom-left-ish) */
    #FFF2CF 100%
  );

  /* ── Card / Surface ── */
  --surface-primary:   #FFFFFF;
  --surface-ivory:     #FDFBF8;
  --surface-glass:     rgba(255,255,255,0.82);
  --surface-overlay:   rgba(30,18,60,0.55);

  /* ── Gold / Champagne Accent ── */
  --gold-100: #FEF3C7;
  --gold-200: #F9E08A;
  --gold-300: #E8C840;
  --gold-400: #C8A428;
  --gold-500: #A07818;
  --gold-gradient: linear-gradient(135deg, #F0D870 0%, #C8A428 50%, #E0BC50 100%);
  --gold-gradient-btn: linear-gradient(180deg, #F4DC6C 0%, #C8A020 60%, #E0C040 100%);

  /* ── Brand Colors (قدها وقدود) ── */
  --brand-gold:         #FFC857;
  --brand-gold-soft:    #FFE29A;
  --brand-gold-deep:    #E6A92B;
  --brand-teal:         #2EE6C5;
  --brand-teal-soft:    #9FF2E1;
  --brand-teal-deep:    #1FA88C;
  --brand-gradient:     linear-gradient(135deg, #FFC857 0%, #2EE6C5 100%);
  --brand-gradient-btn: linear-gradient(180deg, #FFD77E 0%, #FFC857 40%, #2EE6C5 100%);
  --brand-gradient-soft:linear-gradient(135deg, rgba(255,200,87,0.20), rgba(46,230,197,0.20));
  --shadow-brand:       0 6px 20px rgba(230,169,43,0.25), 0 2px 8px rgba(31,168,140,0.18);

  /* ── Legacy brand palette (kept for historical screens) ── */
  --purple-50:  #F5F0FF;
  --purple-100: #EAE0FF;
  --purple-200: #D0B8FF;
  --purple-300: #A880F0;
  --purple-400: #7C50D8;
  --purple-500: #5830B0;
  --purple-600: #401880;

  /* ── Text ── */
  --text-primary:   #1E1438;
  --text-secondary: #4A3870;
  --text-muted:     #8A78A8;
  --text-disabled:  #C0B8D0;
  --text-gold:      #9A7010;
  --text-white:     #FFFFFF;
  --text-error:     #D02040;
  --text-success:   #1A7840;

  /* ── Borders ── */
  --border-light:  rgba(160,140,200,0.20);
  --border-medium: rgba(140,120,180,0.35);
  --border-gold:   rgba(200,164,40,0.45);

  /* ── Shadows ── */
  --shadow-xs:  0 1px 3px rgba(60,40,120,0.08);
  --shadow-sm:  0 2px 8px rgba(60,40,120,0.10);
  --shadow-md:  0 4px 20px rgba(60,40,120,0.12), 0 1px 4px rgba(60,40,120,0.08);
  --shadow-lg:  0 8px 32px rgba(40,20,80,0.16), 0 2px 8px rgba(60,40,120,0.10);
  --shadow-xl:  0 16px 56px rgba(30,10,60,0.22), 0 4px 16px rgba(60,40,120,0.14);
  --shadow-gold: 0 4px 18px rgba(200,164,40,0.30), 0 1px 4px rgba(200,164,40,0.20);
  --shadow-inset: inset 0 1px 4px rgba(60,40,120,0.10);

  /* ── Streak Bar Gradient Segments ── */
  --streak-empty:  #EDE8E0;
  --streak-1: #F5EAC8;
  --streak-2: #F4D898;
  --streak-3: #F0B870;
  --streak-4: #E88840;
  --streak-5: #D84C18;
  --streak-6: #B82808;

  /* ── Spacing Scale ── */
  --space-1:  0.25rem;  /*  4px */
  --space-2:  0.5rem;   /*  8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */

  /* ── Border Radius ── */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* ── Typography ── */
  --font-primary: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --text-xs:   0.70rem;
  --text-sm:   0.825rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.275rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-extrabold:800;
  --weight-black:    900;

  --leading-tight:  1.2;
  --leading-snug:   1.375;
  --leading-normal: 1.6;
  --leading-loose:  1.9;

  /* ── Transitions ── */
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast:   120ms;
  --t-normal: 240ms;
  --t-slow:   380ms;
  --t-slower: 560ms;

  /* ── Z-index layers ── */
  --z-base:    1;
  --z-raised:  10;
  --z-dropdown:100;
  --z-modal:   200;
  --z-toast:   300;
  --z-top:     400;
}

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

html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--gradient-main);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--purple-200);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--purple-300); }

/* ── Selection ── */
::selection {
  background: var(--purple-200);
  color: var(--purple-600);
}

/* ── Images ── */
img, svg {
  display: block;
  max-width: 100%;
}

/* ── Links ── */
a {
  color: var(--purple-400);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-smooth);
}
a:hover { color: var(--purple-500); }

/* ── Lists ── */
ul, ol { list-style: none; }

/* ── Headings ── */
h1,h2,h3,h4,h5,h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}
h1 { font-size: var(--text-4xl); font-weight: var(--weight-black); }
h2 { font-size: var(--text-3xl); font-weight: var(--weight-extrabold); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* ── Form elements ── */
input, textarea, select, button {
  font-family: var(--font-primary);
  font-size: var(--text-base);
}

input, textarea, select {
  outline: none;
  border: none;
  background: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

/* ══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ══════════════════════════════════════════════════════════════ */

/* Layout */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-row     { flex-direction: row; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid        { display: grid; }
.place-center { place-items: center; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.inset-0  { inset: 0; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* Display */
.block        { display: block; }
.inline-block { display: inline-block; }
.hidden       { display: none !important; }

/* Sizing */
.w-full  { width: 100%; }
.h-full  { height: 100%; }
.w-screen  { width: 100vw; }
.h-screen  { height: 100vh; }
.min-h-screen { min-height: 100vh; }

/* Text */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }
.text-start  { text-align: start; }
.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }
.text-3xl   { font-size: var(--text-3xl); }
.text-4xl   { font-size: var(--text-4xl); }
.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }
.font-extrabold{ font-weight: var(--weight-extrabold); }
.font-black    { font-weight: var(--weight-black); }
.text-muted    { color: var(--text-muted); }
.text-gold     { color: var(--text-gold); }
.text-error    { color: var(--text-error); }
.text-success  { color: var(--text-success); }
.text-white    { color: var(--text-white); }

/* Spacing */
.p-4  { padding: var(--space-4); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }
.px-4 { padding-inline: var(--space-4); }
.px-6 { padding-inline: var(--space-6); }
.py-2 { padding-block: var(--space-2); }
.py-4 { padding-block: var(--space-4); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* Border radius */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Opacity */
.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }

/* Pointer */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.pointer-events-none { pointer-events: none; }

/* Truncate */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Transition */
.transition { transition: all var(--t-normal) var(--ease-smooth); }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ══════════════════════════════════════════════════════════════
   SPARKLE / PARTICLE LAYER (decorative background)
   ══════════════════════════════════════════════════════════════ */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-particles::before,
.bg-particles::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180,140,255,0.18) 0%, transparent 65%);
  animation: particle-drift 12s ease-in-out infinite alternate;
}
.bg-particles::before {
  width: 600px; height: 600px;
  top: -100px; right: -100px;
}
.bg-particles::after {
  width: 500px; height: 500px;
  bottom: -80px; left: -80px;
  background: radial-gradient(circle, rgba(255,160,200,0.14) 0%, transparent 65%);
  animation-delay: -6s;
}

@keyframes particle-drift {
  0%   { transform: translate(0,0) scale(1); opacity: 0.6; }
  100% { transform: translate(30px,40px) scale(1.08); opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   PAGE WRAPPER (ensures content above bg-particles)
   ══════════════════════════════════════════════════════════════ */
.page-wrapper {
  position: relative;
  z-index: var(--z-base);
  min-height: 100vh;
}
