/*
 * Copyright 2024 Julien LE CLEACH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * Button styles
 */
.button {
    display: inline-block;
    padding: 2px 4px;
    margin-bottom: 2px;
    background-image: linear-gradient(180deg, var(--vlight2-color), var(--vlight1-color));
    border: none;
    border-radius: 6px;
    box-shadow: 0 2px #666;
    color: var(--text-color);
    font-size: .8em;
    text-decoration: none;
    text-align: center;
    outline: none;
}

.button.on {
    cursor: pointer;
}

.button.off {
    cursor: not-allowed;
    color: var(--light2-color);
    background-color: var(--light1-color);
    background-image: none;
    box-shadow: 0 2px #555;
}

.button.on:hover {
    background-image: linear-gradient(180deg, var(--light1-color), var(--light2-color));
}

.button.on:active {
    background-image: linear-gradient(180deg, var(--dark1-color), var(--dark2-color));
    transform: translateY(1px);
    box-shadow: 0 1px #777, 0 -1px #777;
}

.button.active {
    color: var(--selected-color);
    background-image: linear-gradient(180deg, var(--dark1-color), var(--dark2-color));
    box-shadow: 0 1px #777, 0 -1px #777;
    transform: translateY(1px);
}

.button.active.on:hover {
    background-image: linear-gradient(180deg, var(--light1-color), var(--light2-color));
}

.button.active.on:active {
    background-image: linear-gradient(180deg, var(--vlight2-color), var(--vlight1-color));
    box-shadow: 0 2px #666;
    transform: translateY(-1px);
}

/* Button group based on button definition above */
div.button_group {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

div.button_group .button:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 1px;
}

div.button_group .button:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
