/* src/styles/globals.css - Global Base & Typography Styles */


html {
  direction: rtl;
  font-family: var(--font-family);
  font-size: 16px;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  box-sizing: border-box;
  overflow-x: clip;
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #38bdf8 var(--bg-primary);
}

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

/* ========================================================
   RESPONSIVE ROOT PROPORTIONAL SCALING (Mobile 25% Reduction)
   Automatically scales all rem units across typography, padding & margins
   ======================================================== */
@media (max-width: 1200px) {
  html {
    font-size: 15px; /* ~94% scale */
  }
}

@media (max-width: 1024px) {
  html {
    font-size: 14px; /* ~87.5% scale */
  }
}

@media (max-width: 768px) {
  html {
    font-size: 13px; /* ~81% scale */
  }
}

@media (max-width: 480px) {
  html {
    font-size: 12px; /* ~75% scale = Exact 25% reduction (تصغير الربع) */
  }
}

@media (max-width: 360px) {
  html {
    font-size: 11px; /* ~68% scale for small mobile viewports */
  }
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: var(--line-height-normal);
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* Universal Media & Text Containment (No horizontal overflow) */
img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

pre, code, kbd, samp {
  max-width: 100%;
  box-sizing: border-box;
}

/* Accessible focus-visible state */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Smooth selection colors */
::selection {
  background-color: var(--primary-soft);
  color: var(--text-primary);
}

/* Clean, modern, visible scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
  transition: background-color var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: #38bdf8;
}

/* Fluid responsive container */
.container {
  width: min(1320px, calc(100% - 2.5rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 1.5rem);
  }
}

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

/* Material Symbols Outlined Icon Hardening & Translation Protection */
.material-symbols-outlined,
.material-symbols-rounded,
.material-symbols-sharp {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr !important;
  unicode-bidi: isolate;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

