/* ==========================================================================
   TASKORA - THMANYAH TYPEFACE & ARABIC RTL DESIGN SYSTEM
   Fonts: Thmanyah Sans, Thmanyah Serif Text, Thmanyah Serif Display
   Architectural Luxury Styling & Switcher
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. @FONT-FACE DEFINITIONS (Thmanyah Sans - Primary Typography)
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Thmanyah Sans';
    src: url('/static/fonts/thmanyah/thmanyahsans/woff2/thmanyahsans-Light.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahsans/otf/thmanyahsans-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('/static/fonts/thmanyah/thmanyahsans/woff2/thmanyahsans-Regular.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahsans/otf/thmanyahsans-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('/static/fonts/thmanyah/thmanyahsans/woff2/thmanyahsans-Medium.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahsans/otf/thmanyahsans-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('/static/fonts/thmanyah/thmanyahsans/woff2/thmanyahsans-Bold.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahsans/otf/thmanyahsans-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Sans';
    src: url('/static/fonts/thmanyah/thmanyahsans/woff2/thmanyahsans-Black.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahsans/otf/thmanyahsans-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   @FONT-FACE DEFINITIONS (Thmanyah Serif Text)
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Thmanyah Serif Text';
    src: url('/static/fonts/thmanyah/thmanyahseriftext/woff2/thmanyahseriftext-Light.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahseriftext/otf/thmanyahseriftext-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Serif Text';
    src: url('/static/fonts/thmanyah/thmanyahseriftext/woff2/thmanyahseriftext-Regular.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahseriftext/otf/thmanyahseriftext-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Serif Text';
    src: url('/static/fonts/thmanyah/thmanyahseriftext/woff2/thmanyahseriftext-Medium.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahseriftext/otf/thmanyahseriftext-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Serif Text';
    src: url('/static/fonts/thmanyah/thmanyahseriftext/woff2/thmanyahseriftext-Bold.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahseriftext/otf/thmanyahseriftext-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Thmanyah Serif Text';
    src: url('/static/fonts/thmanyah/thmanyahseriftext/woff2/thmanyahseriftext-Black.woff2') format('woff2'),
        url('/static/fonts/thmanyah/thmanyahseriftext/otf/thmanyahseriftext-Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* --------------------------------------------------------------------------
   2. FONT APPLICATION & RTL GLOBAL RULES
   -------------------------------------------------------------------------- */
.font-thmanyah,
html[data-font="thmanyah"],
html[lang="ar"],
html[dir="rtl"] {
    font-family: 'Thmanyah Sans', 'Tajawal', 'Readex Pro', sans-serif !important;
}

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    font-family: 'Thmanyah Sans', 'Tajawal', 'Readex Pro', sans-serif !important;
}

/* RTL Typography Refinements for Thmanyah */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] button,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea,
html[dir="rtl"] label {
    font-family: 'Thmanyah Sans', 'Tajawal', 'Readex Pro', sans-serif !important;
}

/* --------------------------------------------------------------------------
   3. ARCHITECTURAL LUXURY LANGUAGE & FONT SWITCHER
   -------------------------------------------------------------------------- */
.lang-toggle {
    position: relative;
    width: 74px;
    height: 26px;
    background: #EBE7DD;
    border: 1px solid rgba(182, 138, 98, 0.4);
    border-radius: 9999px;
    cursor: pointer !important;
    pointer-events: auto !important;
    direction: ltr !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    padding: 2px;
    box-shadow: inset 0 2px 4px rgba(2, 8, 23, 0.08), 0 2px 6px rgba(182, 138, 98, 0.15);
    z-index: 100;
    flex-shrink: 0;
    user-select: none;
}

.lang-toggle * {
    pointer-events: none !important;
}

.lang-toggle:hover {
    border-color: #b68a62;
    box-shadow: 0 0 12px rgba(182, 138, 98, 0.4);
    transform: translateY(-1px);
}

.lang-toggle:active {
    transform: scale(0.96);
}

.lang-toggle-slider {
    position: absolute;
    width: 34px;
    height: 20px;
    background: #FFFFFF;
    border: 1px solid rgba(182, 138, 98, 0.35);
    border-radius: 9999px;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(2, 8, 23, 0.18);
    left: 2px;
    top: 2px;
    z-index: 1;
}

.lang-toggle-labels {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: ltr !important;
    z-index: 2;
    padding: 0 1px;
}

.lang-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    width: 34px;
    text-align: center;
    transition: all 0.25s ease;
    line-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-label.en {
    color: #020817;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
}

.lang-label.ar {
    color: #8C7E6A;
    font-family: 'Thmanyah Sans', 'Tajawal', sans-serif;
    font-size: 11px;
    font-weight: 600;
}

/* Dark Mode for lang-toggle */
[data-theme="dark"] .lang-toggle {
    background: #020817;
    border-color: rgba(182, 138, 98, 0.5);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 10px rgba(182, 138, 98, 0.2);
}

[data-theme="dark"] .lang-toggle-slider {
    background: #0a1020;
    border-color: #b68a62;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 8px rgba(182, 138, 98, 0.4);
}

[data-theme="dark"] .lang-label.en {
    color: #F8FAFC;
}

[data-theme="dark"] .lang-label.ar {
    color: #64748B;
}

/* When Arabic (RTL) Active */
html[lang="ar"] .lang-toggle-slider,
html[dir="rtl"] .lang-toggle-slider {
    left: 36px;
    background: #FFFFFF;
}

[data-theme="dark"] html[lang="ar"] .lang-toggle-slider,
[data-theme="dark"] html[dir="rtl"] .lang-toggle-slider {
    background: #0a1020;
    border-color: #b68a62;
    box-shadow: 0 0 10px rgba(182, 138, 98, 0.5);
}

html[lang="ar"] .lang-label.en,
html[dir="rtl"] .lang-label.en {
    color: #8C7E6A;
    font-weight: 500;
}

[data-theme="dark"] html[lang="ar"] .lang-label.en,
[data-theme="dark"] html[dir="rtl"] .lang-label.en {
    color: #64748B;
    font-weight: 500;
}

html[lang="ar"] .lang-label.ar,
html[dir="rtl"] .lang-label.ar {
    color: #8C6239;
    font-weight: 800;
}

[data-theme="dark"] html[lang="ar"] .lang-label.ar,
[data-theme="dark"] html[dir="rtl"] .lang-label.ar {
    color: #cbae75;
    font-weight: 800;
}

/* Absolute Isolation for Navigation Toggle Widgets in RTL */
.lang-toggle,
.theme-toggle,
.lang-toggle *,
.theme-toggle * {
    direction: ltr !important;
    box-sizing: border-box !important;
}

.theme-toggle-icon {
    line-height: 1 !important;
    text-align: center !important;
}

/* Active Navigation Pill Indicator (Centered in LTR & RTL) */
.nav-active-pill {
    position: absolute;
    bottom: 0;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 28px;
    height: 3px;
    border-radius: 9999px;
    background: #b68a62;
    box-shadow: 0 0 10px rgba(182, 138, 98, 0.85);
    pointer-events: none;
    z-index: 10;
}

[dir="rtl"] .nav-active-pill,
html[dir="rtl"] .nav-active-pill,
html[lang="ar"] .nav-active-pill {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
}

/* --------------------------------------------------------------------------
   4. RTL FORM & COMPONENT ADAPTATIONS (Arabic-Only Scoped Rules)
   -------------------------------------------------------------------------- */

/* Global Letter-spacing & Monospace Reset in RTL (Preserves Arabic Typography) */
[dir="rtl"] *,
html[dir="rtl"] *,
html[lang="ar"] * {
    letter-spacing: normal !important;
}

[dir="rtl"] .font-mono,
html[dir="rtl"] .font-mono,
html[lang="ar"] .font-mono {
    font-family: 'Thmanyah Sans', 'Tajawal', 'Readex Pro', sans-serif !important;
    letter-spacing: normal !important;
}

/* Input text alignment & padding in RTL */
[dir="rtl"] .luxury-input {
    text-align: right;
    direction: rtl;
    font-family: 'Thmanyah Sans', 'Tajawal', sans-serif !important;
}

/* Password Toggle & Input Padding in RTL */
[dir="rtl"] .password-toggle-btn {
    right: auto !important;
    left: 0 !important;
    padding-right: 0 !important;
    padding-left: 0.875rem !important;
}

[dir="rtl"] .luxury-input.has-password-toggle {
    padding-right: 0.875rem !important;
    padding-left: 2.75rem !important;
}

/* Error icon in RTL */
[dir="rtl"] .input-error-icon {
    right: auto !important;
    left: 0 !important;
    padding-right: 0 !important;
    padding-left: 0.75rem !important;
}

/* Password Security Meter Box in RTL */
[dir="rtl"] .pwd-meter-box {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] #regPwdLabel {
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: normal !important;
    font-family: 'Thmanyah Sans', sans-serif !important;
}

/* Role Selector Cards in RTL */
[dir="rtl"] .selector-card {
    direction: rtl;
}

[dir="rtl"] .selector-card .role-title {
    font-family: 'Thmanyah Sans', sans-serif !important;
    font-weight: 700 !important;
}

html[data-theme="dark"] [dir="rtl"] .selector-card .role-title {
    color: #F8FAFC !important;
}

html[data-theme="light"] [dir="rtl"] .selector-card .role-title {
    color: #020817 !important;
}

[dir="rtl"] .selector-card .role-desc {
    font-family: 'Thmanyah Sans', sans-serif !important;
    letter-spacing: normal !important;
}

/* Form Labels, Icons & Asterisks in RTL */
[dir="rtl"] label {
    font-family: 'Thmanyah Sans', sans-serif !important;
}

[dir="rtl"] label.flex {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] label.flex i {
    margin-right: 0 !important;
    margin-left: 0.4rem !important;
}

[dir="rtl"] label.flex span.text-\[\#b68a62\] {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

/* Email Notice & Info Icons in RTL */
[dir="rtl"] p.text-\[11px\] {
    direction: rtl;
    text-align: right;
    font-family: 'Thmanyah Sans', sans-serif !important;
}

[dir="rtl"] p.text-\[11px\] i {
    margin-right: 0 !important;
    margin-left: 0.35rem !important;
}

/* Requirement Chips in RTL */
[dir="rtl"] .req-chip {
    font-family: 'Thmanyah Sans', sans-serif !important;
    letter-spacing: normal !important;
}

/* Spacing and margins in RTL */
[dir="rtl"] .rtl-flip-icon {
    transform: scaleX(-1);
}

[dir="rtl"] .mr-1\.5 {
    margin-right: 0 !important;
    margin-left: 0.375rem !important;
}

[dir="rtl"] .mr-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

[dir="rtl"] .mr-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .mr-2\.5 {
    margin-right: 0 !important;
    margin-left: 0.625rem !important;
}

[dir="rtl"] .mr-3 {
    margin-right: 0 !important;
    margin-left: 0.75rem !important;
}

[dir="rtl"] .ml-0\.5 {
    margin-left: 0 !important;
    margin-right: 0.125rem !important;
}

[dir="rtl"] .ml-1 {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

[dir="rtl"] .ml-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

[dir="rtl"] .ml-3 {
    margin-left: 0 !important;
    margin-right: 0.75rem !important;
}

[dir="rtl"] .text-left {
    text-align: right !important;
}

[dir="rtl"] .text-right {
    text-align: left !important;
}

/* Alert Boxes in RTL */
[dir="rtl"] .luxury-alert-error,
[dir="rtl"] .luxury-alert-warning {
    text-align: right;
    direction: rtl;
    font-family: 'Thmanyah Sans', sans-serif !important;
}

[dir="rtl"] .luxury-alert-error .alert-icon-box,
[dir="rtl"] .luxury-alert-warning .alert-icon-box {
    margin-right: 0 !important;
    margin-left: 0.75rem !important;
}

/* Animated Switching Feedback */
.lang-switching .lang-toggle-slider {
    transform: scale(0.92);
}