/* =====================================================================
   CREONIO — BASE / DESIGN SYSTEM
   =====================================================================
   Design tokens, reset, global typography, and the small handful of
   micro-components genuinely reused across many pages (buttons, small
   text, badges, empty states, status colors, back/logout buttons).

   Loaded by every page, before any page-specific module.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

:root {
    /* ---------- Surfaces ---------- */
    --bodydarkblue: #090e1a;
    --mainsectionbg: #101a30;
    --cardblue: #16213c;
    --cardbluehover: #1d2a49;
    --cardbluehoverstrong: #263457;
    --tableheadergrey: #2a3654;
    --border-soft: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);

    /* ---------- Surface elevation (3 levels) ----------
       Used on discover_creator / discover_subscriber / messages /
       invitations so nested boxes read as one consistent system
       instead of ad-hoc opacities per page:
       level 1 = outer card (sits on the page background)
       level 2 = a section/bubble inside that card
       level 3 = a small nested chip/stat inside a level-2 section */
    --surface-1: rgba(255, 255, 255, 0.03);
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-3: rgba(255, 255, 255, 0.10);

    /* ---------- Text ---------- */
    --text: #f3f6fb;
    --text-dim: rgba(243, 246, 251, 0.68);
    --text-faint: rgba(243, 246, 251, 0.45);

    /* ---------- Brand ---------- */
    --btnblue: #38bdf8;
    --btnhoverblue: #0ea5e9;
    --logoblue: #00d4ff;
    --accent-2: #22d3ee;
    --gradient-brand: linear-gradient(135deg, #38bdf8 0%, #22d3ee 55%, #00d4ff 100%);

    /* ---------- Status ---------- */
    --alarmred: #eb0049;
    --alarmred-bg: rgba(235, 0, 73, 0.14);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.14);

    /* ---------- Shape & elevation ---------- */
    --radius-sm: 0.5rem;
    --radius-md: 0.9rem;
    --radius-lg: 1.25rem;
    --radius-pill: 999px;
    --shadow-card: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
    --shadow-pop: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-glow: 0 8px 24px rgba(56, 189, 248, 0.28);

    /* ---------- Motion ---------- */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --fast: 0.18s;
    --med: 0.32s;

    /* ---------- Type ---------- */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --font-display: 'Sora', var(--font-body);
}

/* -----------------------------------------------------------------*/
/* -------------------- SCROLL-FLICKER FIX --------------------------*/
/* -----------------------------------------------------------------*/
/* Every main page wrapper below combines a large box-shadow with
   min-height:100vh on content that's usually taller than the actual
   viewport. Chromium has a known repaint bug where an element like
   this briefly flashes to a lighter, unshadowed fill during scroll or
   click-triggered reflows (focus/hover state changes), because the
   browser has to re-rasterize the shadow and can show a stale/blank
   tile for a frame while that finishes.
   NOTE: an earlier version of this fix used `will-change:transform`
   to force these onto their own GPU layer - that's the right tool for
   small, actively-animating elements, but for page-height containers
   like these it backfires: the browser then has to keep and
   re-rasterize one enormous composited layer on every small change
   (e.g. focusing a form field), which is MORE work, not less, and can
   make the flash worse. `contain:paint` is the correct, lighter-weight
   fix here - it tells the browser that nothing inside this box paints
   outside its bounds (and vice versa), so a change inside doesn't
   force repainting or reasoning about anything outside it, without
   the overhead of a dedicated GPU layer for the whole page. */
.dashboard-container,
.settings-container,
.upload-container,
.analytics-container,
.access-container,
.authform-container,
.discover-page,
.content-page {
    contain: paint;
}

/* -----------------------------------------------------------------*/
/* -------------------------- BASE / RESET --------------------------*/
/* -----------------------------------------------------------------*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

html {
    scroll-behavior: smooth;
    background-color: var(--bodydarkblue);
    color-scheme: dark;
}

body {
    width: 100%;
    min-height: 100vh;
    background: var(--bodydarkblue);
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Sitewide text-selection is disabled on purpose to discourage copying
       paid creator content. Kept as a single declaration (was duplicated
       further down the file, which had no effect but was confusing). */
    user-select: none;
    -webkit-user-select: none;
}

::selection {
    background: rgba(56, 189, 248, 0.35);
    color: var(--text);
}

/* Slim custom scrollbar for a more "product" feel */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bodydarkblue);
}

::-webkit-scrollbar-thumb {
    background: var(--cardbluehoverstrong);
    border-radius: var(--radius-pill);
    border: 2px solid var(--bodydarkblue);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--btnblue);
}

a,
:active,
:visited {
    color: var(--text);
    text-decoration: none;
    opacity: 0.8;
}

a:hover {
    opacity: 1;
    transition: opacity var(--fast) var(--ease);
}

/* Visible keyboard focus everywhere, without adding an outline on mouse clicks */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.action-btn:focus-visible,
.btn:focus-visible,
.mini-btn:focus-visible {
    outline: 2px solid var(--btnblue);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

button {
    background: var(--gradient-brand);
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--bodydarkblue);
    font-weight: 700;
    letter-spacing: 0.01rem;
    cursor: pointer;
    transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), opacity var(--fast) var(--ease);
}

button:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
}

h1 {
    font-size: clamp(2.1rem, 1.6rem + 2vw, 3rem);
    letter-spacing: -0.01em;
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
    letter-spacing: -0.005em;
    line-height: 1.2;
}

h3 {
    font-size: 1.2rem;
    letter-spacing: 0.02em;
}

video,
img {
    pointer-events: none;
    user-select: none;
    max-width: 100%;
}


/* ---------- SHARED MICRO-COMPONENTS (used across multiple pages) ---------- */

/* General text-like form fields (text/email/password/date/number/textarea/
   select). Deliberately excludes checkboxes and radios via :not() - those
   need to stay their natural small size and be styled by their own
   component (.category-chip, .toggle-switch, .authform-checkbox, etc.),
   not stretched into a full-width text-field box. A page previously only
   got this exclusion "for free" if whatever component-specific override
   happened to load on it; scoping it here instead means it's impossible
   for a checkbox anywhere on the site to accidentally inherit this. */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: var(--font-body);
    transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-faint);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--btnblue);
    background: rgba(255, 255, 255, 0.06);
}

/* HEADER BUTTONS */

.back-btn,
.logout-btn {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.back-btn:hover,
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}

/* EMPTY */

.empty-box {
    grid-column: 1 / -1;
    padding: 4rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
}

.empty-box p {
    color: var(--text-dim);
    margin-top: 1rem;
}

.account-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.mini-btn {
    background: var(--cardbluehoverstrong);
    border: 1px solid var(--border-soft);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.mini-btn:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.mini-btn.has-action {
    background: var(--alarmred-bg);
    color: #ff5c8a;
    border-color: rgba(235, 0, 73, 0.35);
}

.mini-btn.has-action:hover {
    background: var(--alarmred);
    color: white;
}

.mini-btn.danger {
    background: var(--alarmred-bg);
    color: #ff5c8a;
    border-color: rgba(235, 0, 73, 0.35);
}

.mini-btn.danger:hover {
    background: var(--alarmred);
    color: white;
}

.mini-btn.coupon-btn {
    background: rgba(234, 179, 8, 0.14);
    color: #eab308;
    border-color: rgba(234, 179, 8, 0.35);
}

.mini-btn.coupon-btn:hover {
    background: #eab308;
    color: var(--bodydarkblue);
}

/* STATUS */

.status {
    padding: 1rem 0;
    font-weight: 700;
}

.active {
    color: var(--success);
}

.inactive {
    color: var(--alarmred);
}

/* MAIN BUTTONS */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    padding: 1rem 1.4rem;
    border-radius: var(--radius-md);
    background: var(--gradient-brand);
    color: var(--bodydarkblue);
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn.secondary {
    background: var(--tableheadergrey);
    color: var(--text);
}

.btn.secondary:hover {
    box-shadow: none;
    background: var(--cardbluehoverstrong);
}

/* SMALL TEXT */

.small {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 1rem;
    line-height: 1.5;
}

/* ---------- More shared micro-components (used across 2+ page modules) ---------- */

.creator-badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--cardbluehoverstrong);
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.creator-badge.adult-badge {
    background: var(--alarmred-bg);
    color: #ff5c8a;
    margin-left: 0.4rem;
}

.creator-badge.listed-badge {
    background: var(--success-bg);
    color: var(--success);
    margin-bottom: 0.75rem;
}

.authform-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.authform-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-dim);
    cursor: pointer;
}

.authform-checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.authform-checkbox a {
    color: var(--btnblue);
    opacity: 1;
    text-decoration: underline;
}

.creators-footer {
    width: 100%;
    padding: 2rem 0;
    text-align: center;
    opacity: 0.7;
}

