﻿/* Base styles for toolbar */
.toolbar {
    display: flex;
    align-items: center;
    background-color: #2c2c2c;
    padding: 10px;
    flex-wrap: wrap; /* Allows elements to wrap if needed */
    gap: 15px; /* Add space between elements */
    margin: -20px -20px 0px -20px;
}

/* Primary button */
.btn-primary button,
.btn-toggle button,
.btn-group-toggle div button,
.input-with-btn button {
    background-color: #333;
    color: #ccc;
    border: none;
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

/* Adjust buttons for mobile */
button {
    padding: 12px 16px;
    font-size: 16px; /* Increase font size for mobile */
}

/* Responsive layout for smaller screens */
@media (max-width: 600px) {
    .toolbar {
        flex-direction: column; /* Stack toolbar elements vertically */
        align-items: stretch; /* Stretch items to fill width */
        padding: 10px 15px; /* Add padding to the toolbar on smaller devices */
        gap: 10px; /* Add spacing between elements vertically */
    }

    .divider {
        display: none; /* Hide dividers on mobile */
    }

    .btn-primary button,
    .btn-toggle button,
    .btn-group-toggle div button,
    .input-with-btn button {
        width: auto; /* Fix width handling for buttons on mobile */
        margin-bottom: 10px; /* Add space between stacked buttons */
        margin-right: 0px; /* Ensure no margin on the right */
    }

    .input-with-btn {
        display: flex;
        width: 100%; /* Full width on mobile */
        position: relative;
        align-items: center;
    }

        .input-with-btn input {
            flex-grow: 1; /* Ensure input takes up available space */
            padding: 10px 40px 10px 10px; /* Make room for the icon inside */
            font-size: 16px;
            width: 100%;
            box-sizing: border-box; /* Ensure proper width calculation */
        }

        .input-with-btn button {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            padding: 0;
            height: 100%;
        }

    /* Ensure space between buttons and toolbar edge */
    button {
        margin-right: 10px; /* Add right margin for all buttons */
    }

    /* Adjust toggle switch size for mobile */
    .switch {
        width: 50px; /* Make the switch larger for touch-friendliness */
        height: 26px;
    }

    .slider:before {
        height: 20px;
        width: 20px;
        left: 3px;
        bottom: 3px;
    }

    input:checked + .slider:before {
        transform: translateX(24px); /* Adjust for larger switch */
    }

    /* Toggle switch span next to the switch */
    .switch-container {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        margin-top: 10px; /* Add some space above the toggle */
    }

        .switch-container span {
            margin-left: 10px; /* Space between the switch and its label */
            font-size: 16px;
            color: var(--text-color-secondary)
        }
}

/* Hover and active state adjustments */
.btn-primary button:hover,
.input-with-btn button:hover {
    background-color: #444;
    color: #fff;
}

.btn-primary button:active,
.input-with-btn button:active {
    background-color: #666 !important;
    transition: none;
    color: #fff;
}

/* Selected button state for toggle and group toggle buttons */
.btn-toggle button.active,
.btn-group-toggle div.selected button {
    background-color: #444;
    color: #fff;
}

/* Flex layout for toggle button group, with buttons inside div */
.btn-group-toggle {
    display: flex;
    align-items: center;
}

    .btn-group-toggle div {
        display: flex;
        align-items: center;
    }

        /* Remove border radius from all buttons in the group */
        .btn-group-toggle div button {
            border-radius: 0;
            border: none;
            border-right: 1px solid #555;
        }

        /* Add rounded corners only to the first button in the first div */
        .btn-group-toggle div:first-child button:first-child {
            border-top-left-radius: 5px;
            border-bottom-left-radius: 5px;
        }

        /* Add rounded corners only to the last button in the last div */
        .btn-group-toggle div:last-child button:last-child {
            border-right: none;
            border-top-right-radius: 5px;
            border-bottom-right-radius: 5px;
        }

button span {
    margin-left: 8px;
}

.divider {
    width: 1px;
    height: 30px;
    background-color: #555;
    margin: 0 10px;
}

.input-with-btn {
    display: flex;
    align-items: center;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-btn input {
    padding: 10px 40px 10px 10px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    background-color: #333;
    color: #ccc;
    outline: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

    .input-with-btn input:focus {
        background-color: #444;
        color: #fff;
    }

.input-with-btn button {
    position: absolute;
    right: 10px;
    background-color: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 0;
}

.input-wrapper button:hover {
    color: #fff;
}

/* Toggle Switch */
.switch-container {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    margin-right: 10px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: #0066ec;
}

    input:checked + .slider:before {
        transform: translateX(18px);
    }
