﻿
/*
    //=======================================================================================
    // Author: Reidar Lange
    // Date: 27.02.2024
    // Language: css (Cascading Style sheet)
    // Program: ShipWeight Web
    // Purpose: Provides css styling for the sw_combobox component.
    // Access control:
    // Last revision: 26.02.2024 - #240210-30
    //=======================================================================================*/


    .sw_combobox {
        position: relative;
        display: inline-block;
        margin-top: 0px;
        border: 1px solid rgb(237, 237, 237);
        border-radius: 4px;
        box-shadow:rgba(0, 0, 0, 0.075) 0px 1px 1px 0px inset;
        padding-top:2px;
        padding-left:5px;
        padding-right:2px;
        height:24px;
    }
        .sw_combobox input,
        .sw_combobox select {
            height: 20px;
            line-height: 20px;
        }

    .sw_combobox:focus-within {
        border: 1px solid var(--control-color); /* 261012-03: focus follows the selected program palette. */
        outline:unset;
        box-shadow:unset;
    }

    .sw_combobox select {
        width: 100%;
        height: calc(100% - 0px);
        padding: 0px;
        margin-top: 0px;
        border: none;
        box-sizing: border-box;
        outline: none;
        color: rgb(51,51,51); /*#240302-11*/
    }

    .sw_combobox select:disabled {
        opacity:1;
        cursor:no-drop;
    }
    .sw_combobox input {
        position: absolute;
        width: calc(100% - 20px);
        height: calc(100% - 3px);
        border: none;
        outline: none;
        padding: 2px;
        color: rgb(51,51,51); /*#240302-11*/
    }

    .sw_combobox.select-open select {
        display: block;
    }

.section-group {
    position: relative;
    border: solid 1px;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 10px;
}

.section-title {
    font-family: var(--font-family);
    font-size: var(--font-size);
    position: absolute;
    left: 10px;
    top: -10px;
    padding-left: var(--element-padding);
    padding-right: var(--element-padding);
    background-color: var(--main-bg-color);
}

/*
    //=======================================================================================
    // Author: Reidar Lange
    // Date: 07.11.2025
    // Language: CSS
    // Program: ShipWeight Web
    // Purpose: Scoped styling for combobox used in Global Filter dialog.
    // Notes: Does not affect standard .sw_combobox components used elsewhere.
    //=======================================================================================
*/

.sw_combobox_filter {
    position: relative;
    top: -1px;
    display: inline-block;
    margin-top: 0;
    border: none;
    border-radius: 4px;
    box-shadow: rgba(0, 0, 0, 0.075) 0px 1px 1px 0px inset;
    padding-top: 0;
    padding-left: 5px;
    padding-right: 2px;
    height: 24px;
}

    /* Dropdown (select) */
    .sw_combobox_filter select {
        position: absolute;
        width: 100%;
        height: 18px;
        padding: 0;
        margin-top: 0;
        border: none;
        box-sizing: border-box;
        outline: none;
        color: rgb(51, 51, 51);
        z-index: 1;
    }

        .sw_combobox_filter select:disabled {
            opacity: 1;
            cursor: no-drop;
        }

    /* Editable text input */
    .sw_combobox_filter input {
        position: absolute;
        top: 1px; /* flytter inputfeltet 1px ned */
        left: 7px; /* gir visuell balanse mot label */
        width: calc(100% - 20px);
        height: calc(100% - 3px);
        border: none;
        outline: none;
        padding: 2px;
        color: rgb(51, 51, 51);
        z-index: 2;
        background-color: white;
    }

    /* Open state (unchanged logic) */
    .sw_combobox_filter.select-open select {
        display: block;
    }

    /* Remove default focus outline */
    .sw_combobox_filter:focus-within {
        border: none;
        outline: none;
        box-shadow: none;
    }


/* 261012-03: Browser autofill must retain the shared toolbar background instead of its blue highlight. */
.toolbar .sw_combobox input:-webkit-autofill,
.toolbar .sw_combobox input:-webkit-autofill:hover,
.toolbar .sw_combobox input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--background-color-light2) inset;
    -webkit-text-fill-color: var(--light-control-text-color);
}