/* ============================================================
   ABOODVIDEO Viewer Design System — Base (V1)
   Global resets, RTL alignment, native typography, scrollbars,
   container layout, and accessibility utilities.
   ============================================================ */

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

html {
    direction: rtl;
    text-align: right;
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--v-bg);
    background-image: radial-gradient(circle at 50% -15%, #132238 0%, #090e17 60%);
    background-attachment: fixed;
    color: var(--v-text-primary);
    font-family: var(--v-font);
    line-height: 1.6;
    letter-spacing: -0.01em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Focus Rings & Accessibility --- */
:focus-visible {
    outline: 2px solid var(--v-border-focus);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Container & Layout --- */
.viewer-container {
    width: 100%;
    max-width: var(--v-container-max);
    margin-inline: auto;
    padding-inline: clamp(16px, 3.2vw, 40px);
}

.viewer-main {
    flex: 1 0 auto;
    padding-block-start: var(--v-header-height);
    padding-block-end: 64px;
    width: 100%;
}

/* --- Native Arabic Typography --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--v-text-primary);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.35rem); }

p {
    color: var(--v-text-secondary);
    margin-bottom: 0.85rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--v-transition-fast);
}

img, video, canvas {
    display: block;
    max-width: 100%;
}

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

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

::-webkit-scrollbar-thumb {
    background: #1e2c44;
    border-radius: var(--v-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: #2b3d5c;
}

/* --- Utility Classes (Strict CSP Compliant) --- */
.ltr-text {
    direction: ltr;
    display: inline-block;
    unicode-bidi: isolate;
}

.bidi-text {
    unicode-bidi: isolate;
    text-align: start;
    direction: rtl;
}

.ltr-inline {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--v-text-muted);
    font-size: 0.95rem;
}

/* --- 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;
    }
}
