/**
 * app_v2.css — layout overrides for Bootstrap 5 / Tabler POC
 */

/* ── Full-height flex body ─────────────────────────────────────────── */
html { height: 100%; }

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Tabler sticky navbar is flex-shrink 0 by default; make sure footer is too */
.privacy-footer {
    flex-shrink: 0;
    height: 30px;
    background-color: rgba(220, 220, 220, 1);
    padding: 4px 12px;
    font-size: 12px;
}

.privacy-footer-login {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background-color: rgba(220, 220, 220, 1);
    padding: 4px 12px;
    font-size: 12px;
    text-align: center;
    z-index: 1000;
}

/* ── App content area (below navbar, above footer) ─────────────────── */
#app-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Top action bar for search / action buttons; collapses when empty */
#topLine {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 6px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#topLine:empty {
    display: none;
}

/* ── Kendo horizontal splitter fills remaining height ──────────────── */
#horizontal {
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
}

/* Remove Kendo splitter outer border (Tabler provides its own lines) */
.k-splitter {
    border: none !important;
    background: transparent !important;
}

/* Scroll panes independently */
#shrub,
#main {
    overflow-y: auto;
}

/* ── Breadcrumb inside #main ───────────────────────────────────────── */
#main .breadcrumb-bar {
    padding: 6px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#main .breadcrumb-bar .breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 13px;
    flex-wrap: nowrap;
}

#main .breadcrumb-bar .breadcrumb-item,
#main .breadcrumb-bar .breadcrumb-item a {
    color: #6c757d;
    font-size: 13px;
    text-decoration: none;
}

#main .breadcrumb-bar .breadcrumb-item a:hover {
    color: #206bc4;
}

#main .breadcrumb-bar .breadcrumb-item.active {
    color: #1e293b;
    font-weight: 500;
}

#main .breadcrumb-bar .breadcrumb-item + .breadcrumb-item::before {
    content: '|';
    color: #adb5bd;
    padding: 0 0.4rem;
    float: none;
}

/* ── Navbar tweaks ─────────────────────────────────────────────────── */
.navbar-brand img {
    max-height: 28px;
}

.navbar-brand-text {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    vertical-align: middle;
}

/* Compact avatar initial badge */
.nav-avatar {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background-color: #206bc4;
    color: #fff;
    flex-shrink: 0;
}

/* ── Impersonation warning banner ──────────────────────────────────── */
#impersonation-banner {
    flex-shrink: 0;
    background: #fff3cd;
    border-bottom: 2px solid #ffc107;
    padding: 4px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Content block padding ─────────────────────────────────────────── */
#contentBlock {
    padding: 12px 16px;
}

/* ── Flash messages ────────────────────────────────────────────────── */
#flashMessagesHTML {
    padding: 8px 12px 0;
}

/* ── Loading spinner in shrub ──────────────────────────────────────── */
#shrubBody {
    padding: 8px;
}

/* ── Login page ────────────────────────────────────────────────────── */
body.login-page {
    overflow: auto;
    background-color: #f4f6fb;
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.login-page .login-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem 60px; /* 60px leaves room for fixed footer */
}

/* ── Page header block (above content, below breadcrumbs) ─────────────── */
.page-header-block {
    padding: 10px 16px 8px;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
}

.page-header-block .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
    line-height: 1.4;
}

/* ── File icon card grid (viewFiles) ───────────────────────────────────── */
.card.discoverer {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    cursor: default;
}

.card.discoverer:hover {
    box-shadow: 0 4px 16px rgba(32, 107, 196, 0.18);
    transform: translateY(-2px);
}

#file-browser .col-md-3 {
    margin-bottom: 1rem;
}

/* ── Kendo Bootstrap theme corrections for Tabler / Bootstrap 5 ──────── */

/* Inherit Tabler's font stack instead of the Kendo default */
.k-widget,
.k-grid,
.k-treeview,
.k-button,
.k-input {
    font-family: inherit;
    font-size: 0.875rem;
}

/* Tabler primary blue (#206bc4) in place of Bootstrap 3's #337ab7 */
.k-state-selected,
.k-state-selected:hover,
.k-list .k-state-selected,
.k-list .k-state-focused,
.k-scheduler .k-today,
.k-pager-wrap .k-state-selected {
    background-color: #206bc4 !important;
    border-color: #206bc4 !important;
    color: #fff !important;
}

/* Grid & list alternating-row hover */
.k-grid tbody tr:hover td {
    background-color: rgba(32, 107, 196, 0.06);
}

/* Grid header — use Tabler's light surface instead of Bootstrap 3 grey */
.k-grid .k-grid-header th.k-header {
    background-color: #f8fafc;
    color: #1e293b;
    border-bottom-color: #dee2e6;
    font-weight: 600;
}

/* Match Bootstrap 5 border colour on all Kendo widgets */
.k-widget {
    border-color: #dee2e6;
}

/* Align Kendo text inputs with Bootstrap 5 form-control height */
.k-textbox,
.k-input:not(.k-readonly) {
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem .75rem;
    line-height: 1.5;
}

/* AutoComplete / ComboBox wrapper height */
.k-autocomplete,
.k-combobox,
.k-dropdown {
    height: calc(1.5em + .75rem + 2px);
}

/* Kendo buttons — match Bootstrap 5 .btn sizing */
.k-button {
    padding: .375rem .75rem;
    font-size: .875rem;
    border-radius: 4px;
    line-height: 1.5;
}

/* TreeView link colour matches Tabler primary */
.k-treeview .k-in > a {
    color: #206bc4;
    text-decoration: none;
}

.k-treeview .k-state-selected > .k-in,
.k-treeview .k-state-selected > .k-in:hover {
    background-color: #206bc4;
    border-color: #206bc4;
    color: #fff;
}

.k-treeview .k-state-selected > .k-in a,
.k-treeview .k-state-selected > .k-in a:hover {
    color: #fff;
}