/* ============================================================
   FansXpress Premium Design System
   Global polish layer: typography, motion, micro-interactions.
   Theme-aware (uses --primary etc. from the generated theme),
   zero external resources, respects prefers-reduced-motion.
   ============================================================ */

/* ---------- Typography: premium system stack, zero download ---------- */
body {
    font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system,
        'SF Pro Text', 'Helvetica Neue', Roboto, Arial, sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    letter-spacing: -.02em;
    font-weight: 700;
}

/* ---------- Smooth everything (micro-interactions) ---------- */
a,
button,
.btn,
.h-pill,
.nav-link,
.dropdown-item,
.list-group-item,
input.form-control,
textarea.form-control,
select.form-control {
    transition: color .18s ease, background-color .18s ease, border-color .18s ease,
        box-shadow .18s ease, transform .18s ease, opacity .18s ease;
}

/* ---------- Buttons: lift on hover, press on click ---------- */
.btn:not(.disabled):not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
}

.btn:not(.disabled):not(:disabled):active {
    transform: translateY(0) scale(.98);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}

/* ---------- Pills & menu items ---------- */
.h-pill:hover,
.dropdown-item:hover {
    transform: translateY(-1px);
}

.user-side-menu .nav-link:hover .side-menu-label {
    transform: translateX(2px);
}

.user-side-menu .side-menu-label {
    transition: transform .18s ease;
}

/* ---------- Cards & post boxes: soft elevation ---------- */
.post-box,
.card {
    transition: box-shadow .25s ease, transform .25s ease;
}

.post-box:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, .09);
}

/* ---------- Inputs: theme-colored focus glow ---------- */
.form-control:focus {
    border-color: var(--primary, #d10054) !important;
    box-shadow: 0 0 0 3px rgba(209,0,84, .14) !important;
}

@supports (color: color-mix(in srgb, red 50%, transparent)) {
    .form-control:focus {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #d10054) 16%, transparent) !important;
    }
}

/* ---------- Avatars: gentle zoom ---------- */
img.rounded-circle {
    transition: transform .2s ease;
}

a:hover > img.rounded-circle,
a:hover img.rounded-circle {
    transform: scale(1.05);
}

/* ---------- Themed scrollbar ---------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(138, 150, 163, .45);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary, #d10054);
}

/* ---------- Scroll-reveal entrance (class added by fx-premium.js) ---------- */
@keyframes fxFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.fx-reveal {
    opacity: 0;
}

.fx-reveal.fx-in {
    animation: fxFadeUp .45s cubic-bezier(.22, .8, .36, 1) forwards;
}

/* ---------- Media fade-in on load (classes added by fx-premium.js only,
   so images stay visible even if JS never runs) ---------- */
.post-media img.fx-fade {
    opacity: 0;
    transition: opacity .35s ease;
}

.post-media img.fx-fade.fx-loaded {
    opacity: 1;
}

/* ---------- Accessibility: visible keyboard focus, calmer motion ---------- */
:focus-visible {
    outline: 2px solid var(--primary, #d10054);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .fx-reveal,
    .post-media img.fx-fade {
        opacity: 1;
    }
}

/* ============================================================
   GLOBAL floating labels — reusable everywhere via .fx-float markup:
     <div class="fx-float">
         <input class="form-control" placeholder=" ">
         <label>Label</label>
     </div>
   Add class .fx-float-active (JS) on focus / when filled to float the label.
   .fx-float-pw wraps a password-reveal-field; .fx-float-select wraps a <select>.
   Theme-aware (light/dark) + site pink focus. Uses vars WITH !important so
   Bootstrap can't override, and falls back to hardcoded colours if a var is
   ever missing. Write the markup — never re-write this CSS again.
   ============================================================ */
/* -----------------------------------------------------------------
   WEBSITE-WIDE input rule (every .form-control). HARDCODED colours (no vars):
   light input bg = #fff, dark = #2e2e2e — the SAME values the floating-label
   patch uses, so the border is never visible through the label. `body.fx-theme-*`
   prefix beats Bootstrap's disabled/readonly grey regardless of load order.
   ----------------------------------------------------------------- */
/* LIGHT: every input #fff (never grey), even disabled/readonly */
body.fx-theme-light .form-control,
body.fx-theme-light .form-control:disabled,
body.fx-theme-light .form-control[readonly],
body.fx-theme-light .form-control:disabled[readonly] {
    background-color: #ffffff !important;
    background-image: none !important;
    color: #16181c !important;
    opacity: 1 !important;
}
/* DARK: every input #2e2e2e */
body.fx-theme-dark .form-control,
body.fx-theme-dark .form-control:disabled,
body.fx-theme-dark .form-control[readonly],
body.fx-theme-dark .form-control:disabled[readonly] {
    background-color: #2e2e2e !important;
    background-image: none !important;
    color: #e4e6eb !important;
    opacity: 1 !important;
}
/* selects: same theme bg but KEEP the dropdown arrow (no background-image reset) */
body.fx-theme-light .custom-select,
body.fx-theme-light .custom-select:disabled {
    background-color: #ffffff !important;
    color: #16181c !important;
    opacity: 1 !important;
}
body.fx-theme-dark .custom-select,
body.fx-theme-dark .custom-select:disabled {
    background-color: #2e2e2e !important;
    color: #e4e6eb !important;
    opacity: 1 !important;
}
/* normal border = 1px (our default). focus = 1.5px pink border, no glow/ring. */
.form-control,
.custom-select {
    border-width: 1px !important;
}
.form-control:focus,
.custom-select:focus {
    border-color: #d10054 !important;
    border-width: 1.5px !important;
    box-shadow: none !important;   /* no ring — just a slightly thicker pink border */
    outline: none !important;
}
/* the sidebar search box keeps its own look */
.search-box-wrapper .form-control { background-color: initial; }
.search-box-wrapper .form-control:focus { border-width: 1px !important; }

/* -----------------------------------------------------------------
   Floating labels — ONE system, class .fx-float. The legacy floating classes
   (.float-label-group in auth, .checkout-float-field in the tip modal) are
   aliased here so every floating field on the site shares this exact look.
   Keeps OUR border (from .form-control); label floats + its patch masks the
   border with the theme colour so no border shows through the text.
   ----------------------------------------------------------------- */
.fx-float,
.float-label-group,
.checkout-float-field { position: relative; }
.fx-float > .form-control,
.fx-float .password-reveal-field .form-control,
.float-label-group > .form-control,
.float-label-group .password-reveal-field .form-control,
.checkout-float-field > .form-control {
    height: auto;
    padding: .85rem .8rem .4rem;
}
.fx-float > label,
.float-label-group > label,
.checkout-float-field > label {
    position: absolute;
    top: 50%;
    left: .85rem;
    margin: 0;
    padding: 0 .35rem;
    transform: translateY(-50%);
    color: #8a929b;
    font-size: .95rem;
    line-height: 1.4;   /* taller patch so it fully covers the border under the text */
    pointer-events: none;
    /* resting label sits inside the field (no border to mask) → no patch needed.
       The floated state sets a solid #fff/#2e2e2e patch (below). */
    background: transparent;
    transition: top .12s ease, transform .12s ease, font-size .12s ease, color .12s ease;
    z-index: 2;
    max-width: calc(100% - 1.4rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* FLOATED state. Triggered THREE ways so the label is never caught sitting on top of a
   pre-filled field's text before JavaScript runs:
     1. .fx-float-active .............. added by JS (kept for back-compat / focus animation)
     2. :focus-within ................. the field is focused (pure CSS)
     3. .form-control:not(:placeholder-shown) .. the field already holds a value (pure CSS).
        Every input ships placeholder=" ", so a filled field is NOT showing its placeholder →
        its label floats on the very FIRST paint, with no wait for scripts. This is the fix for
        the ugly flash where "Username" / "Full name" overlapped their values on load. */
.fx-float.fx-float-active > label,
.float-label-group.fx-float-active > label,
.checkout-float-field.fx-float-active > label,
.fx-float:focus-within > label,
.float-label-group:focus-within > label,
.checkout-float-field:focus-within > label,
.fx-float > .form-control:not(:placeholder-shown) ~ label,
.float-label-group > .form-control:not(:placeholder-shown) ~ label,
.checkout-float-field > .form-control:not(:placeholder-shown) ~ label {
    top: 0;
    transform: translateY(-50%) scale(.82);
    transform-origin: left center;
    color: #d10054 !important;
    /* solid patch directly on the floated label — light (this rule) + dark (below) */
    background: #ffffff !important;
    border-radius: 5px;
    /* floated + scaled(.82): give it room so long labels aren't clipped */
    max-width: 130%;
    overflow: visible;
    text-overflow: clip;
}
/* dark theme: patch = dark field colour */
body.fx-theme-dark .fx-float.fx-float-active > label,
body.fx-theme-dark .float-label-group.fx-float-active > label,
body.fx-theme-dark .checkout-float-field.fx-float-active > label,
body.fx-theme-dark .fx-float:focus-within > label,
body.fx-theme-dark .float-label-group:focus-within > label,
body.fx-theme-dark .checkout-float-field:focus-within > label,
body.fx-theme-dark .fx-float > .form-control:not(:placeholder-shown) ~ label,
body.fx-theme-dark .float-label-group > .form-control:not(:placeholder-shown) ~ label,
body.fx-theme-dark .checkout-float-field > .form-control:not(:placeholder-shown) ~ label {
    background: #2e2e2e !important;
}
.fx-float.fx-float-pw .password-reveal-toggle,
.float-label-group .password-reveal-toggle { z-index: 3; }

/* Hide all horizontal rules site-wide (user request). */
hr { display: none !important; }
