/*
 * Smart City branding for the NetSapiens classic portal (/portal/, CakePHP
 * layout views/layouts/portal.ctp). Loaded via UI config PORTAL_CSS_CUSTOM,
 * which portal.ctp emits as a <link> AFTER basicCSS.php and the generated
 * css/portal.php, so equal-specificity rules here win.
 *
 * Lives in /var/www/html/sct-branding/ (not package-owned; survives
 * NetSapiens upgrades). Companion to auth-login.css (the /auth/ login app).
 *
 * Scope is deliberately light: colours only on the chrome (nav, sub-bar,
 * buttons, links, footer). No layout/size changes, so portal pages that
 * depend on the stock geometry keep working.
 *
 * Palette (2025 Smart City Brand Standards):
 *   Blue   #1C3F94  primary
 *   Red    #E63E30  emphasis / hover
 *   Yellow #FFB819  accents, dividers
 *   Gray   #A7A9AC  secondary text
 */

:root {
  --sc-blue: #1C3F94;
  --sc-blue-dark: #142D6B;
  --sc-red: #E63E30;
  --sc-yellow: #FFB819;
  --sc-gray: #A7A9AC;
  --sc-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---- Page ------------------------------------------------------------- */
body {
  font-family: var(--sc-font);
  border-top: 5px solid var(--sc-yellow);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--sc-font);
}
#content h1, #content h2, #content h3 {
  color: var(--sc-blue);
}

/* ---- Main navigation tiles (Home, Users, Call History, ...) ------------
 * Stock: primary1/primary2 gradient on hover + current. Make it a solid
 * brand blue and mark the current tile with a yellow underline. */
#nav-buttons .loading a.nav-link div.nav-button,
#nav-buttons a.nav-link:hover div.nav-button,
#nav-buttons .nav-link-current div.nav-button {
  background-color: var(--sc-blue) !important;
  background-image: none !important;
  border-color: var(--sc-blue) !important;
}
#nav-buttons .nav-link-current div.nav-button {
  box-shadow: inset 0 -4px 0 var(--sc-yellow);
}
#nav-buttons .nav-link-current span.nav-text {
  color: var(--sc-blue);
  font-weight: bold;
}
/* little pointer under the current tile joins the sub-bar */
.loading .nav-arrow,
.nav-link-current .nav-arrow {
  border-color: transparent transparent var(--sc-blue) transparent !important;
}

/* ---- Sub-navigation bar (page title + action buttons) ------------------ */
#navigation-subbar {
  background-color: var(--sc-blue) !important;
  background-image: none !important;
  border-bottom: 3px solid var(--sc-yellow);
  text-shadow: none;
}

/* ---- Buttons ------------------------------------------------------------ */
.btn.color-primary,
.btn-primary {
  background-color: var(--sc-blue) !important;
  background-image: none !important;
  border-color: var(--sc-blue-dark) !important;
  color: #fff !important;
  text-shadow: none;
}
.btn.color-primary:hover,
.btn.color-primary:focus,
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--sc-blue-dark) !important;
}
.btn:focus-visible {
  outline: 3px solid var(--sc-yellow);
  outline-offset: 1px;
}

/* ---- Bootstrap 2 "info" variants ----------------------------------------
 * Stock .label-info #3a87ad / .btn-info #49afcd are teal; used e.g. for the
 * Call History filter chips (date, type, user, caller, dialed). Map to brand
 * blue. .alert-info (pale info box) intentionally left stock. */
/* Light brand-blue tint with blue text (user asked for a lighter shade than
 * solid blue behind the Call History filter dates). #1C3F94 on #DDE4F3 ≈ 8:1. */
.label-info,
.badge-info,
.label-info[href],
.badge-info[href] {
  background-color: #DDE4F3 !important;
  border: 1px solid rgba(28, 63, 148, 0.35);
  text-shadow: none !important;
}
#content .label-info,
#content .label-info *,
#content .badge-info,
#content .badge-info *,
.label-info,
.label-info a,
.badge-info,
.badge-info a {
  color: var(--sc-blue) !important;
}
.label-info[href]:hover,
.badge-info[href]:hover,
.label-info.clear-filter:hover {
  background-color: #C9D3EC !important;
}
.btn-info {
  background-color: var(--sc-blue) !important;
  background-image: none !important;
  border-color: var(--sc-blue-dark) !important;
  color: #fff !important;
  text-shadow: none;
}
.btn-info:hover,
.btn-info:focus,
.btn-info.active {
  background-color: var(--sc-blue-dark) !important;
}

/* ---- Links ---------------------------------------------------------------
 * Same specificity as Bootstrap's own a{color:#0088cc} / a:hover{#005580},
 * so this only swaps the default link colour; anything more specific
 * (labels, buttons, white sub-bar links) still wins. Do NOT raise
 * specificity here (an earlier #content a:not(...) rule painted the Call
 * History date chip blue-on-blue). */
a {
  color: var(--sc-blue);
}
a:hover,
a:focus {
  color: var(--sc-blue-dark);
}
.btn-link:hover,
.btn-link:focus {
  color: var(--sc-blue-dark);
}

/* ---- Drop-down menus: highlighted / active item (stock teal gradient) -- */
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus,
.dropdown-submenu:hover > a,
.dropdown-submenu:focus > a,
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
  background-color: var(--sc-blue) !important;
  background-image: none !important;
  color: #fff !important;
}

/* ---- On/off toggle switches (bootstrap-switch) ------------------------- */
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
  background-color: var(--sc-blue) !important;
  background-image: none !important;
  border-color: var(--sc-blue-dark) !important;
  color: #fff !important;
  text-shadow: none;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary:hover,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary:hover,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info:hover,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info:hover {
  background-color: var(--sc-blue-dark) !important;
}

/* ---- jQuery UI (dialogs, autocomplete, button sets, datepicker, tabs) -- */
.ui-button-primary,
.ui-buttonset .ui-state-active,
.ui-menu .ui-menu-item div.ui-state-focus,
.ui-menu .ui-menu-item div.ui-state-active,
.ui-dialog-buttonpane .ui-dialog-buttonset .ui-button,
.ui-datepicker td .ui-state-hover,
.ui-slider .ui-slider-range,
.ui-progressbar .ui-progressbar-value,
.ui-state-active,
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active,
a.ui-button:active,
.ui-button:active,
.ui-button.ui-state-active:hover {
  background: var(--sc-blue) !important;
  border-color: var(--sc-blue-dark) !important;
  color: #fff !important;
  text-shadow: none;
}
.ui-dialog-buttonpane .ui-dialog-buttonset .ui-button:hover,
.ui-button-primary:hover {
  background: var(--sc-blue-dark) !important;
}
.ui-state-active a,
.ui-state-active a:link,
.ui-state-active a:visited {
  color: #fff !important;
}
.ui-widget-header {
  border-color: var(--sc-blue) !important;
}
.ui-tabs .ui-tabs-nav li a,
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a {
  color: var(--sc-blue) !important;
}

/* ---- Text-field focus glow (stock light blue) -------------------------- */
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
  border-color: rgba(28, 63, 148, 0.7);
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(28, 63, 148, 0.45);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(28, 63, 148, 0.45);
}

/* ---- Progress bars (status colours success/warning/danger untouched) --- */
.progress .bar,
.progress-info .bar,
.progress .bar-info {
  background-color: var(--sc-blue);
}
.progress:not(.progress-striped) .bar:not(.bar-success):not(.bar-warning):not(.bar-danger),
.progress-info:not(.progress-striped) .bar,
.progress:not(.progress-striped) .bar-info {
  background-image: none;
}

/* ---- "Info" text and form hints (stock teal #3a87ad) ------------------- */
.text-info,
.control-group.info .control-label,
.control-group.info .help-block,
.control-group.info .help-inline,
.control-group.info .checkbox,
.control-group.info .radio,
.control-group.info input,
.control-group.info select,
.control-group.info textarea {
  color: var(--sc-blue);
}
a.text-info:hover,
a.text-info:focus {
  color: var(--sc-blue-dark);
}
.control-group.info input,
.control-group.info select,
.control-group.info textarea {
  border-color: var(--sc-blue);
}
.control-group.info input:focus,
.control-group.info select:focus,
.control-group.info textarea:focus {
  border-color: var(--sc-blue-dark);
  box-shadow: 0 0 6px rgba(28, 63, 148, 0.45);
}
/* Labels/badges (incl. <a class="label"> like the Call History date filter
 * chip) always keep white text on their coloured background. */
#content .label:not(.label-info),
#content .label:not(.label-info):hover,
#content .label:not(.label-info) *,
#content .badge:not(.badge-info),
#content .badge:not(.badge-info):hover,
#content .badge:not(.badge-info) * {
  color: #fff !important;
}

/* ---- Tables: brand rule under header row ------------------------------ */
#content table thead th {
  border-bottom: 2px solid var(--sc-blue);
}

/* ---- Modals: brand accent on the title bar ----------------------------- */
.modal-header {
  border-bottom: 3px solid var(--sc-yellow);
}
.modal-header h3,
.modal-header .modal-title {
  color: var(--sc-blue);
}

/* ---- Footer ------------------------------------------------------------ */
#footer p {
  color: var(--sc-gray) !important;
}
