/* 
   Wozzy Interface System - Reset & Base
   Strict Implementation of docs/INTERFACE_SYSTEM.md
*/

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Momentum scrolling for iOS */
    scrollbar-gutter: stable;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    min-height: 100vh;
}

/* Custom Scrollbar for global visibility on dark theme */
::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
    border-left: 1px solid var(--color-border);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border: 3px solid var(--color-bg);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-dim);
}

/* Typography Defaults */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-bold);
    color: var(--color-text);
    line-height: 1.2;
}

h1 {
    font-size: var(--text-3xl);
}

h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
}

h3 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
}

p {
    margin-bottom: var(--space-4);
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Form Elements Reset */
button,
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    background: transparent;
    border: none;
}

button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

[x-cloak] {
    display: none !important;
}

/* ══════════════════════════════════════════════
   RTL — General rules (applied when dir="rtl")
   ══════════════════════════════════════════════ */

/* Scrollbar track: flip border */
[dir="rtl"] ::-webkit-scrollbar-track {
    border-left: none;
    border-right: 1px solid var(--color-border);
}

/* Toggle switches: Tailwind peer-checked pattern.
   The ::after pseudo-element uses left:2px by default.
   In RTL, flip it to right:2px and reverse the translate. */
[dir="rtl"] .peer~div::after {
    left: auto !important;
    right: 2px !important;
}

[dir="rtl"] .peer:checked~div::after {
    right: auto !important;
    left: 2px !important;
}

/* Directional Lucide icons: mirror horizontally in RTL */
[dir="rtl"] .lucide-arrow-left,
[dir="rtl"] .lucide-arrow-right,
[dir="rtl"] .lucide-chevron-left,
[dir="rtl"] .lucide-chevron-right,
[dir="rtl"] .lucide-chevrons-left,
[dir="rtl"] .lucide-chevrons-right,
[dir="rtl"] .lucide-log-out,
[dir="rtl"] .lucide-log-in,
[dir="rtl"] .lucide-external-link,
[dir="rtl"] .lucide-reply,
[dir="rtl"] .lucide-forward,
[dir="rtl"] .lucide-share,
[dir="rtl"] .lucide-undo,
[dir="rtl"] .lucide-redo,
[dir="rtl"] .lucide-skip-back,
[dir="rtl"] .lucide-skip-forward {
    transform: scaleX(-1);
}