/*
 * gics-theme.css - restyles RLICApi's existing Bootstrap 5 markup (Views/Home/Index,
 * ApiTester, ApiGuide, shared via _Layout.cshtml) to match the organization's GICS
 * (GroupInsuranceClaimSettlement) visual style: green/white theme, soft-shadowed card
 * panels, gradient buttons, dark-green navbar.
 *
 * Deliberately additive/override-only - it re-skins Bootstrap's own classes (.navbar,
 * .card, .btn-primary, .table, .badge, .alert, .form-control) rather than introducing new
 * markup, since these three pages already have working JS wired to existing element ids.
 * Loaded after Bootstrap's own stylesheet in _Layout.cshtml so these rules win.
 *
 * Palette/shape values are taken directly from GICS's own src/GICS.Web/wwwroot/css/site.css.
 */

:root {
    --gics-green-darker: #10331c;
    --gics-green-dark: #1b5e31;
    --gics-green: #2e8b45;
    --gics-accent: #3fae57;
    --gics-green-soft: #e6f4e9;
    --gics-green-light: #eef6ee;

    --surface: #ffffff;
    --surface-muted: #f4f7f4;
    --ink: #1d2b21;
    --ink-soft: #5b6b5e;
    --ink-faint: #8a978c;
    --line: #e3eae4;

    --shadow-sm: 0 1px 2px rgba(16, 51, 28, 0.06), 0 1px 3px rgba(16, 51, 28, 0.08);
    --shadow-md: 0 4px 14px rgba(16, 51, 28, 0.1);
    --shadow-lg: 0 12px 34px rgba(16, 51, 28, 0.16);

    --radius: 14px;
    --radius-sm: 10px;
}

body {
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(63, 174, 87, 0.07), transparent 60%),
        var(--surface-muted);
    font-family: "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: rgba(63, 174, 87, 0.25);
}

/* ---------- Navbar (portal-style gradient, replaces Bootstrap's navbar-dark bg-dark) ---------- */

.navbar.bg-dark {
    background: linear-gradient(90deg, var(--gics-green-darker), var(--gics-green)) !important;
    box-shadow: var(--shadow-md);
}

.navbar.bg-dark .navbar-brand {
    font-weight: 800;
    letter-spacing: 0.04em;
}

.navbar.bg-dark .navbar-text {
    color: #d5ead7 !important;
}

.navbar.bg-dark .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.14);
}

/* ---------- Hero band under the navbar ---------- */

.bg-light.border-bottom {
    background:
        radial-gradient(700px 260px at 90% -20%, rgba(63, 174, 87, 0.1), transparent 60%),
        var(--gics-green-light) !important;
    border-bottom-color: var(--line) !important;
}

.bg-light.border-bottom h1 {
    color: var(--gics-green-dark);
    letter-spacing: -0.01em;
}

/* ---------- Cards ---------- */

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-title {
    color: var(--gics-green-dark);
    font-weight: 700;
}

/* ---------- Buttons ---------- */

.btn {
    border-radius: 9px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gics-green), var(--gics-green-dark));
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(46, 139, 69, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(46, 139, 69, 0.38);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    color: var(--gics-green-dark);
    border-color: var(--gics-accent);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--gics-green);
    border-color: var(--gics-green);
    color: #fff;
}

.btn-outline-secondary:hover {
    background-color: var(--surface-muted);
}

/* ---------- Forms ---------- */

.form-control,
.form-select {
    border-radius: 9px;
    border-color: #d8e2d9;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gics-accent);
    box-shadow: 0 0 0 0.2rem rgba(63, 174, 87, 0.18);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* ---------- Tables (ApiGuide's endpoint/reference tables) ---------- */

.table thead th {
    background-color: var(--gics-green-light);
    color: var(--gics-green-dark);
    border-bottom: 2px solid #d5e6d6;
    white-space: nowrap;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(63, 174, 87, 0.06);
}

/* ---------- Badges (method/auth/status chips in ApiTester and ApiGuide) ---------- */

.badge {
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 20px;
}

.badge.bg-success {
    background-color: #dcf3e1 !important;
    color: #1c7d33 !important;
}

.badge.bg-warning {
    background-color: #fbf3d9 !important;
    color: #a16207 !important;
}

.badge.text-bg-light {
    background-color: var(--gics-green-light) !important;
    color: var(--gics-green-dark) !important;
    border-color: var(--line) !important;
}

/* ---------- Alerts ---------- */

.alert {
    border-radius: var(--radius-sm);
    border: none;
    box-shadow: var(--shadow-sm);
}

/* ---------- Footer ---------- */

footer.border-top {
    border-top-color: var(--line) !important;
    color: var(--ink-faint);
}

/* ---------- Endpoint cards (ApiTester's JS-generated .card.endpoint-card) ---------- */

.endpoint-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.endpoint-card:hover {
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   App shell: left sidebar + top bar (2026-10)
   ==========================================================================
   Replaces the old per-page "navbar full of buttons" pattern (every console
   page - Index, ApiGuide, ApiTester, RoleAdmin, ApiCatalogAdmin, ServerRouting,
   ConnectedUsers, HomeBanners, Notifications, SplashScreen - used to hand-roll
   its own <nav> with its own subset of links, which is exactly why the menu
   looked different from page to page. _Layout.cshtml now renders ONE sidebar
   (grouped menu -> submenu, same on every page) and ONE top bar (just the
   page title and a Log out button - no links) for every page except Login,
   which keeps its own plain header since nobody is signed in yet there.
   Same green/gradient language as the rest of this stylesheet, following the
   organization's GICS app-shell pattern (dark-green gradient sidebar, bright
   gradient-pill active link, translucent blurred top bar). */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background:
        radial-gradient(420px 260px at -20% 0%, rgba(63, 174, 87, 0.22), transparent 65%),
        linear-gradient(180deg, var(--gics-green-dark) 0%, var(--gics-green-darker) 65%, #0c2416 100%);
    color: #e7f3e9;
    display: flex;
    flex-direction: column;
}

.app-sidebar-brand {
    padding: 1.1rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.app-sidebar-brand .brand-mark {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #ffffff;
    background: linear-gradient(90deg, #ffffff, #b9e4c3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-sidebar-brand .brand-sub {
    font-size: 0.7rem;
    color: #9ecba7;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.15rem;
}

.app-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem 0.6rem 1.5rem;
}

.nav-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-group-list > li {
    margin-bottom: 2px;
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    color: #dcefe0;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color 0.16s ease, color 0.16s ease;
    cursor: pointer;
}

.nav-group-toggle::after {
    content: "";
    margin-left: auto;
    width: 7px;
    height: 7px;
    border-right: 2px solid rgba(233, 246, 236, 0.65);
    border-bottom: 2px solid rgba(233, 246, 236, 0.65);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.nav-group-toggle.nav-link-flat::after {
    content: none;
}

.nav-group-toggle.collapsed::after {
    transform: rotate(-45deg);
}

.nav-group-toggle:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-group-toggle.group-active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-group-toggle.nav-link-flat.active {
    color: #ffffff;
    background: linear-gradient(90deg, var(--gics-accent), var(--gics-green));
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.nav-sub-list {
    list-style: none;
    margin: 0.15rem 0 0.35rem;
    padding: 0.2rem 0 0.3rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    margin-left: 1.35rem;
}

.nav-sub-list.collapsed {
    display: none;
}

.nav-sub-list li a {
    display: block;
    padding: 0.42rem 0.85rem;
    margin: 1px 0.35rem 1px 0.55rem;
    color: #b9d8bf;
    text-decoration: none;
    font-size: 0.855rem;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-sub-list li a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.09);
    transform: translateX(2px);
}

.nav-sub-list li a.active {
    color: #ffffff;
    background: linear-gradient(90deg, var(--gics-accent), var(--gics-green));
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.nav-sub-list li a[data-requires-permission].d-none,
.nav-group-list [data-requires-permission].d-none {
    display: none;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    padding: 0.7rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    font-weight: 700;
    color: var(--ink);
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.topbar-user {
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--gics-green-dark);
    padding: 0.25rem 0.4rem;
    margin-right: 0.25rem;
}

.sidebar-backdrop {
    display: none;
}

.app-content {
    padding: 1.6rem 1.75rem;
    flex: 1;
}

/* Below this width the sidebar becomes an off-canvas drawer opened by the hamburger button
   rather than pushing the page content over - there isn't room for both. */
@media (max-width: 860px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow-lg);
    }

    .app-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: inline-block;
    }

    .app-shell.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(10, 25, 15, 0.45);
        z-index: 1040;
    }

    .app-content {
        padding: 1.1rem 1rem;
    }
}
