/* IMAGES, NOT COLOURS. Everything else a theme changes is a --tsx-* token and
   follows the selected theme by itself; an icon is a FILE, and the only way to
   swap a file for the dark ground is a second rule.

   THIS FILE EXISTS SO THAT SWAP IS NOT C++. WMenuItem::setIcon() would put one
   image on the item and leave it there - the same drawing on a white panel, on a
   dark panel and on the filled blue pill. A stylesheet can key on the mode; that
   is the whole reason these rules are here and not in a widget.

   TWO DARK SELECTORS, because two applications ask the question differently.

   data-bs-theme is the ModernUI shell's answer: there are fourteen
   data-theme values and only ModernUI::Style::isLight() knows which of them sit
   on a light ground - a stylesheet cannot. apply() writes that answer out as
   data-bs-theme ( "light" or "dark" ) on <html>, so it is the one attribute a
   rule can key off and still be right for all fourteen.

   :root[data-theme="dark"] is the older applications' answer - liveapp and
   rawmonitoring load color.css , whose whole dark block is scoped that way, and
   their themes are the two this attribute names. Neither selector matches the
   other's pages, so both are written and each fires where it belongs.

   PATHS ARE RELATIVE TO THIS FILE, which is served as docroot/style/icon.css -
   so url('icon/...') is docroot/style/icon/ , the copies JSAndCSSExtractor
   writes there. Same convention color.css uses. */

/* ------------------------------------------------------------------
   Icon-bearing WMenu items ( UserPanel's left menu ).

   The classes go on the item's ANCHOR, which is the element that carries both
   the label and Bootstrap's .active flag - so no descendant selector is needed
   for the selected state.
   ------------------------------------------------------------------ */
.menuIconUserInfo,
.menuIconMetric,
.menuIconUISettings {
  background-repeat: no-repeat !important;
  background-position: 10px center !important;
  background-size: 16px 16px !important;
  padding-left: 32px !important;
}

.menuIconUserInfo {
  background-image: url('icon/person-info.svg') !important;
}

.menuIconMetric {
  background-image: url('icon/metric-units.svg') !important;
}

.menuIconUISettings {
  background-image: url('icon/ui-settings.svg') !important;
}

/* On a dark ground the glyph is the inverted file. */
html[data-bs-theme="dark"] .menuIconUserInfo,
:root[data-theme="dark"] .menuIconUserInfo {
  background-image: url('icon/person-info-invert.svg') !important;
}

html[data-bs-theme="dark"] .menuIconMetric,
:root[data-theme="dark"] .menuIconMetric {
  background-image: url('icon/metric-units-invert.svg') !important;
}

html[data-bs-theme="dark"] .menuIconUISettings,
:root[data-theme="dark"] .menuIconUISettings {
  background-image: url('icon/ui-settings-invert.svg') !important;
}

/* THE SELECTED PILL IS PRIMARY-FILLED IN BOTH MODES, so the active item takes the
   inverted glyph either way. Only the light rules are written: under
   data-bs-theme="dark" the base rule above is already the inverted file, and it
   outranks a bare .active selector anyway. */
.menuIconUserInfo.active {
  background-image: url('icon/person-info-invert.svg') !important;
}

.menuIconMetric.active {
  background-image: url('icon/metric-units-invert.svg') !important;
}

.menuIconUISettings.active {
  background-image: url('icon/ui-settings-invert.svg') !important;
}


/* ------------------------------------------------------------------
   Wt::WPanel'in ac/kapa oku.

   Wt bu oku bir background-image SVG olarak veriyor ve SVG'nin cizgi rengi
   Wt'nin kendi bootstrap5 main.css'inde SABIT: stroke='%23212529' , yani neredeyse
   siyah. Bootstrap kendi akordeon okunu [data-bs-theme=dark] altinda degistiriyor
   ama .Wt-collapse-button icin BOYLE BIR KURAL YOK - koyu temada siyah ok koyu
   basligin uzerinde kayboluyor.

   Dosya olan bir ikonu tema degistiremez , ancak ikinci bir kural degistirir: bu
   dosyanin var olma sebebi de o. Ayni cizim , acik gri cizgiyle.
   ------------------------------------------------------------------ */
html[data-bs-theme="dark"] .card.Wt-panel.Wt-collapsible > .card-header > .Wt-collapse-button,
:root[data-theme="dark"] .card.Wt-panel.Wt-collapsible > .card-header > .Wt-collapse-button {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 5 6 6 6-6'/%3E%3C/svg%3E") !important;
}


/* ------------------------------------------------------------------
   TODO: BU BLOGUN KULLANICISI KALMADI. Alti sinif SystemPanelContainer'in yatay
   nav-pills seridine aitti; o serit AppShell'in kenar cubuguna alinip sinif
   silindi ve kenar cubugu ikon yerine kendi noktasini ( .sidenav a::before )
   kullaniyor. Kurallar ve ikon dosyalari, ikonlu bir menu geri istenirse diye
   birakildi - ikonlu satirda noktanin kapatilmasi ve dolgunun .sidenav a'nin
   kendi padding'ine gore yeniden ayarlanmasi gerekir.

   SystemPanelContainer'in sol menusu ( System rolunun sayfalari ).

   Ustteki blokla ayni uc kuralli bicim: taban dosya, koyu zeminde -invert
   esi, ve secili pil primary ile dolduruldugu icin .active da -invert.
   Dosyalar style/icon/ altinda , JSAndCSSExtractor'in yazdigi kopyalar.
   ------------------------------------------------------------------ */
.menuIconCustomers,
.menuIconCustomerUsers,
.menuIconPerfServer,
.menuIconApprovals,
.menuIconGeneralSettings,
.menuIconDocumentViewer {
  background-repeat: no-repeat !important;
  background-position: 10px center !important;
  background-size: 16px 16px !important;
  padding-left: 32px !important;
}

.menuIconCustomers        { background-image: url('icon/buildings.svg') !important; }
.menuIconCustomerUsers    { background-image: url('icon/person-info.svg') !important; }
.menuIconPerfServer       { background-image: url('icon/dashboard.svg') !important; }
.menuIconApprovals        { background-image: url('icon/list-task.svg') !important; }
.menuIconGeneralSettings  { background-image: url('icon/settings.svg') !important; }
.menuIconDocumentViewer   { background-image: url('icon/braces-asterisk.svg') !important; }

html[data-bs-theme="dark"] .menuIconCustomers,
:root[data-theme="dark"] .menuIconCustomers,
.menuIconCustomers.active { background-image: url('icon/buildings-invert.svg') !important; }

html[data-bs-theme="dark"] .menuIconCustomerUsers,
:root[data-theme="dark"] .menuIconCustomerUsers,
.menuIconCustomerUsers.active { background-image: url('icon/person-info-invert.svg') !important; }

html[data-bs-theme="dark"] .menuIconPerfServer,
:root[data-theme="dark"] .menuIconPerfServer,
.menuIconPerfServer.active { background-image: url('icon/dashboard-invert.svg') !important; }

html[data-bs-theme="dark"] .menuIconApprovals,
:root[data-theme="dark"] .menuIconApprovals,
.menuIconApprovals.active { background-image: url('icon/list-task-invert.svg') !important; }

html[data-bs-theme="dark"] .menuIconGeneralSettings,
:root[data-theme="dark"] .menuIconGeneralSettings,
.menuIconGeneralSettings.active { background-image: url('icon/settings-invert.svg') !important; }

html[data-bs-theme="dark"] .menuIconDocumentViewer,
:root[data-theme="dark"] .menuIconDocumentViewer,
.menuIconDocumentViewer.active { background-image: url('icon/braces-asterisk-invert.svg') !important; }


/* ------------------------------------------------------------------
   ApprovalMessageItemManagerPanel'in kart ikonu.

   Sayfanin kendi menu girdisiyle ( .menuIconApprovals ) AYNI CIZIM: onay
   mesajlari listesi neyse, karti da o. Tek renk bir siluet oldugu icin acik
   zeminde koyu, koyu zeminde beyaz esi gerekiyor - ve o es bir DOSYA, C++
   tarafindan secilemez; bu dosyanin var olma sebebi de o.

   Menu kurallarindan tek farki konum ve olcu: bunlar bir metnin solundaki
   dolgu degil, kendi 20x20 kutusunun tamamini kaplayan bir ikon.
   ------------------------------------------------------------------ */
.iconApprovalMessage {
  background-image: url('icon/list-task.svg') !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: contain !important;
}

html[data-bs-theme="dark"] .iconApprovalMessage,
:root[data-theme="dark"] .iconApprovalMessage {
  background-image: url('icon/list-task-invert.svg') !important;
}


/* ------------------------------------------------------------------
   ContractorItemWidget'in musteri ikonu - LOGOSU OLMAYAN musteri icin.

   Logosu olan musteride ikon GridFS'ten inen kendi dosyasi ve o url'i yalnizca
   C++ biliyor, dolayisiyla orada inline background kaliyor. Yerine gecen cizim
   ise her zaman ayni iki dosya, yani bir sinif olabilir - ve bir sinif olunca
   koyu zemindeki beyaz esini bu dosya secebiliyor.

   Ayni cizim, musterilerin menu girdisinin ( .menuIconCustomers ) kullandigi
   buildings.svg .
   ------------------------------------------------------------------ */
.iconCustomerFallback {
  background-image: url('icon/buildings.svg') !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: contain !important;
}

html[data-bs-theme="dark"] .iconCustomerFallback,
:root[data-theme="dark"] .iconCustomerFallback {
  background-image: url('icon/buildings-invert.svg') !important;
}
