﻿/* ============================================================
   WOHC Insight — Modern UI Refresh
   ------------------------------------------------------------
   Drop this in /Content/site-modern.css and reference from
   Site.Master after the Bootstrap bundle so it cleanly
   overrides the old patterns.
   ============================================================ */

/* Heading font — Inter (geometric sans, modern, professional).
   Body keeps the system font stack for fast, native feel. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&display=swap');

:root {
    /* ---------- Brand palette ---------- */
    --wohc-navy: #1f4068; /* deep navy — primary brand */
    --wohc-navy-dark: #173053; /* hover/active */
    --wohc-navy-light: #2c5282; /* lighter navy for accents */
    --wohc-blue: #4a7ab5; /* legacy lighter blue */
    --wohc-accent: #2f80ed; /* CTA blue */
    /* ---------- Surfaces & text ---------- */
    --bg-page: #f4f6fa; /* page background */
    --bg-card: #ffffff; /* cards, modals */
    --bg-subtle: #fafbfd; /* subtle alt rows */
    --border-soft: #e5e9f0; /* light borders */
    --border-medium: #d1d8e0; /* form borders */

    --text-primary: #1f2d3d; /* headings */
    --text-body: #2c3e50; /* paragraph */
    --text-muted: #6b7785; /* labels, captions */
    --text-faint: #8a93a0; /* footer, hints */
    /* ---------- Status ---------- */
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    /* ---------- Spacing & shape ---------- */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 30, 60, 0.05);
    --shadow-md: 0 2px 8px rgba(15, 30, 60, 0.08);
    --shadow-lg: 0 8px 24px rgba(15, 30, 60, 0.10);
    --shadow-nav: 0 2px 6px rgba(15, 30, 60, 0.12);
}

/* ============================================================
   Typography & base
   ============================================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Account for fixed-top navbar (navbar is 64px tall) */
    padding-top: 64px;
    margin: 0;
}

/* Kill any extra top padding Bootstrap or legacy CSS adds to the
   main container — we already account for the navbar via body
   padding-top, anything else just creates a gap. */
.body-content,
.container.body-content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Many legacy pages start with a stray <br /> inside the content
   placeholder for spacing — under the new design that creates an
   awkward gap above the page title. Hide leading <br>s. */
[id$="MainContent"] > br:first-child,
[id$="MainContent"] > br:first-child + br {
    display: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 32px;
    margin: 0 0 18px;
    line-height: 1.2;
}

h2 {
    font-size: 26px;
    margin: 0 0 16px;
    line-height: 1.25;
}

h3 {
    font-size: 21px;
    margin: 0 0 14px;
    line-height: 1.3;
    font-weight: 600;
}

h4 {
    font-size: 18px;
    margin: 0 0 12px;
    line-height: 1.35;
    font-weight: 600;
}

h5 {
    font-size: 16px;
    margin: 0 0 10px;
    line-height: 1.4;
    font-weight: 600;
}

h6 {
    font-size: 14px;
    margin: 0 0 8px;
    line-height: 1.4;
    font-weight: 600;
}

/* Page-level H1 — when an H1 is the first heading inside .body-content,
   it gets a styled page-header treatment: bigger, with a navy accent
   bar on the left and a subtle bottom border separating it from the
   page content. Works automatically for existing pages without ASPX edits. */
.body-content > h1:first-of-type,
.body-content > form > h1:first-of-type,
[id$="MainContent"] > h1:first-of-type {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    padding: 0 0 16px 16px;
    margin: 0 0 24px;
    border-bottom: 1px solid var(--border-soft);
    border-left: 4px solid var(--wohc-navy);
    background: linear-gradient(90deg, rgba(31, 64, 104, 0.04) 0%, transparent 30%);
    line-height: 1.2;
}

a {
    color: var(--wohc-accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

    a:hover {
        color: var(--wohc-navy-dark);
        text-decoration: underline;
    }

hr {
    border: 0;
    border-top: 1px solid var(--border-soft);
    margin: 24px 0;
}

/* ============================================================
   Navbar — replaces flat #78A5CD with deep navy + polish
   ============================================================ */
.navbar.wohc-nav {
    background: linear-gradient(180deg, var(--wohc-navy) 0%, var(--wohc-navy-dark) 100%);
    box-shadow: var(--shadow-nav);
    padding: 8px 16px;
    min-height: 64px;
}

    .navbar.wohc-nav .navbar-brand {
        padding: 0;
        margin-right: 24px;
        display: flex;
        align-items: center;
    }

        .navbar.wohc-nav .navbar-brand img {
            height: 38px;
            width: auto;
            transition: opacity 0.15s ease;
        }

        .navbar.wohc-nav .navbar-brand:hover img {
            opacity: 0.85;
        }

    .navbar.wohc-nav .nav-link {
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: 14px;
        font-weight: 500;
        padding: 8px 14px !important;
        border-radius: var(--radius-sm);
        transition: background-color 0.15s ease, color 0.15s ease;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

        .navbar.wohc-nav .nav-link:hover,
        .navbar.wohc-nav .nav-link:focus {
            color: #ffffff !important;
            background-color: rgba(255, 255, 255, 0.12);
        }

        .navbar.wohc-nav .nav-link.dropdown-toggle::after {
            margin-left: 6px;
            border-top-color: rgba(255, 255, 255, 0.7);
        }

        /* Active page highlight */
        .navbar.wohc-nav .nav-link.active,
        .navbar.wohc-nav .nav-item.active > .nav-link {
            background-color: rgba(255, 255, 255, 0.18);
            color: #ffffff !important;
        }

    /* Dropdown menus */
    .navbar.wohc-nav .dropdown-menu {
        margin-top: 4px;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        padding: 6px 0;
        min-width: 240px;
    }

    .navbar.wohc-nav .dropdown-item {
        padding: 8px 18px;
        font-size: 13.5px;
        color: var(--text-body);
        transition: background-color 0.1s ease, color 0.1s ease;
    }

        .navbar.wohc-nav .dropdown-item:hover,
        .navbar.wohc-nav .dropdown-item:focus {
            background-color: var(--bg-subtle);
            color: var(--wohc-navy);
        }

        .navbar.wohc-nav .dropdown-item.active,
        .navbar.wohc-nav .dropdown-item:active {
            background-color: var(--wohc-navy);
            color: #ffffff;
        }

    /* Right-side login/user area */
    .navbar.wohc-nav .navbar-nav.ml-auto .nav-link {
        font-size: 13px;
        color: rgba(255, 255, 255, 0.85) !important;
    }

        .navbar.wohc-nav .navbar-nav.ml-auto .nav-link:hover {
            color: #ffffff !important;
        }

    /* Mobile toggler */
    .navbar.wohc-nav .navbar-toggler {
        border-color: rgba(255, 255, 255, 0.4);
    }

/* ============================================================
   Page container
   ------------------------------------------------------------
   Both `.body-content` (our own wrapper) and Bootstrap's
   built-in `.container` get the wider cap so existing pages
   that use either pattern benefit automatically.
   ============================================================ */
.body-content,
.container.body-content,
.container {
    padding: 8px 24px 40px;
    max-width: 1700px;
    margin: 0 auto;
    width: 100%;
}

/* On very wide monitors (>1800px), keep small breathing room
   on the sides instead of letting content extend edge-to-edge. */
@media (min-width: 1800px) {
    .body-content,
    .container.body-content,
    .container {
        max-width: 1700px;
    }
}

/* ============================================================
   Cards (replaces inline-styled containers)
   ============================================================ */
.wohc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.wohc-card-header {
    margin: -24px -28px 20px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-subtle);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
    letter-spacing: -0.01em;
}

/* ============================================================
   Forms — replaces Bootstrap 3 form-horizontal patterns
   ============================================================ */
.wohc-form .form-group {
    margin-bottom: 18px;
}

.wohc-form label,
.wohc-form .control-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: none;
    text-align: left !important;
    width: auto !important;
    padding: 0 !important;
}

.wohc-form .form-control,
.wohc-form input.form-control,
.wohc-form select.form-control,
.wohc-form textarea.form-control {
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    background-color: #ffffff;
    color: var(--text-body);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    height: auto;
    box-shadow: none;
}

    .wohc-form .form-control:focus {
        border-color: var(--wohc-accent);
        box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
        outline: none;
    }

    .wohc-form .form-control[disabled],
    .wohc-form .form-control[readonly] {
        background-color: var(--bg-subtle);
        color: var(--text-muted);
    }

/* Stack a label/input pair full-width */
.wohc-form .form-group .col-md-10,
.wohc-form .form-group .col-md-8 {
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

/* Help text and validation */
.wohc-form .text-danger {
    display: block;
    font-size: 12px;
    margin-top: 4px;
    color: var(--danger) !important;
}

.wohc-form .form-text,
.wohc-form .form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 18px;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
}

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

    .btn:active {
        transform: translateY(0);
        box-shadow: var(--shadow-sm);
    }

.btn-primary {
    background-color: var(--wohc-navy);
    border-color: var(--wohc-navy);
}

    .btn-primary:hover, .btn-primary:focus {
        background-color: var(--wohc-navy-dark);
        border-color: var(--wohc-navy-dark);
    }

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--border-medium);
    color: var(--text-body);
}

    .btn-secondary:hover, .btn-secondary:focus {
        background-color: var(--bg-subtle);
        border-color: var(--wohc-navy-light);
        color: var(--wohc-navy);
    }

.btn-success {
    background-color: var(--success);
    border-color: var(--success);
}

.btn-danger {
    background-color: var(--danger);
    border-color: var(--danger);
}

.btn-warning {
    background-color: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.btn-sm,
.btn-small {
    font-size: 13px;
    padding: 6px 12px;
}

.btn-xs {
    font-size: 12px;
    padding: 3px 10px;
}

/* Link buttons inside grids — keep them subtle */
a.btn-link, .btn-link {
    box-shadow: none;
    text-decoration: none;
    color: var(--wohc-accent);
    font-weight: 500;
}

    a.btn-link:hover, .btn-link:hover {
        transform: none;
        box-shadow: none;
    }

/* ============================================================
   Tables / GridView
   ============================================================ */
.table {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-soft);
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 16px;
    width: 100%;
}

    .table thead th {
        background-color: var(--bg-subtle);
        color: var(--text-muted);
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border: none;
        border-bottom: 1px solid var(--border-medium);
        padding: 12px 14px;
        text-align: left;
        vertical-align: middle;
        white-space: nowrap;
    }

    .table tbody td {
        padding: 10px 14px;
        border: none;
        border-top: 1px solid var(--border-soft);
        font-size: 13.5px;
        vertical-align: middle;
        color: var(--text-body);
    }

    /* First row in tbody — no double border with header */
    .table tbody tr:first-child td {
        border-top: none;
    }

/* Hover state — clear feedback for which row the user is on */
.table-hover tbody tr {
    transition: background-color 0.1s ease;
}

    .table-hover tbody tr:hover {
        background-color: rgba(47, 128, 237, 0.05);
    }

/* Striping — subtle alternating rows for easier scan-tracking */
.table-striped tbody tr:nth-of-type(even) {
    background-color: var(--bg-subtle);
}

.table-striped.table-hover tbody tr:nth-of-type(even):hover {
    background-color: rgba(47, 128, 237, 0.06);
}

/* Bordered tables — soften the heavy borders to vertical separators */
.table-bordered {
    border: 1px solid var(--border-soft);
}

    .table-bordered thead th,
    .table-bordered tbody td {
        border-right: 1px solid var(--border-soft);
    }

        .table-bordered thead th:last-child,
        .table-bordered tbody td:last-child {
            border-right: none;
        }

/* Empty cell treatment — render a subtle dash so empty cells
   read as "intentionally empty" rather than "missing data". */
.table tbody td:empty::before {
    content: '—';
    color: var(--text-faint);
}

/* Action links inside grid rows — Delete should look destructive. */
.table .btn-link,
.table a {
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.1s ease;
}

    .table a[id*="elete"],
    .table .btn-link[id*="elete"] {
        color: var(--danger);
    }

        .table a[id*="elete"]:hover,
        .table .btn-link[id*="elete"]:hover {
            color: #c0392b;
            text-decoration: underline;
        }

/* Numeric columns — tabular figures for clean column alignment */
.table td.numeric,
.table td.amount {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* Compact variant — for dense data tables, reduces padding. */
.table.table-compact thead th {
    padding: 8px 10px;
    font-size: 10.5px;
}

.table.table-compact tbody td {
    padding: 6px 10px;
    font-size: 12.5px;
}

/* ============================================================
   Modal dialogs
   ============================================================ */
.modal-content {
    border: 0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-soft);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 14px 20px;
}

    .modal-header .modal-title {
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
    }

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border-soft);
    padding: 12px 20px;
}

/* ============================================================
   Tabs (Insight Notes section + page-level tab nav)
   ============================================================ */
.nav-tabs {
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
    margin-bottom: 0;
    padding: 0;
}

    .nav-tabs .nav-item {
        margin-bottom: -1px; /* let active tab overlap the bottom border */
    }

    .nav-tabs .nav-link {
        border: 1px solid transparent;
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        color: var(--text-muted);
        font-weight: 500;
        font-size: 13.5px;
        padding: 9px 16px;
        margin-right: 2px;
        margin-top: 2px;
        margin-bottom: 0;
        background: transparent;
        /* Reserve space for the active-state top accent bar so tabs
       don't shift vertically when activated. */
        border-top: 3px solid transparent;
        transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
        /* Kill any button-style shadow + transform inheritance. */
        box-shadow: none !important;
        transform: none !important;
    }

        .nav-tabs .nav-link:hover {
            color: var(--wohc-navy);
            background-color: var(--bg-subtle);
            border-color: transparent var(--border-soft) transparent var(--border-soft);
            border-top-color: var(--border-soft);
        }

        /* Active tab — subtle accent strip + tinted background.
   The !important is necessary because legacy Site.css had
   .nav-tabs .nav-link.active set to a solid filled blue;
   without these overrides one tab would still render that way. */
        .nav-tabs .nav-link.active,
        .nav-tabs .nav-item.show .nav-link {
            color: var(--wohc-navy) !important;
            background-color: var(--bg-card) !important;
            border-left: 1px solid var(--border-soft) !important;
            border-right: 1px solid var(--border-soft) !important;
            border-bottom-color: var(--bg-card) !important;
            border-top: 3px solid var(--wohc-navy) !important;
            font-weight: 600;
        }

/* Tab panel — sits flush against the active tab */
.tab-content {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 20px;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
    margin-top: 40px;
    padding: 16px 0;
    color: var(--text-faint);
    font-size: 12px;
    text-align: center;
}

    footer p {
        margin: 0;
    }

/* Environment badge */
.env-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

    .env-badge.env-production {
        background: #fef3c7;
        color: #92400e;
    }

    .env-badge.env-development {
        background: #dbeafe;
        color: #1e3a8a;
    }

    .env-badge.env-staging {
        background: #e0e7ff;
        color: #3730a3;
    }

/* ============================================================
   Insight Notes panel — softer styling
   ============================================================ */
.notes-panel-toggle {
    text-align: center;
    padding: 4px 0;
    margin-bottom: 4px;
}

    .notes-panel-toggle a {
        font-size: 13px;
        color: var(--wohc-accent);
        font-style: italic;
    }

.notes-panel-body {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

    /* Yellow note textareas — keep the visual cue but soften */
    .notes-panel-body textarea.form-control {
        background-color: #fffbeb !important;
        border-color: #fde68a !important;
        font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
        font-size: 13px;
    }

/* ============================================================
   Insight home dashboard
   ============================================================ */
.insight-hero {
    text-align: center;
    padding: 60px 20px 40px;
}

    .insight-hero h1 {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        font-size: 42px;
        color: var(--wohc-navy);
        margin-bottom: 8px;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

        .insight-hero h1 img {
            height: 36px;
            margin-left: 6px;
            vertical-align: middle;
        }

/* Inline-SVG lightbulb — modern replacement for the raster
   image. Stroked outline matches the heading navy, with a
   soft pulsing halo behind the bulb. */
.insight-bulb {
    width: 44px;
    height: 44px;
    margin-left: 10px;
    vertical-align: middle;
    display: inline-block;
}

    .insight-bulb .bulb-stroke {
        stroke: var(--wohc-navy);
    }

    .insight-bulb .bulb-glow {
        fill: var(--wohc-navy);
        opacity: 0.08;
        transform-origin: 12px 9px;
        animation: bulbGlow 2.6s ease-in-out infinite;
    }

@keyframes bulbGlow {
    0%, 100% {
        opacity: 0.08;
        transform: scale(0.85);
    }

    50% {
        opacity: 0.18;
        transform: scale(1.05);
    }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .insight-bulb .bulb-glow {
        animation: none;
        opacity: 0.12;
        transform: scale(1);
    }
}

.insight-hero .lead {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.insight-picker {
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 28px 32px;
    box-shadow: var(--shadow-md);
}

    .insight-picker label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: var(--text-muted);
        margin-bottom: 6px;
        text-align: left;
    }

    .insight-picker select {
        width: 100%;
        padding: 10px 14px;
        font-size: 15px;
        line-height: 1.5;
        height: auto;
        border: 1px solid var(--border-medium);
        border-radius: var(--radius-sm);
        background-color: #ffffff;
        color: var(--text-body);
        transition: border-color 0.15s ease, box-shadow 0.15s ease;
        /* Prevent long borrower/loan names from being clipped abruptly —
       browser will show ellipsis on the closed selected value but
       the dropdown list itself displays full text. */
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

        .insight-picker select:focus {
            border-color: var(--wohc-accent);
            box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
            outline: none;
        }

    .insight-picker .checkbox-row {
        margin-top: 8px;
        font-size: 13px;
        color: var(--text-muted);
    }

    .insight-picker .or-divider {
        text-align: center;
        margin: 20px 0;
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.1em;
        position: relative;
    }

        .insight-picker .or-divider::before,
        .insight-picker .or-divider::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 40%;
            height: 1px;
            background: var(--border-soft);
        }

        .insight-picker .or-divider::before {
            left: 0;
        }

        .insight-picker .or-divider::after {
            right: 0;
        }

/* ============================================================
   Mobile / responsive tweaks
   ============================================================ */
@media (max-width: 768px) {
    .body-content {
        padding: 16px 12px 32px;
    }

    .wohc-card {
        padding: 18px 16px;
    }

    .wohc-card-header {
        margin: -18px -16px 16px;
        padding: 12px 16px;
    }

    .insight-hero {
        padding: 40px 16px 24px;
    }

        .insight-hero h1 {
            font-size: 26px;
        }

    .insight-picker {
        padding: 20px;
    }
}
