/* ============================================
   YALLA MOBILE - BASE & RESET STYLES
   ============================================ */

/* Box Model Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Document & Body */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
  font-size: var(--text-base, 1rem);
  font-weight: var(--font-normal, 400);
  line-height: var(--leading-normal, 1.5);
  color: var(--color-text-primary, #ffffff);
  background-color: var(--color-bg-base, #0a0a14);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-slow, 0.5s ease),
              color var(--transition-slow, 0.5s ease);
}

/* RTL Font Override */
[dir="rtl"] body {
  font-family: var(--font-arabic, 'Tajawal', sans-serif);
}

/* Typography Reset */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-weight: var(--font-bold, 700);
  line-height: var(--leading-tight, 1.2);
  color: var(--color-text-primary, #ffffff);
  text-wrap: balance;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-family: var(--font-arabic, 'Tajawal', sans-serif);
}

p {
  color: var(--color-text-secondary, rgba(255, 255, 255, 0.7));
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Media Elements */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Form Elements */
button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

button {
  cursor: pointer;
}

input, textarea, select {
  outline: none;
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
}

/* Interactive Elements */
[hidden] {
  display: none !important;
}

[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

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

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Selection */
::selection {
  background: var(--color-primary, #6366f1);
  color: var(--color-text-inverse, #ffffff);
}

/* Focus Styles */
:focus-visible {
  outline: 2px solid var(--color-primary, #6366f1);
  outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-subtle, #0f0f1a);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong, rgba(255, 255, 255, 0.15));
  border-radius: var(--radius-full, 9999px);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary, #6366f1);
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4, 1rem);
  padding: var(--space-3, 0.75rem) var(--space-6, 1.5rem);
  background: var(--color-primary, #6366f1);
  color: var(--color-text-inverse, #ffffff);
  font-weight: var(--font-semibold, 600);
  border-radius: var(--radius-md, 0.5rem);
  z-index: var(--z-tooltip, 700);
  transition: top var(--transition-fast, 0.15s ease);
}

.skip-link:focus {
  top: var(--space-4, 1rem);
}

/* Visually Hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}