/* ============================================================================
   WDS navigation chrome — self-contained plain CSS (no Tailwind, no build step).

   Loaded two ways:
     • admin pages  → via config('adminlte.plugins').WdsNav (active), so it lands
       on every AdminLTE page and cannot be overridden by a page's sections.
     • agent pages  → a plain <link> in layouts.wds.

   Styles the dark grouped sidebar and the top navbar. Everything is namespaced
   under .wds-sidebar / .wds-navbar so it can never touch Bootstrap/AdminLTE
   page content.
   ========================================================================== */

/* ── Sidebar shell ───────────────────────────────────────────────────────── */
.wds-sidebar {
    background: #0F0F14;
    color: #cbd5e1;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    display: flex;
    flex-direction: column;
    width: 250px;
}

/* On AdminLTE the sidebar is the positioned .main-sidebar — keep AdminLTE's own
   positioning (which already sits below the chat-notification bar), just fix the
   width at 250px (matching the content-wrapper margin) and never let it shrink
   to the mini rail; the grouped labels need the width. */
aside.main-sidebar.wds-sidebar { width: 250px !important; overflow-y: auto; }
.sidebar-collapse aside.main-sidebar.wds-sidebar { width: 250px !important; margin-left: 0 !important; }
body.sidebar-collapse .content-wrapper,
body.sidebar-collapse .main-header,
body.sidebar-collapse .main-footer { margin-left: 250px !important; }

/* On the agent shell the sidebar lives in a flex row; make it full-height. */
.wds-shell { display: flex; min-height: 100vh; }
.wds-shell > .wds-sidebar { flex-shrink: 0; align-self: stretch; }

/* ── Brand ───────────────────────────────────────────────────────────────── */
.wds-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 0 24px; height: 78px; flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.wds-brand-link { display: inline-flex; align-items: center; text-decoration: none; }
/* The GoMyHire wordmark (transparent PNG). Fixed height, width auto so it keeps
   its aspect ratio and never overflows the 250px sidebar. */
.wds-brand-logo { height: 34px; width: auto; max-width: 100%; display: block; }

/* ── Sidebar collapse control (the < chevron, replaces the top-bar hamburger) ── */
.wds-collapse-btn {
    margin-left: auto; flex-shrink: 0;
    -webkit-appearance: none; appearance: none;
    background: transparent; border: 0; cursor: pointer;
    width: 30px; height: 30px; border-radius: 8px;
    color: #9ca3af; display: flex; align-items: center; justify-content: center;
    font-size: 20px; line-height: 1; padding: 0;
}
.wds-collapse-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* Collapsed state ─────────────────────────────────────────────────────────────
   Admin shell: the sidebar is the absolutely-positioned .main-sidebar and the
   content/header/footer carry margin-left:250px — slide the sidebar off and drop
   those margins. Agent shell: the sidebar is a flex item in .wds-shell — collapse
   its width so the flex content takes the space. */
body.wds-collapsed aside.main-sidebar.wds-sidebar { margin-left: -250px !important; }
body.wds-collapsed .content-wrapper,
body.wds-collapsed .main-header,
body.wds-collapsed .main-footer { margin-left: 0 !important; }
body.wds-collapsed .wds-shell > .wds-sidebar { width: 0 !important; min-width: 0; overflow: hidden; }

/* Floating re-open handle (the > chevron), a small tab on the left edge, shown
   only while collapsed. Created by wds-nav.js so it exists on both shells. */
#wdsReopen { display: none; }
body.wds-collapsed #wdsReopen {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 50%; left: 0; transform: translateY(-50%);
    z-index: 1100; width: 24px; height: 52px;
    border: 1px solid #e5e7eb; border-left: 0; border-radius: 0 8px 8px 0;
    background: #ffffff; color: #6b7280; cursor: pointer;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.12);
    font-size: 18px; line-height: 1; padding: 0;
}
body.wds-collapsed #wdsReopen:hover { color: #111827; background: #f9fafb; }

/* ── Nav list ────────────────────────────────────────────────────────────── */
.wds-nav { flex: 1; overflow-y: auto; padding: 16px 0; font-size: 14px; }

.wds-group {
    padding: 16px 16px 4px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
    color: #6b7280; font-weight: 600;
}

.wds-link {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px;
    color: #9ca3af; text-decoration: none; line-height: 1.3;
}
.wds-link:hover { background: rgba(255, 255, 255, 0.05); color: #f3f4f6; text-decoration: none; }
.wds-link.wds-top { color: #e5e7eb; font-weight: 500; }
.wds-link.wds-active {
    background: rgba(147, 51, 234, 0.20); color: #fff;
    border-right: 2px solid #a855f7;
}

/* Sidebar unread badge (per-type on chat sub-items, total on the parent). */
.wds-nav-badge {
    margin-left: auto; flex-shrink: 0;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9999px; background: #e74c3c; color: #fff;
    font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
/* In a <summary> the caret follows the badge, so nudge the badge off the edge. */
.wds-sub > summary .wds-nav-badge { margin-right: 6px; }

/* ── Submenu (native <details>) ──────────────────────────────────────────── */
.wds-sub > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 16px; cursor: pointer; user-select: none;
    color: #d1d5db; list-style: none;
}
.wds-sub > summary::-webkit-details-marker { display: none; }
.wds-sub > summary:hover { background: rgba(255, 255, 255, 0.05); }
.wds-caret { color: #6b7280; font-size: 12px; transition: transform 0.15s ease; }
.wds-sub[open] > summary .wds-caret { transform: rotate(90deg); }

/* ── Top navbar (global WDS top bar) ─────────────────────────────────────────
   Matches the WDS quotation header exactly: 78px tall, white with a bottom
   border, title + description on the left, currency pill + action on the right. */
.wds-navbar.main-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb !important;
    height: 78px !important;
    min-height: 78px !important;
    padding: 0 24px !important;
    display: flex !important;
    align-items: center !important;
}
/* The sidebar toggler is kept for collapse, but styled subtly so the bar reads
   as the clean WDS header (title-led), not the old AdminLTE toolbar. */
.wds-navbar .navbar-nav .nav-link[data-widget="pushmenu"] { color: #9ca3af; padding: 8px 10px; }
.wds-navbar .navbar-nav .nav-link[data-widget="pushmenu"]:hover { color: #4b5563; }

/* Page title + description (left of the bar) — text-base / text-xs, like the header. */
.wds-topbar-titles { min-width: 0; padding-left: 12px; line-height: 1.25; }
.wds-topbar-title {
    font-size: 16px; font-weight: 600; color: #111827;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wds-topbar-sub {
    font-size: 12px; color: #6b7280;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Right group: currency pill + optional action in a clean flex row — the exact
   same context as the quotation header's right div (flex items-center gap-3). */
.wds-navbar .wds-topbar-actions {
    display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
/* Admin-only controls (fullscreen + user menu) sit just after, slightly spaced. */
.wds-navbar .wds-topbar-controls { margin-left: 12px; align-items: center; }
.wds-navbar .wds-topbar-controls .nav-link { color: #6b7280; }

/* ── Currency switcher: neutralise native <button> chrome ─────────────────────
   The pill and its dropdown options are <button> elements styled only with
   Tailwind utilities. On the agent/WDS pages Tailwind preflight resets buttons,
   and on the job pages Flowbite's reset does; but on the plain admin pages
   preflight is OFF (so it can't clobber Bootstrap), which left the options
   showing the browser's default button border/background — the boxy look.
   Reset it explicitly here so the switcher renders identically on every page. */
#wdsCurrencyPill,
#wdsCurrencyMenu .wdsCurrencyOption {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    box-shadow: none;
    font-family: inherit;
    cursor: pointer;
    margin: 0;
}
#wdsCurrencyMenu .wdsCurrencyOption {
    background-color: transparent;
    width: 100%;
    text-align: left;
    color: #374151;
    border-radius: 6px;
}
#wdsCurrencyMenu .wdsCurrencyOption:hover { background-color: #faf5ff; }
/* The dropdown container border is intentional; keep it crisp. */
#wdsCurrencyMenu { line-height: 1.4; }

/* ── Chat Hub top-bar button (beside the currency; replaces the old notif bar) ── */
.wds-chat-hub {
    display: inline-flex; align-items: center; gap: 6px; position: relative;
    background: #f3f4f6; color: #374151;
    border-radius: 9999px; padding: 8px 12px;
    font-size: 14px; font-weight: 500; text-decoration: none; line-height: 1;
}
.wds-chat-hub:hover { background: #e5e7eb; color: #111827; text-decoration: none; }
.wds-chat-hub-icon { width: 16px; height: 16px; flex-shrink: 0; }
.wds-chat-hub-label { white-space: nowrap; }
/* Total unread badge on the button. */
.wds-chat-badge {
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9999px; background: #e74c3c; color: #fff;
    font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
