/* ==========================================================================
   CoOrdio Suite Portal — select skin for pages not yet on the portal layout

   One job: make every <select> in the app share the dropdown look of the
   CoOrdio Suite Portal design system, on the page groups that still run on the
   old layouts (_LayoutAccounts, _Layout, _LayoutGalaxy).

   The spec is the reference design's `SelectInput`
   (Coordio-Suite-Portal/src/galaxy/ui.tsx: fieldClass + appearance-none + the
   14px #8a858c chevron), which is also exactly what `.portal-page select`
   already renders on the ~40 converted pages — so a select styled here and a
   select on a portal page are the same control.

   Opt-in: scoped to `body.pp-selects`, set by the layouts that load this file.
   Nothing else on those pages is touched.

   Specificity: `body.pp-selects select` is (0,1,1), which beats
   accounts_style's `form select` (0,0,2), bootstrap 3's `.form-control` (0,1,0)
   and galaxy_style's `.accountPanel__select` (0,1,0). Only padding needs
   !important, because accounts_style declares `padding: 10px !important` and
   would otherwise wipe the caret gutter and drop the chevron onto the text.
   ========================================================================== */

body.pp-selects select:not(.k-input):not(.k-picker):not(.k-dropdown):not(.k-dropdown-list):not([multiple]) {
    appearance: none;
    -webkit-appearance: none;
    /* Bootstrap 3's .form-control pins height:34px, which clips the option text
       once the portal padding is applied. Let the control size to its content. */
    height: auto;
    padding: 12px 36px 12px 14px !important;
    border: 1px solid #e1dcd7;
    border-radius: 10px;
    background-color: #fffefd;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a858c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-size: 14px;
    color: #302d40;
    outline: none;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    /* 12px is the reference spec. It is set here even though these pages run a
       larger type scale, because the ask was that dropdowns match each other
       across the whole app — a select at the legacy 16px is visibly a different
       control from the same select on a portal page. The text inputs beside it
       stay on the legacy scale and end up a few px taller; converting those is a
       separate change. */
    font-size: 12px;
}

body.pp-selects select:not(.k-input):not(.k-picker):not(.k-dropdown):not(.k-dropdown-list):not([multiple]):hover {
    border-color: #cbb8eb;
}

body.pp-selects select:not(.k-input):not(.k-picker):not(.k-dropdown):not(.k-dropdown-list):not([multiple]):focus {
    border-color: #9b7bd0;
    box-shadow: 0 0 0 2px #e7ddf4;
}

body.pp-selects select:not(.k-input):not(.k-picker):not(.k-dropdown):not(.k-dropdown-list):not([multiple])[disabled],
body.pp-selects select:not(.k-input):not(.k-picker):not(.k-dropdown):not(.k-dropdown-list):not([multiple])[readonly] {
    background-color: #f4f1ec;
    color: #918b91;
    cursor: not-allowed;
}

/* A multi-line select has no caret and must keep its own height, so it gets the
   colours and the radius but not the gutter or the chevron. */
body.pp-selects select[multiple] {
    border: 1px solid #e1dcd7;
    border-radius: 10px;
    background-color: #fffefd;
    color: #302d40;
}
