/* ============================================================
   Rosistem WMS – Custom stylesheet
   Applied on top of the active Wisej.NET theme.
   ============================================================ */

/* ----------------------------------------------------------
   DataGridView column headers – tall mode (filter row visible)
   When ShowFilterRow=true the header height is 52px:
     - top 24px → column title text
     - bottom 28px → filter controls overlay (Panel)
   The theme sets alignY:"top" on the label widget, but some
   Wisej versions ignore that for table-header-cell.  These
   CSS rules act as a safety net.
   ---------------------------------------------------------- */

/* The CssClass "my-custom-header" is set on
   ColumnHeadersDefaultCellStyle in GridViewEx constructor. */

/* Header NORMAL (filter row hidden) – las tema sa faca layout-ul.
   Doar text negru bold ca sa fie vizibil pe orice tema. */

/* ----------------------------------------------------------
   DataGridView – fix row-header row number text colour.
   In some themes the row header text is invisible.
   ---------------------------------------------------------- */
.wisej-datagrid .qx-row-header {
    color: #333333 !important;
}

/* ----------------------------------------------------------
   Group-by panel chip labels
   ---------------------------------------------------------- */
.wms-groupby-chip {
    display: inline-flex;
    align-items: center;
    background: #d0e4f5;
    border: 1px solid #89b8d9;
    border-radius: 3px;
    padding: 2px 6px;
    margin: 2px 4px;
    font-size: 12px;
    cursor: default;
    user-select: none;
}

.wms-groupby-chip:hover {
    background: #b8d5ee;
}

/* ----------------------------------------------------------
   DataGridView column headers – when filter row is visible
   This class is used when ShowFilterRow=true.
   The header height is 56px total:
     - top 28px → column title text
     - bottom 28px → filter controls overlay (Panel)
   ---------------------------------------------------------- */

/* Header cu filter row vizibil – las tema sa faca layout-ul. */

/* FIX layout: anuleaza padding-top: 14px din tema qooxdoo care impingea textul
   in zona filter row. Plus reducem font-size la 12px (tema implicita 16px era prea mare). */
[class*="qx-table-header-cell-label"] {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 12px !important;
}

/* FILTER ROW textboxes — by default qx-textbox-borderSolid e transparent fara border vizibil.
   Adaugam fundal alb + border subtil ca utilizatorul sa vada zona de input. */
.qx-textbox-borderSolid {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(180, 180, 180, 0.6) !important;
    border-radius: 2px !important;
}
.qx-textbox-borderSolid:focus-within {
    border-color: rgba(80, 130, 200, 0.9) !important;
    background-color: #ffffff !important;
}

/* Sort icon: tema DEJA provide iconul ca background-image (18x18 white arrow) pe
   un al doilea div in interiorul cell-ului. Il pozitiona la centru-y (y=28 in
   cell de 56px) — deci jumatatea jos e acoperita de filter row si vezi doar
   varful sagetii.
   Fix: cand filter row e activ, mutam iconul sus (top:4px) ca sa stea
   complet in zona titlu (top 28px). */
[class*="-sorted-"]:not([class*="label"]) > div:not(.qx-table-header-cell-label),
[class$="-sorted"]:not([class*="label"]) > div:not(.qx-table-header-cell-label) {
    top: 4px !important;
}

/* ----------------------------------------------------------
   General improvements
   ---------------------------------------------------------- */

/* Ensure panels inside the UserControl fill properly */
.wisej-usercontrol {
    overflow: hidden;
}

/* Record navigator panel */
.wms-record-navigator {
    background: #f0f0f0;
    border-top: 1px solid #cccccc;
}

/* ----------------------------------------------------------
   DataGridView — icon-uri checkbox (true/false/indeterminate)
   Le facem aproape transparente, ca sa nu fure atentia.
   Tinta: backgroundul subtil ca al context menu-ului.
   ---------------------------------------------------------- */

/* qooxdoo checkbox in cell: clasele uzuale Wisej + qx pentru state-uri */
.qx-CheckBox,
[role="checkbox"],
.qx-data-grid-cell .qx-CheckBox,
.qx-data-grid-cell [role="checkbox"] {
    opacity: 0.35 !important;
}

/* Hover-ul aduce opacitatea ~normala ca utilizatorul sa vada clar valoarea */
.qx-data-grid-cell:hover .qx-CheckBox,
.qx-data-grid-cell:hover [role="checkbox"],
tr:hover .qx-CheckBox,
tr:hover [role="checkbox"] {
    opacity: 0.85 !important;
    transition: opacity 120ms ease-in-out;
}

/* Focusat / selectat: full opacity */
.qx-data-grid-cell-selected .qx-CheckBox,
.qx-data-grid-cell-focused .qx-CheckBox,
.qx-data-grid-row-selected .qx-CheckBox {
    opacity: 1 !important;
}

/* ----------------------------------------------------------
   Butoane filtre operator (=, ≈, >=, etc.) din header coloana
   Vrem fundal subtil, ca al context-menu, si transparent.
   Setat in cod: modeBtn.CssClass = "wms-filter-mode-btn"
   ---------------------------------------------------------- */
.wms-filter-mode-btn {
    background-color: rgba(245, 245, 245, 0.30) !important;
    background-image: url('/Resources/Filter.svg') !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: 14px 14px !important;
    border: 1px solid rgba(180, 180, 180, 0.25) !important;
    box-shadow: none !important;
    opacity: 0.55;
    transition: opacity 120ms ease-in-out, background-color 120ms ease-in-out;
    min-width: 22px;
}
/* hover/focus = mai vizibil */
.wms-filter-mode-btn:hover {
    background-color: rgba(220, 220, 220, 0.85) !important;
    opacity: 1;
    border-color: rgba(120, 120, 120, 0.55) !important;
}

/* ----------------------------------------------------------
   MainPage Dashboard Buttons — layout corect imagine + text
   Red box (text label): jos, customizable color/size din settings
   Green box (image area): zona superioara, BackgroundImage zoom-uit aici
   ---------------------------------------------------------- */
.wms-dashboard-btn {
    /* Imaginea: pozitia top-center, zoom in zona de sus (rezervam ~36px jos pt text) */
    background-position: center 8px !important;
    background-repeat: no-repeat !important;
    /* width:auto, height: total - 40px (text reservation) */
    background-size: auto calc(100% - 40px) !important;
}

/* Cand butonul are containing image foreground (nu background), il pozitionam tot sus */
.wms-dashboard-btn > .qx-image,
.wms-dashboard-btn .qx-atom-image {
    margin-bottom: 4px;
}

/* Selectorii imbricati pentru contoare uzuale Wisej (button > inner div) */
.wms-filter-mode-btn > div,
.wms-filter-mode-btn .qx-button {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Hover/focus: usor mai opaque ca utilizatorul sa stie ca e clickabil.
   IMPORTANT: folosim background-color (NU shorthand "background:"), altfel
   se reseteaza background-image si dispare iconul Filter.svg pe hover. */
.wms-filter-mode-btn:hover {
    background-color: rgba(245, 245, 245, 0.85) !important;
    /* background-image / background-repeat / background-position pastrate din regula default */
    opacity: 1;
    color: rgba(40, 40, 40, 1) !important;
    border-color: rgba(150, 150, 150, 0.55) !important;
}
