/* ============================================================================
   limitless-feel.css — CSS-only "Limitless" look-and-feel override for
   django-jazzy-tabler (Tabler 1.5.1), shipped by the limitless_admin add-on.

   LOAD ORDER (strict — limitless_admin's overriding admin/base.html and
   registration/base.html enforce exactly this):
     1. vendor/tabler/css/tabler.min.css
     2. jazzy_tabler/css/main.css
     3. THIS FILE        (auto-loaded by the add-on; JAZZY_SETTINGS["custom_css"],
                          if set, still loads after it and keeps the last word)

   All values are our own re-implementation of the *feel* (palette, density,
   geometry) observed in the Limitless BS5 kit. No Limitless assets are used.
   Font: Inter (SIL OFL). Load from Google Fonts or vendor the open-source
   Inter package — NEVER copy the kit's font files.
   ========================================================================== */

/* Inter — vendored from the open-source package (SIL OFL 1.1) via
   @fontsource/inter@5, matching how jazzy already vendors Font Awesome.
   Files: jazzy_tabler/static/jazzy_tabler/fonts/inter/inter-latin-*-normal.woff2
   (relative to this CSS file). NEVER copy the Limitless kit's font files. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter/inter-latin-700-normal.woff2") format("woff2"); }

/* ---------------------------------------------------------------------------
   1. DESIGN TOKENS — :root variables Tabler already exposes.
   Tabler 1.5.x uses light-dark() + color-scheme, so one declaration covers
   both theme modes; jazzy's toggle sets html[data-bs-theme] accordingly.
   ------------------------------------------------------------------------- */
:root {
    /* Palette — Limitless accents on the shared Tailwind gray scale */
    --tblr-primary: #0c83ff;
    --tblr-primary-rgb: 12, 131, 255;
    --tblr-secondary: #247297;
    --tblr-success: #059669;
    --tblr-info: #049aad;
    --tblr-warning: #f58646;
    --tblr-danger: #EF4444;
    --tblr-blue: #0c83ff;
    --tblr-indigo: #5C6BC0;
    --tblr-purple: #8e70c1;
    --tblr-pink: #f35c86;
    --tblr-teal: #26A69A;
    --tblr-yellow: #ffd648;
    --tblr-link-color: light-dark(#0c83ff, #6db5ff);

    /* Surfaces — dark chrome framing a blue-gray canvas, white cards */
    --tblr-body-bg: light-dark(#f1f4f9, #202125);
    --tblr-bg-surface: light-dark(#ffffff, #2c2d33);
    --tblr-bg-surface-secondary: light-dark(#f9fafb, #26272c);
    --tblr-bg-surface-tertiary: light-dark(#f3f4f6, #202125);
    --tblr-bg-forms: light-dark(#ffffff, #2c2d33);

    /* Text — Limitless body text is near-black, not muted gray */
    --tblr-body-color: light-dark(#1F2937, #ffffff);
    --tblr-emphasis-color: light-dark(#1F2937, #ffffff);

    /* Lines & radius (6px base matches Tabler; stated for clarity) */
    --tblr-border-color: light-dark(#D1D5DB, #4d4d51);
    --tblr-border-radius: 0.375rem;
    --tblr-border-radius-sm: 0.25rem;
    --tblr-border-radius-lg: 0.5rem;

    /* Typography */
    --tblr-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    --tblr-body-font-family: var(--tblr-font-sans-serif);
    --tblr-body-font-size: 0.875rem;
    --tblr-body-line-height: 1.5715;

    /* Geometry */
    --tblr-sidebar-width: 18.75rem;          /* 300px (Tabler: 16rem) */

    /* Shadows — Limitless signature: hairline ring + soft lift */
    --tblr-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.125);
    --tblr-box-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --tblr-box-shadow-lg: 0 6px 12px rgba(0, 0, 0, 0.15);

    /* Dropdown density */
    --tblr-dropdown-min-width: 13.75rem;
    --tblr-dropdown-padding-y: 0.625rem;
}

/* ---------------------------------------------------------------------------
   2. CARDS — white, borderless, 6px radius, hairline ring + soft shadow.
   --tblr-card-* are re-defined on .card scope by Tabler, so re-set them here.
   ------------------------------------------------------------------------- */
.card {
    --tblr-card-border-radius: var(--tblr-border-radius);
    --tblr-card-border-width: 0;
    --tblr-card-box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.075), 0 1px 3px rgba(0, 0, 0, 0.125);
    --tblr-card-cap-bg: transparent;
    --tblr-card-cap-padding-y: 0.9375rem;    /* 15px with 20px x-padding */
}
html[data-bs-theme="dark"] .card {
    --tblr-card-box-shadow: 0 0 1px 1px rgba(255, 255, 255, 0.06), 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ---------------------------------------------------------------------------
   3. CHROME — Limitless layout_1 dark topbar + dark sidebar (#252b36).
   Scoped to [data-bs-theme="dark"] chrome elements so JAZZY_UI_TWEAKS
   navbar="light" / sidebar="light" keep working unchanged.
   (Recommended pairing for the feel: JAZZY_UI_TWEAKS navbar="dark",
    sidebar="dark" — jazzy already supports both.)
   ------------------------------------------------------------------------- */
#jazzy-sidebar[data-bs-theme="dark"],
header.navbar[data-bs-theme="dark"] {
    --tblr-bg-surface: #252b36;
    --tblr-navbar-bg: #252b36;
}

/* Topbar: Limitless bar is 63px tall with a faint light hairline below.
   (Header lives inside .page-wrapper in Tabler 1.5's vertical-navbar protocol,
   so scope by element+attribute, not by .page > .) */
.page-wrapper > header.navbar {
    min-height: 3.9375rem;                  /* 63px */
}
header.navbar[data-bs-theme="dark"] {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.1);
}

/* ---------------------------------------------------------------------------
   4. SIDEBAR NAV — the strongest Limitless signature.
   10px/20px links, weight 500, 20px icons with 20px gap, 1px item gaps.
   ------------------------------------------------------------------------- */
#jazzy-sidebar .navbar-nav {
    row-gap: 1px;
}
#jazzy-sidebar .nav-link {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
}
#jazzy-sidebar .nav-link-icon {
    font-size: 1.25rem;                     /* 20px icon (Limitless) */
    width: 1.25rem;
    margin-right: 1.25rem;                  /* Limitless: icon gap = padding-x */
}
#jazzy-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
/* Active item: filled pill-free block, Limitless style */
#jazzy-sidebar[data-bs-theme="dark"] .nav-link.active,
#jazzy-sidebar[data-bs-theme="dark"] .dropdown-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}
#jazzy-sidebar:not([data-bs-theme="dark"]) .nav-link.active,
#jazzy-sidebar:not([data-bs-theme="dark"]) .dropdown-item.active {
    background-color: rgba(var(--tblr-primary-rgb), 0.1);
}

/* Sub-menus: Limitless indents one icon+padding step, no bubble chrome */
#jazzy-sidebar .dropdown-menu .dropdown-item {
    padding-left: 3.75rem;
    font-weight: 400;
}

/* ---------------------------------------------------------------------------
   5. TYPOGRAPHY DETAILS — Limitless headings are 600 with body line-height.
   ------------------------------------------------------------------------- */
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
    font-weight: 600;
    line-height: var(--tblr-body-line-height);
}

/* ---------------------------------------------------------------------------
   6. TABLES — 14px/600 headers with a stronger separator, 12px/20px cells.
   ------------------------------------------------------------------------- */
.table > thead > tr > th {
    padding: 0.75rem 1.25rem;               /* beats .table thead th (0,1,2) */
    font-size: var(--tblr-body-font-size);
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--tblr-emphasis-color);
    background-color: transparent;
    border-bottom-color: #9CA3AF;
}
.table > :not(caption) > * > * {
    padding: 0.75rem 1.25rem;
}
.table > tbody > tr > td {
    border-top-color: var(--tblr-border-color);
}

/* ---------------------------------------------------------------------------
   7. FORMS & BUTTONS — 8px/14px rhythm, 6px radius, tighter focus ring.
   ------------------------------------------------------------------------- */
.form-control, .form-select {
    padding: 0.5rem 0.875rem;
    border-radius: var(--tblr-border-radius);
}
.form-control:focus, .form-select:focus,
.vTextField:focus, .vLargeTextField:focus, .vURLField:focus,
.vIntegerField:focus, .vBigIntegerField:focus, .vDateField:focus, .vTimeField:focus,
select:not(.form-select):not([multiple]):focus {
    border-color: var(--tblr-primary);
    box-shadow: 0 0 0 0.125rem rgba(var(--tblr-primary-rgb), 0.25);
}
.btn {
    padding: 0.5rem 0.875rem;
    font-weight: 400;
    border-radius: var(--tblr-border-radius);
}

/* ---------------------------------------------------------------------------
   10. C3 ROUND 2 — two Limitless behaviors that turned out CSS-reachable
   a) Submenu chevron: jazzy's sidebar submenus are dropdown-toggles whose
      ::after arrow exists in markup — rotating it reproduces the Limitless
      accordion chevron without touching templates.
   b) Page-header styles: the Limitless page-header family (kit showcase:
      content_page_header.html), settings-driven via LIMITLESS_FEEL —
      the overriding admin/base.html stamps ll-header-{band,accent,dark,plain}
      on .page-header. Geometry is the full-bleed strip: negative margins
      cancel the page-body padding.
   ------------------------------------------------------------------------- */
#jazzy-sidebar .dropdown-toggle::after {
    transition: transform 0.3s ease-in-out;
}
#jazzy-sidebar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(90deg);
}

/* Shared band geometry (light strip = kit's .page-header-light) */
.page-wrapper .page-header.ll-header-band,
.page-wrapper .page-header.ll-header-accent,
.page-wrapper .page-header.ll-header-dark {
    border-bottom: var(--tblr-border-width) solid var(--tblr-border-color-translucent);
    box-shadow: var(--tblr-box-shadow-sm);
    /* cancel .page-body padding so the band runs full-bleed */
    margin: -1.25rem -1.25rem 1.25rem;
    padding: 1.5rem 1.25rem;
}
.page-wrapper .page-header.ll-header-band,
.page-wrapper .page-header.ll-header-accent {
    background-color: var(--tblr-bg-surface);
}
/* accent: the kit's border-bottom-primary border-bottom-width-2 signature */
.page-wrapper .page-header.ll-header-accent {
    border-bottom: 2px solid var(--tblr-primary);
}
/* dark: kit's .page-header-dark (#273246; #1a1b1e in dark mode) */
.page-wrapper .page-header.ll-header-dark {
    background-color: #273246;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}
html[data-bs-theme="dark"] .page-wrapper .page-header.ll-header-dark {
    background-color: #1a1b1e;
}
.ll-header-dark .page-title,
.ll-header-dark .breadcrumb,
.ll-header-dark .breadcrumb .breadcrumb-item,
.ll-header-dark .breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
}
.ll-header-dark .breadcrumb-item.active,
.ll-header-dark .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.5);
}
/* plain: stock jazzy/Tabler in-flow header — the skin adds nothing */

/* ---------------------------------------------------------------------------
   11. AUTH PAGES — kit login_simple: a 25rem column, brand inside the card,
       h5 title + muted subtitle, full-width submit. (registration/base.html
       override carries the markup.)
   ------------------------------------------------------------------------- */
.ll-auth {
    max-width: 25rem;
}
.ll-auth .card-body {
    padding: 1.875rem;
}
.ll-auth-brand img {
    height: 48px;
}
.ll-auth-brand .ll-auth-brand-name {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tblr-body-color);
    text-decoration: none;
}

/* ---------------------------------------------------------------------------
   12. ACTIVITY FEEDS — Limitless's icon-chip pattern (kit offcanvas Activity
       feed): soft-tinted rounded chip + normal text, instead of solid colored
       avatars. Used by the history page and the dashboard recent-actions list.
   ------------------------------------------------------------------------- */
.ll-activity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50rem;
    font-size: 1rem;
}

/* ---------------------------------------------------------------------------
   13. SIDEBAR RAIL — Limitless's collapsed icon rail (kit .sidebar-collapsed
       in its icon mode), opt-in via LIMITLESS_FEEL["sidebar"] = "rail".
       jazzy's own .sidebar-collapsed only hides the sidebar, so the rail is
       skin-level CSS. Desktop only; submenus become flyouts.
   ------------------------------------------------------------------------- */
@media (min-width: 992px) {
    .ll-sidebar-rail #jazzy-sidebar {
        --tblr-sidebar-width: 4.375rem;   /* 70px rail */
    }
    .ll-sidebar-rail #jazzy-sidebar .nav-link {
        padding: 0.625rem 0;
        justify-content: center;
    }
    .ll-sidebar-rail #jazzy-sidebar .nav-link-icon {
        margin-right: 0;
    }
    .ll-sidebar-rail #jazzy-sidebar .nav-link-title,
    .ll-sidebar-rail #jazzy-sidebar .dropdown-toggle::after {
        display: none;
    }
    /* brand + user blocks collapse to their mark/avatar */
    .ll-sidebar-rail #jazzy-sidebar .navbar-brand,
    .ll-sidebar-rail #jazzy-sidebar .navbar-brand a {
        justify-content: center;
        margin: 0;
    }
    .ll-sidebar-rail #jazzy-sidebar .navbar-brand .navbar-brand-image {
        margin: 0;
    }
    .ll-sidebar-rail #jazzy-sidebar .navbar-brand h1,
    .ll-sidebar-rail #jazzy-sidebar .flex-fill,
    .ll-sidebar-rail #jazzy-sidebar #jazzy-sidebar-toggle {
        display: none;
    }
    /* submenus fly out next to the rail */
    .ll-sidebar-rail #jazzy-sidebar .dropdown-menu {
        position: fixed;
        left: 4.375rem;
        margin-top: -2.75rem;
        min-width: 13.75rem;
    }
    .ll-sidebar-rail #jazzy-sidebar .dropdown-menu .dropdown-item {
        padding-left: 1.25rem;
    }
}

/* ---------------------------------------------------------------------------
   8b. DARK-MODE BUTTON LEGIBILITY (captain review round 1)
   Tabler's btn-ghost/btn-outline-secondary draw their TEXT from
   --tblr-secondary, which is a deep steel blue (#247297) — fine filled, but
   unreadable as bare text on the dark chrome. Limitless has no ghost buttons;
   its dark neutral buttons are light-gray on #3f4044. Map the ghost/outline
   text to a light steel-gray in dark mode only; filled .btn-secondary keeps
   the exact Limitless #247297 in both modes.
   ------------------------------------------------------------------------- */
html[data-bs-theme="dark"] .btn-ghost-secondary,
html[data-bs-theme="dark"] .btn-outline-secondary {
    --tblr-btn-color: #c2c9d2;
    --tblr-btn-hover-color: #ffffff;
}

/* ---------------------------------------------------------------------------
   9. BADGES, PAGINATION, DROPDOWNS
   ------------------------------------------------------------------------- */
.badge {
    padding: 0.3125rem 0.4375rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--tblr-border-radius-sm);
}
.pagination {
    gap: 0.25rem;
}
.page-link {
    padding: 0.5rem 0.875rem;
    border-radius: var(--tblr-border-radius) !important;
}
.dropdown-menu {
    --tblr-dropdown-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
