/**
 * RTL Master - Sistema completo de internacionalización
 * Arquitectura modular de clase mundial
 */

/* ===== IMPORTAR MÓDULOS RTL ===== */
@import url("./rtl-base.css");
@import url("./rtl-components.css");
@import url("./rtl-icons.css");
@import url("./rtl-utilities.css");

/* ===== FONT LOADING RTL ===== */
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/noto-sans-arabic.woff2") format("woff2");
  unicode-range:
    U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
    U+FE80-FEFC;
}

@font-face {
  font-family: "Noto Sans Hebrew";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/noto-sans-hebrew.woff2") format("woff2");
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}

@font-face {
  font-family: "Noto Sans Persian";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/noto-sans-persian.woff2") format("woff2");
  unicode-range:
    U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF,
    U+FE80-FEFC;
}

/* ===== LANGUAGE SPECIFIC ===== */
[lang="ar"] {
  font-family:
    "Noto Sans Arabic", "Arabic Typesetting", "Traditional Arabic", "Segoe UI",
    sans-serif;
  line-height: 1.8;
  font-size: 1.1em;
}

[lang="he"] {
  font-family: "Noto Sans Hebrew", "David", "Times New Roman", serif;
  line-height: 1.7;
  font-size: 1.05em;
}

[lang="fa"] {
  font-family: "Noto Sans Persian", "Tahoma", "Iranian Sans", sans-serif;
  line-height: 1.8;
  font-size: 1.1em;
}

[lang="ur"] {
  font-family: "Noto Sans Arabic", var(--font-family-base);
  line-height: 1.8;
  font-size: 1.1em;
}

[lang="ku"] {
  font-family: "Noto Sans Arabic", var(--font-family-base);
  line-height: 1.8;
  font-size: 1.1em;
}

[lang="sd"] {
  font-family: "Noto Sans Arabic", var(--font-family-base);
  line-height: 1.8;
  font-size: 1.1em;
}

[lang="ps"] {
  font-family: "Noto Sans Arabic", var(--font-family-base);
  line-height: 1.8;
  font-size: 1.1em;
}

/* ===== PERFORMANCE OPTIMIZATION ===== */
[dir="rtl"] {
  contain: layout style;
  transform: translateZ(0);
}

/* ===== PRINT RTL ===== */
@media print {
  [dir="rtl"] {
    direction: rtl;
    text-align: start;
  }
}

/* ===== DEBUGGING RTL ===== */
@media screen and (max-width: 0px) {
  [dir="rtl"] .debug-rtl::before {
    content: "🌍 RTL System Active";
    position: fixed;
    top: 260px;
    right: 10px;
    background: var(--color-success-500);
    color: var(--color-on-success);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    z-index: var(--z-debug);
    opacity: 0.8;
  }
}

[dir="rtl"] {
  font-feature-settings:
    "tnum" on,
    "lnum" on;
  font-variant-numeric: tabular-nums;
}

[dir="rtl"] .numbers-local {
  font-feature-settings: "anum" on;
}

[dir="rtl"] .numbers-western {
  font-feature-settings: "anum" off;
}
