/**
 * youfree user portal — global theme (Aurora Glass)
 * Shares the landing token system (variables.css). Component visuals live in
 * each .vue's scoped <style>; this file is base + fonts + reusable surfaces.
 */
@import "../css/variables.css";

/* ═══════════ Base ═══════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}
body.rtl { font-family: var(--font-ar); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }
body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4 { font-family: var(--font-ar); letter-spacing: normal; line-height: 1.3; font-weight: 700; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
/* Hide the browser's native search clear (×) — we render our own. */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }

/* --bottomnav-h mirrors BottomNav.vue's rendered height (keep in sync if the
   nav's icon size / padding changes); it offsets immersive reel controls. */
:root { --topbar-h: 4.1rem; --bottomnav-h: calc(3.7rem + env(safe-area-inset-bottom)); }
#user-app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ═══════════ Aurora background (matches the landing) ═══════════ */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--aurora-bg); }
.aurora span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.5; will-change: transform; }
.aurora span:nth-child(1) { width: 46vw; height: 46vw; inset-inline-start: -8vw; top: -10vw; background: radial-gradient(circle, #6AA8FF, transparent 70%); animation: drift1 22s ease-in-out infinite; }
.aurora span:nth-child(2) { width: 40vw; height: 40vw; inset-inline-end: -6vw; top: 2vw; background: radial-gradient(circle, #45D0C9, transparent 70%); animation: drift2 26s ease-in-out infinite; }
.aurora span:nth-child(3) { width: 38vw; height: 38vw; inset-inline-start: 22vw; bottom: -14vw; background: radial-gradient(circle, #5FE0E6, transparent 70%); animation: drift3 30s ease-in-out infinite; opacity: 0.35; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6vw, 5vw) scale(1.1); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-5vw, 7vw) scale(1.08); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(4vw, -6vw) scale(1.12); } }

/* ═══════════ Reusable surfaces ═══════════ */
.glass { background: var(--glass); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow-sm); }
.glass-strong { background: var(--glass-strong); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--pad); }

/* ═══════════ Buttons ═══════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
    padding: 0.72rem 1.3rem; border-radius: var(--pill); border: 1px solid transparent;
    transition: transform var(--ease), box-shadow var(--ease), background var(--ease), opacity var(--ease);
    white-space: nowrap; user-select: none;
}
body.rtl .btn { font-family: var(--font-ar); }
.btn svg { width: 1.05em; height: 1.05em; flex: 0 0 auto; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--grad-brand); color: #fff; box-shadow: 0 14px 34px -12px rgba(30,144,255,0.7); }
.btn--primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 20px 44px -12px rgba(30,144,255,0.8); }
.btn--glass { background: var(--glass); backdrop-filter: var(--glass-blur); border-color: var(--glass-border); color: var(--ink); box-shadow: var(--glass-shadow-sm); }
.btn--glass:not(:disabled):hover { transform: translateY(-2px); background: var(--glass-strong); }
.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:not(:disabled):hover { background: rgba(30,144,255,0.10); color: var(--blue-deep); }
.btn--danger { background: transparent; border-color: rgba(224,87,63,0.45); color: #C0432C; }
.btn--danger:not(:disabled):hover { background: rgba(224,87,63,0.10); }
.btn--block { width: 100%; }
.btn--lg { padding: 0.95rem 1.7rem; font-size: 1.05rem; }
.btn--sm { padding: 0.42rem 0.95rem; font-size: 0.85rem; }

/* ═══════════ Form fields ═══════════ */
.field { margin-bottom: 1.05rem; }
.label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--ink); margin-bottom: 0.45rem; }
.input {
    width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
    background: var(--field-bg); border: 1px solid var(--glass-border);
    border-radius: 0.9rem; padding: 0.8rem 1rem; transition: var(--ease);
}
.input::placeholder { color: var(--hint); }
.input:focus { border-color: var(--blue); background: var(--field-bg-focus); box-shadow: 0 0 0 4px rgba(30,144,255,0.15); outline: none; }
.input.is-invalid { border-color: #FF7A66; }
.field__error { color: #E0573F; font-size: 0.82rem; margin-top: 0.4rem; }
.field__hint { color: var(--muted); font-size: 0.85rem; margin-top: 0.4rem; }

/* ═══════════ Alerts ═══════════ */
.alert { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.85rem 1.05rem; border-radius: 0.9rem; font-size: 0.92rem; font-weight: 500; margin-bottom: 1.1rem; }
.alert--success { background: #E7FBF4; color: #0B7A5C; border: 1px solid #BBF0DF; }
.alert--error { background: #FFEFEC; color: #C0432C; border: 1px solid #FFD4CB; }

/* ═══════════ Auth pages (shared) ═══════════ */
.auth-page__title { font-size: 1.7rem; margin-bottom: 0.4rem; }
.auth-page__sub { color: var(--muted); margin-bottom: 1.6rem; }
.auth-page__switch { text-align: center; margin-top: 1.4rem; color: var(--muted); font-size: 0.92rem; }
.auth-link { color: var(--blue-deep); font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.1rem 0 1.3rem; font-size: 0.9rem; }
.auth-check { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); cursor: pointer; }
.auth-check input { accent-color: var(--blue); }
.auth-otp .input { text-align: center; letter-spacing: 0.45em; font-size: 1.3rem; font-weight: 700; }

/* ═══════════ Video player (Plyr) — brand-themed ═══════════ */
.plyr { --plyr-color-main: var(--blue); border-radius: 1rem; }
.plyr--video { border-radius: 1rem; overflow: hidden; }

/* RTL: mirror the media-viewer nav chevrons so they point the reading direction */
html[dir="rtl"] .viewer__nav svg { transform: scaleX(-1); }
/* RTL: mirror the comment composer send icon */
html[dir="rtl"] .composer__send svg { transform: scaleX(-1); }
/* RTL: utility to mirror directional icons (back arrows, chevrons) */
html[dir="rtl"] .rtl-flip { transform: scaleX(-1); }
/* Dark theme: active sidebar item text is white for contrast */
html[data-theme="dark"] .navitem--active { color: #fff; }

/* ═══════════ Skeletons (shimmer) ═══════════ */
.sk {
    display: block;
    border-radius: 8px;
    background: linear-gradient(100deg, var(--sk-base) 30%, var(--sk-hi) 50%, var(--sk-base) 70%);
    background-size: 200% 100%;
    animation: sk-sweep 1.3s ease-in-out infinite;
}
.sk--circle { border-radius: 50%; }
@keyframes sk-sweep { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* ═══════════ Scrollbar ═══════════ */
* { scrollbar-width: thin; scrollbar-color: rgba(92,112,137,0.4) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(92,112,137,0.35); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(92,112,137,0.55); background-clip: padding-box; }

/* ═══════════ Reduced motion ═══════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .aurora span { animation: none; }
}
