/* Resco Studio — Keycloak Admin Console */

:root {
  /* Resco Company Colors */
  --resco-blue: #0066cc;
  --resco-turquoise: #00e0be;
  --resco-yellow: #ffd005;
  --resco-orange: #ffa44a;
  --resco-pink: #f25481;
  --resco-purple: #8931b1;
  --resco-dark: #12324b;

  /* Resco Dark Mode Colors */
  --resco-dark-bg: #0d1b2a;
  --resco-dark-surface: #1b263b;
  --resco-dark-text: #e1e8ed;

  /* PatternFly v5 Overrides (Light Mode Default) */
  --pf-v5-global--primary-color--100: var(--resco-blue);
  --pf-v5-global--primary-color--200: #0052a3;
  --pf-v5-global--link--Color: var(--resco-blue);
  --pf-v5-global--link--Color--hover: #0052a3;
  --pf-v5-global--success-color--100: var(--resco-turquoise);
  --pf-v5-global--info-color--100: var(--resco-blue);
  --pf-v5-global--warning-color--100: var(--resco-orange);
  --pf-v5-global--danger-color--100: var(--resco-pink);

  /* Legacy PF v4 Overrides */
  --pf-global--primary-color--100: var(--resco-blue);
  --pf-global--primary-color--200: #0052a3;
  --pf-global--link--Color: var(--resco-blue);
  --pf-global--link--Color--hover: #0052a3;
  --pf-global--success-color--100: var(--resco-turquoise);
  --pf-global--warning-color--100: var(--resco-orange);
  --pf-global--danger-color--100: var(--resco-pink);
}

/* ── Masthead (Header) ─ Light Mode ───────────────────────────────────── */
.pf-v5-c-masthead, .pf-c-masthead {
  --pf-v5-c-masthead--BackgroundColor: #ffffff;
  --pf-c-masthead--BackgroundColor: #ffffff;
  
  /* Force dark text for all header elements */
  --pf-v5-global--Color--100: var(--resco-dark);
  --pf-v5-global--Color--200: rgba(18, 50, 75, 0.7);
  --pf-v5-global--Color--light-100: var(--resco-dark);
  --pf-v5-c-button--m-plain--Color: var(--resco-dark);
  --pf-v5-c-button--m-plain--hover--Color: var(--resco-blue);
  --pf-v5-c-menu-toggle--Color: var(--resco-dark);
  --pf-v5-c-menu-toggle--hover--Color: var(--resco-blue);

  /* Legacy PF v4 */
  --pf-global--Color--100: var(--resco-dark);
  --pf-global--Color--200: rgba(18, 50, 75, 0.7);
  --pf-global--Color--light-100: var(--resco-dark);
  --pf-c-button--m-plain--Color: var(--resco-dark);
  --pf-c-button--m-plain--hover--Color: var(--resco-blue);
  --pf-c-dropdown__toggle--Color: var(--resco-dark);
  --pf-c-dropdown__toggle--hover--Color: var(--resco-blue);

  border-top: 3px solid var(--resco-blue);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  color: var(--resco-dark);
}

.pf-v5-c-masthead__toggle, .pf-c-masthead__toggle,
.pf-v5-c-masthead__main .pf-v5-c-button, .pf-c-masthead__main .pf-c-button,
.pf-v5-c-masthead .pf-v5-c-menu-toggle__text {
  color: var(--resco-dark);
}

/* Brand / Logo */
.pf-v5-c-brand, .pf-c-brand, .keycloak__pageheader_brand {
  content: url("../img/logo.svg");
  height: 24px;
}

/* ── Sidebar ─ Light Mode ─────────────────────────────────────────────── */
.pf-v5-c-page__sidebar, .pf-c-page__sidebar {
  --pf-v5-c-page__sidebar--BackgroundColor: #f6fbff;
  --pf-c-page__sidebar--BackgroundColor: #f6fbff;
  border-right: 1px solid rgba(18, 50, 75, 0.08);
}

.pf-v5-c-nav__link, .pf-c-nav__link {
  --pf-v5-c-nav__link--Color: var(--resco-dark);
  --pf-c-nav__link--Color: var(--resco-dark);
}

.pf-v5-c-nav__section-title, .pf-c-nav__section-title {
  --pf-v5-c-nav__section-title--Color: rgba(18, 50, 75, 0.7);
  --pf-c-nav__section-title--Color: rgba(18, 50, 75, 0.7);
  color: rgba(18, 50, 75, 0.7);
}

.pf-v5-c-nav__separator, .pf-c-nav__separator,
.pf-v5-c-divider, .pf-c-divider {
  --pf-v5-c-divider--BackgroundColor: rgba(18, 50, 75, 0.1);
  --pf-c-divider--BackgroundColor: rgba(18, 50, 75, 0.1);
}

.pf-v5-c-nav__link.pf-m-current, .pf-c-nav__link.pf-m-current {
  --pf-v5-c-nav__link--BackgroundColor: rgba(0, 102, 204, 0.06);
  --pf-c-nav__link--BackgroundColor: rgba(0, 102, 204, 0.06);
  --pf-v5-c-nav__link--Color: var(--resco-blue);
  --pf-c-nav__link--Color: var(--resco-blue);
  font-weight: 600;
}

.pf-v5-c-nav__link.pf-m-current::after, .pf-c-nav__link.pf-m-current::after {
  --pf-v5-c-nav__link--m-current--after--BorderColor: var(--resco-blue);
  --pf-c-nav__link--m-current--after--BorderColor: var(--resco-blue);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.pf-v5-c-button.pf-m-primary, .pf-c-button.pf-m-primary {
  --pf-v5-c-button--m-primary--BackgroundColor: var(--resco-blue);
  --pf-c-button--m-primary--BackgroundColor: var(--resco-blue);
}

.pf-v5-c-button.pf-m-primary:hover, .pf-c-button.pf-m-primary:hover {
  --pf-v5-c-button--m-primary--hover--BackgroundColor: #0052a3;
  --pf-c-button--m-primary--hover--BackgroundColor: #0052a3;
}

/* ── Dark Mode Overrides (Native Keycloak Support) ────────────────────── */
.pf-v5-theme-dark .pf-v5-c-masthead,
.pf-v5-theme-dark .pf-c-masthead {
  --pf-v5-c-masthead--BackgroundColor: var(--resco-dark-bg) !important;
  --pf-c-masthead--BackgroundColor: var(--resco-dark-bg) !important;
  --pf-v5-c-masthead__content--BackgroundColor: transparent !important;
  --pf-v5-c-masthead__main--BackgroundColor: transparent !important;
  --pf-v5-global--palette--black-1000: var(--resco-dark-bg) !important;
  --pf-v5-global--BackgroundColor--dark-100: var(--resco-dark-bg) !important;
  --pf-v5-global--BackgroundColor--dark-200: var(--resco-dark-bg) !important;
  background-color: var(--resco-dark-bg) !important;
  color: var(--resco-dark-text);
  border-top: 3px solid var(--resco-blue);
}

.pf-v5-theme-dark .pf-v5-c-masthead__brand,
.pf-v5-theme-dark .pf-c-masthead__brand,
.pf-v5-theme-dark .pf-v5-c-masthead__main,
.pf-v5-theme-dark .pf-c-masthead__main,
.pf-v5-theme-dark .pf-v5-c-masthead__content,
.pf-v5-theme-dark .pf-c-masthead__content,
.pf-v5-theme-dark .pf-v5-c-toolbar,
.pf-v5-theme-dark .pf-c-toolbar {
  background-color: transparent !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.pf-v5-theme-dark .pf-v5-c-masthead__toggle,
.pf-v5-theme-dark .pf-v5-c-masthead__main .pf-v5-c-button,
.pf-v5-theme-dark .pf-v5-c-masthead .pf-v5-c-menu-toggle__text {
  color: var(--resco-dark-text);
}

.pf-v5-theme-dark .pf-v5-c-brand,
.pf-v5-theme-dark .keycloak__pageheader_brand {
  filter: brightness(0) invert(1);
}

.pf-v5-theme-dark .pf-v5-c-page__sidebar,
.pf-v5-theme-dark .pf-c-page__sidebar {
  --pf-v5-c-page__sidebar--BackgroundColor: #0a141d;
  --pf-c-page__sidebar--BackgroundColor: #0a141d;
  background-color: #0a141d;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.pf-v5-theme-dark .pf-v5-c-nav {
  background-color: #0a141d;
}

.pf-v5-theme-dark .pf-v5-c-nav__link,
.pf-v5-theme-dark .pf-c-nav__link {
  color: rgba(255, 255, 255, 0.8);
}

.pf-v5-theme-dark .pf-v5-c-nav__section-title,
.pf-v5-theme-dark .pf-c-nav__section-title {
  color: rgba(255, 255, 255, 0.4);
}

.pf-v5-theme-dark .pf-v5-c-nav__link.pf-m-current {
  --pf-v5-c-nav__link--BackgroundColor: rgba(0, 102, 204, 0.2);
  --pf-v5-c-nav__link--Color: #ffffff;
  background-color: rgba(0, 102, 204, 0.2);
  color: #ffffff;
}

.pf-v5-theme-dark .pf-v5-c-page__main {
  background-color: #0d1218;
}

.pf-v5-theme-dark .pf-v5-c-empty-state,
.pf-v5-theme-dark .pf-c-empty-state {
  --pf-v5-c-empty-state--BackgroundColor: var(--resco-dark-surface);
  --pf-c-empty-state--BackgroundColor: var(--resco-dark-surface);
  background-color: var(--resco-dark-surface);
  color: var(--resco-dark-text);
}

.pf-v5-theme-dark .pf-v5-c-card {
  --pf-v5-c-card--BackgroundColor: var(--resco-dark-surface);
  color: var(--resco-dark-text);
}
