/* Cloudi-Fi branding for SFTPGo (2.7.x) — loaded via branding extra_css
   Colours: navy #163865 / #0d2444, yellow #ffcc1a, amber #f8a71d */

/* ---------- brand colours, light theme ---------- */
:root,
[data-bs-theme=light] {
  --cf-navy: #163865;
  --cf-navy-deep: #0d2444;
  --cf-yellow: #ffcc1a;
  --cf-amber: #f8a71d;

  --bs-primary: #ffcc1a;
  --bs-primary-rgb: 255, 204, 26;
  --bs-primary-active: #f8a71d;
  --bs-primary-light: #fff6d1;
  --bs-primary-inverse: #163865;           /* text on yellow buttons */
  --bs-primary-clarity: rgba(255, 204, 26, .25);
  --bs-primary-bg-subtle: #fff6d1;
  --bs-primary-border-subtle: #ffe27a;
  --bs-primary-text-emphasis: #163865;

  /* yellow text is unreadable on white: links stay navy in light mode */
  --bs-link-color: #163865;
  --bs-link-color-rgb: 22, 56, 101;
  --bs-link-hover-color: #f8a71d;
  --bs-link-hover-color-rgb: 248, 167, 29;
}

/* ---------- brand colours, dark theme ---------- */
[data-bs-theme=dark] {
  --bs-primary: #ffcc1a;
  --bs-primary-rgb: 255, 204, 26;
  --bs-primary-active: #f8a71d;
  --bs-primary-light: #2b2716;
  --bs-primary-inverse: #163865;
  --bs-primary-clarity: rgba(255, 204, 26, .2);
  --bs-primary-bg-subtle: #2b2716;
  --bs-primary-border-subtle: #6b5610;
  --bs-primary-text-emphasis: #ffdd66;

  --bs-link-color: #ffcc1a;
  --bs-link-color-rgb: 255, 204, 26;
  --bs-link-hover-color: #f8a71d;
  --bs-link-hover-color-rgb: 248, 167, 29;
}

/* Active/checked components (pagination, checkboxes, switches), both themes */
:root, [data-bs-theme=light], [data-bs-theme=dark] {
  --bs-component-active-bg: #ffcc1a;
  --bs-component-active-color: #163865;
  --bs-component-checked-bg: #ffcc1a;
  --bs-component-checked-color: #163865;
  --bs-pagination-active-bg: #ffcc1a;
  --bs-pagination-active-color: #163865;
  --bs-pagination-active-border-color: #ffcc1a;
}
[data-bs-theme=light] { --bs-component-hover-color: #163865; }
[data-bs-theme=dark]  { --bs-component-hover-color: #ffcc1a; }
.page-item.active .page-link { background-color: #ffcc1a !important; color: #163865 !important; }
.form-check-input:checked { background-color: #ffcc1a !important; border-color: #ffcc1a !important; }

/* Pale "light-primary" buttons (New Folder, Export…): navy text, yellow on hover */
.btn.btn-light-primary { color: #163865 !important; }
[data-bs-theme=dark] .btn.btn-light-primary { color: #ffcc1a !important; }
.btn.btn-light-primary:hover:not(.btn-active),
.btn.btn-light-primary.active { background-color: #ffcc1a !important; color: #163865 !important; }
.btn.btn-light-primary i, .btn.btn-light-primary .svg-icon { color: inherit !important; }

/* Navy sidebar in both themes */
:root, [data-bs-theme=light], [data-bs-theme=dark] {
  --bs-app-sidebar-base-bg-color: #0d2444;
  --bs-app-sidebar-base-border-end: 0;
}

/* In light mode, "primary"-coloured text and icons use navy for contrast */
[data-bs-theme=light] .text-primary,
[data-bs-theme=light] .link-primary { color: var(--cf-navy) !important; }
[data-bs-theme=light] .text-hover-primary:hover,
[data-bs-theme=light] .link-primary:hover { color: var(--cf-amber) !important; }

/* Primary buttons: navy text on yellow, amber on hover (both themes) */
.btn.btn-primary { color: #163865 !important; font-weight: 600; }
.btn.btn-primary:hover:not(.btn-active),
.btn.btn-primary:active,
.btn.btn-primary.active { background-color: #f8a71d !important; color: #163865 !important; }
.btn.btn-primary .svg-icon,
.btn.btn-primary i { color: #163865 !important; }

/* Focus ring */
.form-control:focus, .form-select:focus {
  border-color: #ffcc1a !important;
  box-shadow: 0 0 0 .2rem rgba(255, 204, 26, .25) !important;
}

/* ---------- full-page screens (login, shares, password reset) ---------- */
body.app-blank,
body:not(.app-default) #kt_app_root,
body:not(:has(#kt_app_sidebar)) {
  background:
    radial-gradient(1200px 600px at 80% -10%, #24508f 0%, transparent 60%),
    linear-gradient(180deg, #163865 0%, #0d2444 100%) fixed !important;
}

/* Login card */
body.app-blank .bg-body.rounded {
  border-radius: 14px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35) !important;
}

/* Share pages: the "short name" next to the logo sits on navy, so make it white */
body:not(:has(#kt_app_sidebar)) .text-gray-900.fs-1 { color: #fff !important; }

/* ---------- logged-in layout ---------- */
.app-sidebar-logo img { height: 40px; width: auto; }
.app-sidebar-logo .text-sidebar { font-weight: 600 !important; }

/* Hide the SFTPGo version line in the footer */
#kt_app_footer { display: none !important; }

/* Dark mode: "primary" text/icons (file & folder icons, active links) in yellow */
[data-bs-theme=dark] .text-primary,
[data-bs-theme=dark] .link-primary { color: #ffcc1a !important; }
[data-bs-theme=dark] .text-hover-primary:hover { color: #f8a71d !important; }
