/* OLB Chrome — Layout, Header, Sidebar, Footer, Skeleton, Shimmer
   All colors are CSS custom properties — no hardcoded color values in component markup.
   FEAT-060 / TASK-071 Phase 1 */

/* ── CSS Custom Properties ── */
:root {
  --olb-brand-navy:       #003366;
  --olb-brand-navy-dark:  #001a33;
  --olb-brand-navy-mid:   #0a1628;
  --olb-accent-blue:      #2e6da4;
  /* Wire Bootstrap primary to the brand accent — drives table-primary, btn-primary, btn-outline-primary */
  --bs-primary:           #2e6da4;
  --bs-primary-rgb:       46, 109, 164;
  --olb-accent-teal:      #0ea5e9;
  --olb-link-blue:        #006bb7;
  --olb-header-gradient:  linear-gradient(135deg, #003366 0%, #1a4a80 100%);
  --olb-content-bg:       #f5f7fa;
  --olb-content-max-w:    1400px;
  --olb-sidebar-width:    240px;
  --olb-nav-text:         rgba(255,255,255,0.85);
  --olb-nav-text-active:  #ffffff;
  --olb-nav-text-muted:   rgba(255,255,255,0.45);
  --olb-focus-ring:       0 0 0 3px rgba(14, 165, 233, 0.55);
  --olb-transition-nav:   0.15s ease;
  --olb-transition-drop:  0.12s ease-in-out;
  --olb-shimmer-base:     rgba(255,255,255,0.04);
  --olb-shimmer-peak:     rgba(255,255,255,0.13);
}

/* ── Shimmer Animation ── */
@keyframes olb-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.olb-shimmer-bar {
  height: 14px;
  border-radius: 7px;
  display: block;
  background: linear-gradient(
    90deg,
    var(--olb-shimmer-base) 0%,
    var(--olb-shimmer-peak) 50%,
    var(--olb-shimmer-base) 100%
  );
  background-size: 400px 100%;
  animation: olb-shimmer 1.4s ease-in-out infinite;
}

/* ── Skeleton Frame (bootstrapping state) ── */
.olb-skeleton-frame {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.olb-skeleton-header {
  height: 72px;
  background: var(--olb-brand-navy-dark);
  flex-shrink: 0;
}

.olb-skeleton-nav {
  width: var(--olb-sidebar-width);
  background: var(--olb-brand-navy-dark);
  min-height: 200px;
}

.olb-skeleton-body {
  flex: 1;
  background: var(--olb-content-bg);
  padding: 1.5rem;
}

/* ── Horizontal Layout ── */
.olb-layout-h {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.olb-header-h {
  background: var(--olb-header-gradient);
  height: 72px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.olb-header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.5rem;
  max-width: var(--olb-content-max-w);
  margin: 0 auto;
  gap: 1.5rem;
}

.olb-main-h {
  flex: 1;
  background: var(--olb-content-bg);
  padding: 1.5rem;
  max-width: var(--olb-content-max-w);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Top Nav (horizontal mode) ── */
.olb-topnav {
  flex: 1;
  overflow: hidden;
}

.olb-topnav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  height: 100%;
}

.olb-topnav-skeleton {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.5rem;
}

/* ── Vertical Layout ── */
.olb-layout-v {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.olb-header-v {
  background: #ffffff;
  height: 60px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.olb-body-v {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.olb-sidebar {
  width: var(--olb-sidebar-width);
  background: var(--olb-brand-navy-dark);
  flex-shrink: 0;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
}

.olb-main-v {
  flex: 1;
  background: var(--olb-content-bg);
  padding: 1.5rem;
  overflow-y: auto;
}

/* ── Footer ── */
.olb-footer {
  background: var(--olb-brand-navy-mid);
  color: rgba(255,255,255,0.8);
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.olb-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: var(--olb-content-max-w);
  margin: 0 auto;
  text-align: center;
}

.olb-footer-text {
  flex: none;
}

/* ── FDIC Logo ── */
.olb-fdic-logo {
  height: 24px;
  width: auto;
}

/* ── Bank Logo & Name Fallback ── */
.olb-bank-logo {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.olb-bank-name-text {
  color: var(--olb-nav-text-active);
  font-size: 1.125rem;
  font-weight: 600;
  white-space: nowrap;
}

.olb-logo-zone {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

/* ── Header Actions ── */
.olb-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Header Sign Out Button ── */
.olb-header-signout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--olb-transition-nav), border-color var(--olb-transition-nav), color var(--olb-transition-nav);
}

.olb-header-h .olb-header-signout-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--olb-nav-text);
}

.olb-header-h .olb-header-signout-btn:hover,
.olb-header-h .olb-header-signout-btn:focus-visible {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.65);
  color: var(--olb-nav-text-active);
}

.olb-header-v .olb-header-signout-btn {
  background: transparent;
  border: 1px solid rgba(220,53,69,0.4);
  color: #dc3545;
}

.olb-header-v .olb-header-signout-btn:hover,
.olb-header-v .olb-header-signout-btn:focus-visible {
  background: rgba(220,53,69,0.06);
  border-color: #dc3545;
  color: #b02a37;
}

.olb-header-signout-btn:focus-visible {
  outline: none;
  box-shadow: var(--olb-focus-ring);
}

/* ── Skip Link (accessibility) ── */
.olb-skip-link {
  position: absolute;
  left: -9999px;
  z-index: 9999;
  background: var(--olb-brand-navy);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
}

.olb-skip-link:focus {
  left: 1rem;
}

/* ── Visually Hidden (screen-reader only) ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Cookie Consent Banner ── */
.olb-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1045; /* above sticky nav (1030), below modal backdrop (1050) */
  background: rgba(13, 27, 42, 0.96);
  border-top: 1px solid rgba(255,255,255,0.10);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: #ffffff;
  font-size: 0.875rem;
  line-height: 1.5;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.olb-cookie-banner.dismissed {
  transform: translateY(100%);
}

.olb-cookie-text {
  flex: 1;
  min-width: 200px;
}

.olb-cookie-dismiss {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.4);
  color: #ffffff;
  border-radius: 50px;
  padding: 0.375rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--olb-transition-nav),
              background-color var(--olb-transition-nav);
  white-space: nowrap;
}

.olb-cookie-dismiss:hover {
  border-color: rgba(255,255,255,0.8);
  background-color: rgba(255,255,255,0.10);
}

.olb-cookie-dismiss:focus-visible {
  outline: none;
  box-shadow: var(--olb-focus-ring);
}

/* ── Sidebar Navigation (vertical layout) — FEAT-068 ── */

.olb-sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
}

.olb-nav-item {
  list-style: none;
}

.olb-nav-item .olb-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 1rem;
  color: var(--olb-nav-text);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.3;
  position: relative;
  transition: background-color var(--olb-transition-nav),
              color var(--olb-transition-nav);
}

.olb-nav-item .olb-sidebar-link:hover,
.olb-nav-item .olb-sidebar-link:focus-visible {
  background-color: rgba(46, 109, 164, 0.15);
  color: var(--olb-accent-blue);
  outline: none;
}

.olb-nav-item .olb-sidebar-link.active {
  color: var(--olb-nav-text-active);
  background-color: rgba(46, 109, 164, 0.12);
}

/* 3px accent bar on active nav item — no new stacking context, z-index well below 1030 */
.olb-nav-item .olb-sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--olb-accent-blue);
  border-radius: 0 2px 2px 0;
}

/* Bootstrap Icons font glyph — sizing/color come from font-size/color, not SVG stroke/fill/viewBox */
.olb-nav-icon {
  flex-shrink: 0;
  width: 16px;
  font-size: 14px;
  line-height: 1;
  text-align: center;
  color: inherit;
}

/* Accordion group — <details>/<summary> pattern, works in SSR without JS events */
.olb-nav-group-details {
  display: block;
}

/* Remove browser default disclosure triangle */
.olb-nav-group-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem 0.25rem;
  font-size: 0.6875rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--olb-nav-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: color var(--olb-transition-nav);
}

/* Chrome/Safari: hide the default marker */
.olb-nav-group-btn::-webkit-details-marker {
  display: none;
}

.olb-nav-group-btn:hover,
.olb-nav-group-btn:focus-visible {
  color: var(--olb-nav-text);
  outline: none;
}

.olb-nav-group-btn:focus-visible {
  box-shadow: inset var(--olb-focus-ring);
  border-radius: 2px;
}

.olb-nav-group-chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform var(--olb-transition-nav);
}

/* Rotate chevron when group is open — driven by <details open> attribute */
.olb-nav-group-details[open] .olb-nav-group-chevron {
  transform: rotate(180deg);
}

.olb-nav-group-details > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Content-area shimmer — light backgrounds need dark-toned placeholder colors ── */
.olb-main-v .olb-shimmer-bar,
.olb-main-h .olb-shimmer-bar {
  --olb-shimmer-base: #dde1e6;
  --olb-shimmer-peak: #eceff2;
}

/* ── Notifications Button ── */
.olb-notifications-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.375rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  border: none;
  transition: background var(--olb-transition-nav), opacity var(--olb-transition-nav);
}

.olb-notifications-btn:focus-visible {
  outline: none;
  box-shadow: var(--olb-focus-ring);
}

.olb-header-h .olb-notifications-btn {
  background: var(--olb-accent-teal);
  color: #ffffff;
}

.olb-header-h .olb-notifications-btn:hover,
.olb-header-h .olb-notifications-btn:focus-visible {
  background: #0891b2;
}

.olb-header-v .olb-notifications-btn {
  background: var(--olb-accent-blue);
  color: #ffffff;
}

.olb-header-v .olb-notifications-btn:hover,
.olb-header-v .olb-notifications-btn:focus-visible {
  background: var(--olb-brand-navy);
}

.olb-notif-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3em;
  padding: 0.1em 0.35em;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.9);
  color: #003366;
  line-height: 1.3;
}
