/*
 * Applari Search - Frontend Styles
 * 
 * These styles apply to the search form and its fields.
 */
 @media screen and (min-width: 320px) {
    /* Form container */
    .applari-search-form {
        margin: 20px 0;
        padding: 20px;
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }

    /* Field containers */
    .applari-search-field-container {
        margin-bottom: 15px;
        box-sizing: border-box;
        padding: 0 10px;
        width: 100%;
    }

    /* Field labels */
    .applari-search-field-label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
    }

    .applari-search-field-label .required {
        color: #cc0000;
        margin-left: 3px;
    }

    /* Field descriptions */
    .applari-search-field-description {
        font-size: 12px;
        color: #666;
        margin-top: 5px;
        font-style: italic;
    }

    /* Standard form elements */
    .applari-search-field {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ccc;
        border-radius: 4px;
        font-size: 14px;
        background-color: #fff;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .applari-search-field:focus {
        border-color: #007cba;
        box-shadow: 0 0 0 1px #007cba;
        outline: none;
    }

    .applari-search-field::placeholder {
        color: #999;
    }

    /* Submit button */
    .applari-search-form button[type="submit"] {
        border: none;
        border-radius: 4px;
        padding: 10px 20px;
        font-size: 16px;
        cursor: pointer;
    }

    .applari-search-form button[type="submit"]:hover {
    }

    /* Range slider */
    .applari-search-form input[type=range]{
        padding:0px;
    }
    .applari-search-form input[type=range]::-webkit-slider-runnable-track {
        width: 100%;
        height: 4px;
        cursor: pointer;
        border-radius: 25px;
    }
    .applari-search-form input[type=range]::-webkit-slider-thumb {
        height: 20px;
        width: 20px;
        border-radius: 50%;
        box-shadow: 0 0 4px 0 rgba(0,0,0, 1);
        cursor: pointer;
        -webkit-appearance: none;
        margin-top: -8px;
    }
    .applari-range-slider-container {
        padding: 5px 0;
        margin-top: 15px;
    }

    .applari-range-slider-minmax {
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
        font-size: 14px;
        color: #666;
    }

    .applari-range-slider-wrapper {
        position: relative;
        padding-top: 30px; /* Tilaa liikkuvalle kuplalle */
        margin-bottom: 10px;
    }


    .applari-range-bubble {
        position: absolute;
        top: -50%;
    }
    .applari-range-bubble span {
        width: 100px;
        height: 24px;
        line-height: 24px;
        text-align: center;
        background: var(--link-clr);
        color: #fff;
        font-size: 12px;
        display: block;
        position: absolute;
        left: 50%;
        transform: translate(-50%, 0);
        border-radius: 6px;
    }
    .applari-range-bubble span:before {
        content: "";
        position: absolute;
        width: 0;
        height: 0;
        border-top: 10px solid var(--link-clr);
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        top: 100%;
        left: 50%;
        margin-left: -5px;
        margin-top: -1px;
    }


    /* Checkbox fields */
    .applari-checkbox-container {
        display: flex;
        align-items: center;
    }

    .applari-checkbox-container.label-left {
        flex-direction: row;
    }

    .applari-checkbox-container.label-right {
        flex-direction: row-reverse;
        justify-content: flex-end;
    }

    .applari-checkbox-field {
        width: auto !important;
        margin: 0 8px;
        cursor: pointer;
    }

    /* Select fields */
    .applari-select-field {
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 10px center;
        background-size: 16px;
        padding-right: 35px;
    }

    .applari-select-field[multiple] {
        background-image: none;
        padding-right: 12px;
        height: auto;
        min-height: 100px;
    }

    /* Tag list / buttons */
    .applari-tag-list-container {
        margin-top: 5px;
    }

    .applari-tag-list-items {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .applari-tag-list-item {
        position: relative;
    }

    .applari-tag-checkbox,
    .applari-tag-radio {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

    .applari-tag-button {
        display: inline-block;
        padding: 8px 12px;
        background-color: #f1f1f1;
        border: 1px solid #ddd;
        border-radius: 30px;
        cursor: pointer;
        font-size: 14px;
        transition: all 0.2s;
    }

    .applari-tag-button:hover {
        background-color: #e9e9e9;
    }

    .applari-tag-button.selected {
        background-color: var(--link-clr);
        color: white;
        border-color:var(--link-clr);
    }

    
}
@media screen and (min-width: 768px) {
    /* Width classes */
    .applari-search-field-width-100, 
    .applari-search-field-width-full {
        width: 100%;
    }

    .applari-search-field-width-75 {
        width: 75%;
    }

    .applari-search-field-width-50,
    .applari-search-field-width-half {
        width: 50%;
    }

    .applari-search-field-width-33,
    .applari-search-field-width-third {
        width: 33.33%;
    }

    .applari-search-field-width-25 {
        width: 25%;
    }
}
