﻿/* wwwroot/css/site-modern.css */

:root {
    /* Modern Black/Zinc Palette (Replaces Blue) */
    --primary: #18181b; /* Zinc 900 (Almost Black) */
    --primary-hover: #27272a; /* Zinc 800 */
    --secondary: #52525b; /* Zinc 500 */
    --bg-app: #f4f4f5; /* Zinc 100 */
    --surface: #ffffff;
    --text-dark: #18181b;
    --text-muted: #71717a;
    --border-color: #e4e4e7;
    --radius-sm: 4px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    background-color: var(--bg-app);
    color: var(--text-dark);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Layout Structure --- */
#mainContentContainer {
    background-color: var(--bg-app);
    min-height: 100vh;
}

.container, .container-fluid {
    padding-bottom: 2rem;
}

/* --- The "Card" Look --- */
.card-modern {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    transition: box-shadow 0.2s;
}

    .card-modern:hover {
        box-shadow: var(--shadow-md);
    }

/* --- Navigation (Sidebar) --- */
#sideMenuContainer {
    background: #09090b !important; /* Zinc 950 */
    border-right: 1px solid #27272a !important;
}

/* --- DATA TABLES (Compact & Consistent) --- */
.table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

    .table thead th {
        background-color: #f4f4f5;
        color: var(--secondary);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.7rem !important; /* Smaller headers */
        letter-spacing: 0.05em;
        border-bottom: 2px solid var(--border-color);
        padding: 0.6rem 0.5rem !important;
    }

    .table tbody td {
        vertical-align: middle;
        padding: 0.4rem 0.5rem !important; /* Tighter padding */
        border-bottom: 1px solid var(--border-color);
        color: var(--text-dark) !important;
        font-size: 0.8rem !important; /* Smaller data text to fit more */
    }

    .table tbody tr:last-child td {
        border-bottom: none;
    }

    .table tbody tr:hover {
        background-color: #f4f4f5;
    }

/* --- MODERN BUTTONS & BOOTSTRAP OVERRIDES --- */
/* Overriding standard Bootstrap primary colors to our Black/Zinc theme globally */
.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
    color: #fff !important;
}

.border-primary {
    border-color: var(--border-color) !important;
}

.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    transition: all 0.2s ease-in-out;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

/* Primary Button (Now Black/Zinc) */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: var(--shadow-sm);
}

    .btn-primary:hover {
        background-color: var(--primary-hover) !important;
        border-color: var(--primary-hover) !important;
        transform: translateY(-1px);
    }

/* Secondary Button */
.btn-secondary, .btn-light {
    background-color: #f4f4f5 !important;
    color: var(--text-dark) !important;
    border-color: #d4d4d8 !important;
}

    .btn-secondary:hover, .btn-light:hover {
        background-color: #e4e4e7 !important;
        border-color: #a1a1aa !important;
    }

/* Outline Variants */
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
    background-color: transparent !important;
}

    .btn-outline-primary:hover {
        background-color: var(--primary) !important;
        color: #fff !important;
    }

.btn-outline-secondary {
    color: var(--secondary) !important;
    border-color: #d4d4d8 !important;
}

    .btn-outline-secondary:hover {
        background-color: #f4f4f5 !important;
        color: var(--text-dark) !important;
    }

/* --- Form Elements --- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    box-shadow: none;
}

    .form-control:focus, .form-select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.1);
    }

/* Tabs */
.nav-pills .nav-link {
    border-radius: var(--radius-sm);
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
}

    .nav-pills .nav-link.active {
        background-color: var(--primary);
        color: #fff;
    }

/* Tabs */
.nav-pills .nav-link {
    border-radius: var(--radius-sm);
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
}

    .nav-pills .nav-link.active {
        background-color: var(--primary);
        color: #fff;
    }

/* --- Pagination Overrides (Removing default blue) --- */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--text-dark);
    border-color: var(--border-color);
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

    .page-link:hover, .page-link:focus {
        color: var(--primary);
        background-color: #f4f4f5;
        border-color: #d4d4d8;
        box-shadow: none; /* Removes the blue focus ring */
    }

/* The active selected page */
.page-item.active .page-link {
    z-index: 3;
    color: #ffffff;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Disabled pages (e.g., the ellipsis ...) */
.page-item.disabled .page-link {
    color: var(--text-muted);
    pointer-events: none;
    background-color: transparent;
    border-color: transparent;
}

/* The active selected page */
.page-item.active .page-link {
    z-index: 3;
    color: #ffffff;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Disabled pages (e.g., the ellipsis ...) */
.page-item.disabled .page-link {
    color: var(--text-muted);
    pointer-events: none;
    background-color: transparent;
    border-color: transparent;
}

/* --- Global Image Adjustments --- */
/* Makes the white background of the JPG logo invisible against light surfaces */
img[src*="bcs-logo.jpg"] {
    mix-blend-mode: multiply;
}

/* ======================================================== */
/* --- COLLAPSED SIDEBAR (SLIM MODE + POP-OUT MENUS) ---    */
/* ======================================================== */

/* Force containers to let absolute pop-ups break out of bounds */
html.sidebar-collapsed #sideMenuContainer,
html.sidebar-collapsed #sideMenu,
html.sidebar-collapsed .sidebar-scroll-area {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    overflow: visible !important;
}

html.sidebar-collapsed #mainContentContainer {
    margin-left: 70px !important;
}

/* Hide all text and chevrons completely */
html.sidebar-collapsed .sidebar-header-container .sidebar-text, /* <--- Hides "Metric" */
html.sidebar-collapsed .menu-header-row .sidebar-text,
html.sidebar-collapsed .menu-header-row .arrow,
html.sidebar-collapsed .account-btn-content .sidebar-text,
html.sidebar-collapsed .menu-sub-item a {
    display: none !important;
}

/* Restructure the header to stack logo and toggle button */
html.sidebar-collapsed .sidebar-header-container {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 15px 0 !important;
}

html.sidebar-collapsed .sidebar-logo-dots {
    margin-right: 0 !important;
}

html.sidebar-collapsed #sidebarToggleBtn {
    margin-top: 15px;
}

/* --- Centering Icons --- */
html.sidebar-collapsed .menu-header-content,
html.sidebar-collapsed .account-btn-content {
    justify-content: center !important;
    width: 100%;
}

html.sidebar-collapsed .sidebar-icon-margin {
    margin: 0 !important;
    font-size: 1.35rem !important; /* Emphasize icon since it's the only UI */
}

/* --- Sidebar Sub-Menu Pop-outs --- */
html.sidebar-collapsed .nav-item-container {
    position: relative; /* Anchor for absolute menu */
}

html.sidebar-collapsed .menu-collapse {
    display: none !important; /* Force hide normal accordion behavior */
}

    html.sidebar-collapsed .menu-collapse.show {
        display: block !important;
        position: absolute;
        top: 0;
        left: 70px;
        width: 260px;
        background-color: #0f172a;
        border: 1px solid #1e293b;
        border-left: none;
        border-radius: 0 8px 8px 0;
        box-shadow: 4px 4px 15px rgba(0,0,0,0.5);
        z-index: 1060; /* Layer on top of main data tables */
        padding: 0.5rem 0;
    }

        /* Bring back the text specifically inside the pop-out */
        html.sidebar-collapsed .menu-collapse.show .menu-sub-item a {
            display: inline-block !important;
        }

        html.sidebar-collapsed .menu-collapse.show .sidebar-icon-margin {
            margin-right: 0.5rem !important;
            font-size: 1.05rem !important;
        }

        html.sidebar-collapsed .menu-collapse.show .sub-item-content {
            justify-content: flex-start !important;
            padding: 8px 16px !important;
        }

/* --- Account Menu Pop-out --- */
/* Remove default Bootstrap dropdown chevron */
html.sidebar-collapsed .account-btn::after {
    display: none !important;
}

html.sidebar-collapsed .account-btn {
    padding: 0.75rem 0 !important;
}

html.sidebar-collapsed .sidebar-account-container {
    padding: 10px !important;
}

    /* Override Popper.js positioning to snap exactly to the right edge */
    html.sidebar-collapsed .sidebar-account-container .dropup .dropdown-menu {
        top: auto !important;
        bottom: 0 !important;
        left: 70px !important;
        transform: none !important;
        margin-bottom: 0 !important;
        border-radius: 0 8px 8px 0;
        box-shadow: 4px 4px 15px rgba(0,0,0,0.5);
        min-width: 220px;
    }

    /* Bring text back for account dropdown items */
    html.sidebar-collapsed .sidebar-account-container .dropdown-menu .sidebar-text,
    html.sidebar-collapsed .sidebar-account-container .dropdown-menu a {
        display: inline-block !important;
    }

    html.sidebar-collapsed .sidebar-account-container .dropdown-menu i {
        margin-right: 0.5rem !important;
    }
