:root {
    --bg-color: rgb(20, 18, 24);
    --text-color: rgb(255, 255, 255);
    --dim-color: rgb(187, 187, 187);
    --btn-color: rgb(90, 90, 90);
    --config-color: rgb(37, 37, 37);
    --container-color: rgba(26, 26, 26, 0.698);
    --container-color-solid: rgba(26, 26, 26);
    --key_px: min(max(44px, min(2.7vw, 5.7vh)), 70px);
    --keyremap_px: min(max(44px, min(2.7vw, 5.7vh)), 76px);
    /*match is with , let btn_size = 52; min(max(52px, 3vw), 76px);  */
    --key_padding: 4px;

    --key_px_small: 12px;
    --key_padding_small: 1px;

    --btn-color-select: rgb(208, 188, 255);
    --disabled-color: rgb(153, 153, 153);

    --checkbox-bg: rgb(153, 153, 153);

    /*
    --md3-primary: rgb(255, 82, 82);
    --md3-hover: rgb(255, 23, 68);
    */
    --md3-primary: rgb(185, 42, 48);
    --md3-hover: rgb(193, 67, 73);

    --md3-on-primary: rgb(255, 255, 255);

    --md3-bg: rgb(18, 18, 18);
    --md3-text: rgb(255, 255, 255);

    --md3-active: rgb(255, 97, 103);

    --drawer-bg: rgb(51, 51, 51);
    --drawer-hover: rgb(77, 77, 77);
}

.light-mode {
    /*
    --bg-color: rgb(254, 247, 255);
    --text-color: rgb(0, 0, 0);
    --btn-color: rgb(103, 80, 164);

    --md3-primary: rgb(211, 47, 47);
    --md3-on-primary: rgb(0, 0, 0);
    --md3-hover: rgb(183, 28, 28);
    --md3-bg: rgb(255, 255, 255);
    --md3-text: rgb(0, 0, 0);
    */
}

.prevent-select {
    -webkit-user-select: none;
    /* Safari */
    -ms-user-select: none;
    /* IE 10 and IE 11 */
    user-select: none;
    /* Standard syntax */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    font-size: 14px;
    font-family: Roboto, sans-serif;
    margin: 0;
}

button,
input,
a,
textarea {
    outline: none;
}

.icon-small-left {
    position: absolute;
    left: 32px;
    top: 14px;
    width: 32px;
    height: 32px;
}

.icon-center-small {
    position: absolute;
    left: calc(50% - 71px);
    top: 18px;
    width: 143px;
    height: 24px;
}

.icon-small-right {
    position: absolute;
    right: 32px;
    top: 14px;
    width: 32px;
    height: 32px;
}

.main-div {
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0px;
    top: 0px;
    background: linear-gradient(302.28deg, rgba(0, 0, 0, 0.2) 17.91%, rgba(0, 0, 0, 0.11) 52.19%, rgba(208, 84, 89, 0.2) 81.63%), #202022;
}

.connect-main {
    padding: 20px;
    display: block;
    width: 200px;
    height: auto;
    border-radius: 8px;
    border: 2px solid rgb(255, 101, 101);
}

.main-content {
    position: fixed;
    left: 0px;
    top: 0px;
    margin-top: 60px;
    margin-left: 325px;
    width: calc(100% - 341px);
    height: calc(max(100%, 900px) - 60px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.drawer {
    position: fixed;
    top: 60px;
    left: 0px;
    padding: 18px 16px 16px 32px;
    width: 321px;
    height: calc(max(100%, 900px) - 60px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    gap: 16px;
}

.drawer-top {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.drawer-bottom {
    margin-top: auto;
}

.divider {
    width: 80%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 5px auto;
}

.menu-item {
    border-radius: 4px;
    margin: 6px;
    padding: 5px;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.menu-item:hover {
    background-color: var(--drawer-hover);
}

.menu-text {
    margin-top: 5px;
    font-size: 11px;
    font-weight: 400;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: var(--md3-primary);
    color: var(--md3-on-primary);
    padding: 12px 16px;
    text-align: left;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s;
    justify-content: space-between;
}

.dropbtn:hover {
    background-color: var(--md3-hover);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    z-index: 1;
    overflow: hidden;
}

.dropdown-content a {
    color: #333;
    width: 148px;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-lang {
    width: 80px;
}

.dropdown-content a:hover {
    background-color: #eeeeee;
}

/*
.dropdown:hover .dropdown-content {
    display: block;
}
*/

.device-info-container {
    width: 241px;
    height: 256px;
    background-color: var(--container-color);
    backdrop-filter: blur(50px);
    border-radius: 10px;
    padding: 16px;
    gap: 16px;
}

.device-info-container-main {
    font-size: 20px;
    font-weight: 700;
}

.device-info-container-info {
    font-size: 14px;
    font-weight: 500;
}

.nav-container {
    width: 241px;
    height: 100%;
    background-color: var(--container-color);
    backdrop-filter: blur(50px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-radius: 10px;
    padding: 16px;
    justify-content: space-between;
}

.nav-item {
    background-color: transparent;
    border: none;
    color: var(--dim-color);
    width: 100%;
    height: 50px;
    padding-left: 31px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 4px;
    gap: 0.3rem;
}

.nav-icon {
    font-size: 16px;
}

.nav-text {
    font-size: 16px;
    font-weight: 700;
    text-align: left;
    width: 160px;
}

.nav-item:hover {
    color: var(--text-color);
}

.nav-item.active {
    color: var(--md3-active);
    background: linear-gradient(90deg, rgba(185, 42, 48, 0.25) 0%, rgba(83, 19, 22, 0.25) 100%), linear-gradient(0deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1));
    border-radius: 10px;
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    width: 80px;
    height: 3px;
    background: #4caf50;
    transition: transform 0.3s ease-in-out;
}

.layer-container {
    display: flex;
    position: relative;
    justify-content: center;
    padding: 10px;
}

.layer-item {
    /*
    background: #FFFFFF1A;
    */
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--dim-color);
    width: 180px;
    height: 35px;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 20px 10px 20px;
    transition: color 0.3s, transform 0.3s;
    gap: 0.3rem;
}

.layer-item:hover {
    color: var(--text-color);
}

.layer-item.active {
    font-weight: 700;
    color: var(--md3-active);
    transform: scale(1.00);
    /*
    background: linear-gradient(90deg, rgba(185, 42, 48, 0.25) 0%, rgba(83, 19, 22, 0.25) 100%), linear-gradient(0deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1));
    */
    border-radius: 4px;
    transition: transform 0.3 ease-in-out;
}

.layer-indicator {
    position: absolute;
    bottom: 0;
    width: 80px;
    height: 3px;
    background: #4caf50;
    transition: transform 0.3s ease-in-out;
}

.linkremap-item {
    /*
    background: #FFFFFF1A;
    */
    background: none;
    border: none;
    border-radius: 4px;
    color: var(--dim-color);
    width: 110px;
    height: 10px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    padding: 10px 20px 10px 20px;
    transition: color 0.3s, transform 0.3s;
    gap: 0.3rem;
}

.sub-container {
    display: flex;
    position: relative;
    justify-content: center;
    padding: 10px;
    margin-bottom: 5px;
}

.sub-item {
    background: none;
    border: none;
    color: var(--dim-color);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px 40px 10px 40px;
    transition: color 0.3s, transform 0.3s;
}

.sub-text {
    font-size: 14px;
    font-weight: 500;
}

.config-container {
    display: flex;
    justify-content: center;
}

.sub-item:hover {
    color: var(--text-color);
}

.sub-item.active {
    color: var(--text-color);
    transform: scale(1.02);
    background-color: var(--btn-color);
    border-radius: 10px;
    transition: transform 0.3 ease-in-out;
}

.slider-container {
    position: relative;
    width: 450px;
    margin: 0px;
    text-align: center;
}

.slider-container-vertical {
    position: relative;
    width: 250px;
    margin: 0px;
    text-align: center;
}

.slider {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    background: linear-gradient(to right, #007BFF 50%, #ddd 50%);
    border-radius: 3px;
    outline: none;
    transition: 0.2s;
    transform: rotate(0deg);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--md3-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--md3-primary);
    border-radius: 50%;
    cursor: pointer;
}

.slider:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.slider:disabled::-webkit-slider-thumb {
    background: var(--disabled-color)
}

.slider-value {
    margin-top: 8px;
    font-size: 16px;
    color: #d1d1d1;
}

.travel-bar {
    width: 250px;
    height: 20px;
    margin: 2px;
    background-color: var(--btn-color);
    border-radius: 5px;
    position: relative;
}

.travel-bar.inner {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 0%;
    height: 20px;
    background-color: var(--text-color);
    transition: width 0.07s ease-out;
}

.ruler-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 1px;
}

.ruler {
    position: relative;
    width: 248px;
    height: 50px;
    background: transparent;
    display: flex;
    align-items: flex-end;
    padding: 5px;
}

.tick {
    position: absolute;
    bottom: 0;
    width: 2px;
    background: var(--text-color);
}

.label {
    position: absolute;
    bottom: 32px;
    font-size: 14px;
    color: var(--text-color);
    transform: rotate(-90deg);
    /* Rotate text vertically */
    transform-origin: left bottom;
    /* Align rotation properly */
}

.button-gradiant {
    background-color: transparent;
    border: none;
    color: var(--dim-color);
    width: 100%;
    height: 50px;
    padding-left: 31px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 4px;
    gap: 0.3rem;
}

.button-gradiant.active {
    color: var(--md3-active);
    background: linear-gradient(90deg, rgba(185, 42, 48, 0.25) 0%, rgba(83, 19, 22, 0.25) 100%), linear-gradient(0deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1));
    border-radius: 10px;
}

.md3-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    color: var(--md3-on-primary);
    background-color: var(--md3-primary);
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px var(--md3-shadow);
}

.md3-button:hover {
    background-color: var(--md3-hover);
    box-shadow: 0 4px 8px var(--md3-shadow);
}

.md3-button:active {
    background-color: var(--md3-hover);
    box-shadow: 0 2px 4px var(--md3-shadow);
    transform: scale(0.98);
}

.md3-button:disabled {
    background: var(--disabled-color);
    cursor: default;
    transform: scale(1);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-checkbox {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--checkbox-bg);
    transition: 0.3s;
    border-radius: 24px;
}

.slider-checkbox::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.slider-checkbox {
    background-color: var(--md3-primary);
}

input:checked+.slider-checkbox::before {
    transform: translateX(26px);
}

.slider-checkbox:disabled {
    background-color: #ffffff;
}

input:disabled+.slider-checkbox {
    background-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

input:disabled+.slider-checkbox::before {
    background-color: #bdbdbd;
}

.reload-notification {
    position: fixed;
    background-color: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-direction: column;
    opacity: 0;
    display: none;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    min-width: 200px;
}

.notify-bottom {
    bottom: 20px;
    right: 20px;
}

.notify-top {
    top: 20px;
    right: 20px;
}

.show {
    opacity: 1;
    display: block;
    transform: translateY(0);
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* dim background */
    /*display: flex;*/
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: var(--container-color-solid);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 90%;
}

.close-btn,
.confirm-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.close-btn:hover,
.confirm-btn:hover {
    color: red;
}

.close-btn {
    align-self: flex-end;
}

.confirm-btn {
    align-self: flex-end;
    color: green;
    margin-top: 10px;
}

.config-div-parent {
    display: flex;
    justify-content: center;
    /* horizontal */
    align-items: center;
    width: 100%;
    /*height: calc(calc(max(100vh, 900px) - 156px) - calc(6.25*(var(--key_px)*1.0)));*/
}

.config-div {
    display: block;
    padding: 20px 50px 20px 50px;
    background-color: var(--container-color);
    backdrop-filter: blur(50px);
    border-radius: 10px;
    /*
    min-width: 1096px;
    */
    width: max(max-content, 100%);
    min-height: 386px;
    max-height: calc(calc(max(100vh, 900px) - 196px) - calc(6.25*(var(--key_px)*1.0)));
}

.selection-box {
    position: absolute;
    height: 0px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 2px solid rgb(255, 101, 101);
    pointer-events: none;
    display: none;
}

.kb {
    width: calc(var(--kbx, 1)*(var(--key_px)*1.0));
    height: calc(max(var(--kby, 1), 6.25)*(var(--key_px)*1.0));
    --kb-padding: 0px;
    padding: var(--kb-padding);
    background-color: transparent;
    border-radius: 10px;
    margin-top: 0px;
}

.divKBparent {
    width: 100%;
    height: calc(calc(6.25*(var(--key_px)*1.0)) + 80px);
    padding-left: 0px;
    text-align: left;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kb-small {
    width: calc(var(--kbx, 1)*(var(--key_px_small)*1.0));
    height: calc(max(var(--kby, 1), 5.00)*(var(--key_px_small)*1.0));
    --kb-padding_small: 5px;
    padding: var(--kb-padding_small);
    background-color: var(--dim-color);
    border-radius: 3px;
    margin-top: 0px;
    margin-bottom: calc((6.25 - max(var(--kby, 1), 5.00))*(var(--key_px_small)));
}

.bar-fill {
    position: absolute;
    left: 0px;
    top: 0px;
    width: 5px;
    height: 0%;
    background: rgb(255, 0, 0);
    border-radius: 3px;
    transition: height 0.02s ease-out;
}

.bar-marker {
    position: absolute;
    width: 10px;
    height: 1px;
    background: rgb(53, 255, 80);
    left: 0;
    bottom: 0%;
    transition: bottom 0.3s ease-in-out;
}

kb-key {
    width: calc(var(--zx, 1)*(var(--key_px)*1.0) - var(--key_padding));
    height: calc(var(--zy, 1)*(var(--key_px)*1.0) - var(--key_padding));
    padding: 0;
    margin: 0;
}

kb-key-remap {
    width: calc(var(--zx, 1)*(var(--key_px)*1.0) - var(--key_padding));
    height: calc(var(--zy, 1)*(var(--key_px)*1.0) - var(--key_padding));
    padding: 0;
    margin: 0;
}

kb-key-small {
    width: calc(var(--zx, 1)*(var(--key_px_small)*1.0) - var(--key_padding_small));
    height: calc(var(--zy, 1)*(var(--key_px_small)*1.0) - var(--key_padding_small));
    padding: 0;
    margin: 0;
}

.grid-container-small {
    display: grid;
    border: 2px solid var(--btn-color);
    border-radius: 1.25px;
    background-color: var(--btn-color);
    box-sizing: border-box;
    padding: 1px;
    grid-template-columns: 1fr 3fr;
    grid-template-rows: 1fr 1fr 1fr 1fr;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.grid-container {
    display: grid;
    border: 2px solid var(--btn-color);
    border-radius: 5px;
    background-color: var(--btn-color);
    box-sizing: border-box;
    padding: 4px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.grid-container-hidden {
    display: grid;
    background-color: none;
    box-sizing: border-box;
    padding: 4px;
}

.grid-container.active {
    border-color: var(--btn-color-select);
}

.grid-container:hover {
    transform: scale(0.95);
}

.corner {
    font-size: calc(var(--key_px)*9/60);
    font-weight: 300;
    pointer-events: none;
}

.center-center {
    grid-column: 1/3;
    grid-row: 1/5;
    align-self: center;
    justify-self: center;
    font-size: calc(var(--key_px)*14/60);
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
}

.top-left {
    grid-column: 1/3;
    grid-row: 1/3;
    align-self: start;
    justify-self: center;
    font-size: calc(var(--key_px)*13/60);
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
    padding-left: 0px;
}

.top-left-start {
    grid-column: 1/3;
    grid-row: 1/3;
    align-self: start;
    justify-self: start;
    font-size: calc(var(--key_px)*13/60);
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
    padding-left: 0px;
}

.bottom-left {
    grid-column: 1/3;
    grid-row: 2/4;
    align-self: end;
    justify-self: center;
    font-size: calc(var(--key_px)*13/60);
    font-weight: 500;
    padding-left: 0px;
}

.bottom-left-start {
    grid-column: 1/3;
    grid-row: 2/4;
    align-self: end;
    justify-self: start;
    font-size: calc(var(--key_px)*13/60);
    font-weight: 500;
    padding-left: 0px;
}

.top-right {
    grid-column: 2;
    grid-row: 1;
    align-self: top;
    justify-self: end;
    font-size: calc(var(--key_px)*11/60);
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
}

.bottom-right {
    grid-column: 2;
    grid-row: 4;
    align-self: end;
    font-size: calc(var(--key_px)*11/60);
    font-weight: 500;
    justify-self: end;
    white-space: nowrap;
    overflow: visible;
}

.second-right {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    justify-self: end;
    font-size: calc(var(--key_px)*11/60);
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
}

.third-right {
    grid-column: 2;
    grid-row: 3;
    align-self: end;
    justify-self: end;
    font-size: calc(var(--key_px)*11/60);
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
}

.middle-right {
    grid-column: 2;
    grid-row: 2/4;
    align-self: center;
    justify-self: end;
    font-size: calc(var(--key_px)*11/60);
    font-weight: 500;
    white-space: nowrap;
    overflow: visible;
}

.btn-symbol {
    font-size: calc(var(--key_px)*11/60);
}

.btn-small {
    font-size: calc(var(--key_px)*9/60);
}

.row:after {
    content: "";
    display: table;
    clear: both;
}

#just-line-break {
    white-space: pre-line;
}

#line-break-and-tab {
    white-space: pre-wrap;
}

.btn-space {
    top: calc(var(--key_px)*(var(--y, 0) - var(--oy, 0)) + var(--kb-padding));
    left: calc(var(--key_px)*(var(--x, 0) - var(--ox, 0)) + var(--kb-padding));
    display: inline-block !important;
    vertical-align: top;
    position: absolute;
    margin: 2px 2px 2px 2px;
    font-size: 0px;
}

.btn-space-small {
    top: calc(var(--key_px_small)*(var(--y, 0) - var(--oy, 0)) + var(--kb-padding_small));
    left: calc(var(--key_px_small)*(var(--x, 0) - var(--ox, 0)) + var(--kb-padding_small));
    display: inline-block !important;
    vertical-align: top;
    position: absolute;
    margin: 0.5px 0.5px 0.5px 0.5px;
    font-size: 0px;
}

.btn-remap-flex {
    display: inline-block;
    height: calc((var(--key_px)*1.0) - var(--key_padding));
    vertical-align: top;
    position: relative;
    margin: 2px 2px 2px 2px;
    font-size: 0px;
}

.btn-remap {
    display: inline-block;
    position: relative;
    vertical-align: top;
    margin: 2px 2px 2px 2px;
    font-size: 0px;
}

.hover-div::before {
    content: attr(data-tooltip);
    /* Get tooltip text from data-tooltip attribute */
    visibility: hidden;
    opacity: 0;
    width: max-content;
    /* Adjust width based on content */
    max-width: 200px;
    /* Prevent it from being too wide */
    background-color: #333;
    color: #fff;
    font-size: 14px;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1000;
    /* Ensure tooltip is on top of other content */

    /* Positioning above the div */
    bottom: calc(100% + 10px);
    /* 100% of div height + 10px gap */
    left: 50%;
    transform: translateX(-50%);
    /* Center horizontally */

    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* Smooth fade in/out */
    pointer-events: none;
    /* Allows clicks/hovers to pass through the tooltip to the element below if needed */
}

.hover-div::after {
    content: "";
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1001;
    /* Above tooltip text */
    top: -10px;
    /* Position at the bottom edge of the tooltip text pseudo-element */
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
    /* Creates a downward-pointing triangle */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.hover-div:hover::before,
.hover-div:hover::after {
    visibility: visible;
    opacity: 1;
}

.grid-config {
    display: grid;
    width: 100%;
    padding: 8px 8px 8px 0px;
    box-sizing: border-box;
    grid-template-columns: 3fr 1fr;
}

.grid-config-left {
    grid-column: 1;
    align-items: center;
    justify-self: left;
}

.grid-config-right {
    grid-column: 2;
    align-items: center;
    justify-self: right;
}

.text-detail {
    font-size: 14px;
    font-weight: 500;
}

.advanced-menu-main {
    display: block;
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.5;
}

.advanced-menu-detail {
    display: block;
    width: 100%;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

.advanced-key-button {
    display: inline-block;
    vertical-align: top;
    width: 160px;
    height: 200px;
    border: 2px solid var(--btn-color);
    border-radius: 4px;
    background-color: var(--btn-color);
    box-sizing: border-box;
    transition: background-color 0.3s ease, transform 0.3s ease;
    padding: 8px;
    margin: 10px;
    cursor: pointer;
}

.advanced-key-button:hover {
    transform: scale(0.95);
}

.advanced-key-button-icon {
    display: block;
    width: 100%;
    text-align: center;
}

.advanced-key-button-icon-size {
    font-size: 48px;
}

.advanced-key-button-main {
    display: block;
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.advanced-key-button-detail {
    display: block;
    width: 100%;
    font-size: 12px;
    font-weight: 400;
    text-align: left;
}

.dot-group {
    display: block;
    gap: 1rem;
    align-items: center;
}

.dot-radio {
    margin-bottom: 10px;
}

input[type="radio"] {
    display: none;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    border: 5px solid transparent;
    background-color: var(--checkbox-bg);
}

input[type="radio"]:checked+.dot {
    border: 5px solid var(--md3-primary);
    background-color: transparent;
}

#dksboard {
    display: flex;
    gap: 60px;
    position: relative;
}

.dkscolumn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 230px;
    width: 20px;
    position: relative;
}

.dksdot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: gray;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    user-select: none;
    margin: auto;
    position: relative;
    z-index: 1;
}

.dksdetail {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: none;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    user-select: none;
    margin: auto;
    position: relative;
    z-index: 1;
}

.dksdetail.left {
    width: 60px;
    justify-content: left;
}

.dksdot.active {
    background: #facc15;
    z-index: 3;
}

.dksdot.connected {
    background: var(--md3-primary);
    z-index: 3;
}

.bar,
.preview-line {
    position: absolute;
    height: 24px;
    background: var(--md3-primary);
    border-radius: 999px;
    cursor: pointer;
    z-index: 2;
}

.preview-line {
    background: #facc15;
    opacity: 0.6;
    pointer-events: none;
}

.scroll-custom {
    overflow-y: scroll;
}

.scroll-custom::-webkit-scrollbar {
    width: 8px;
}

.scroll-custom::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-custom::-webkit-scrollbar-thumb {
    background-color: var(--md3-on-primary);
    border-radius: 4px;
    transition: background-color 0.3s;
}

.scroll-custom::-webkit-scrollbar-thumb:hover {
    background-color: var(--md3-on-primary);
}

.progress-container {
    width: 300px;
    height: 20px;
    background-color: #ddd;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: #4caf50;
    transition: width 0.1s ease;
}

.grid-fullwidth-nomargin {
    width: 100%;
    display: inline-block;
}

.grid-fullwidth {
    width: 100%;
    margin-bottom: 20px;
    display: inline-block;
}

.grid-fullwidth-center {
    width: 100%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.grid-left {
    align-items: left;
}

.grid-2-no-fullwidth {
    display: grid;
    width: max-content;
    padding: 8px;
    box-sizing: border-box;
    grid-template-columns: 1fr 1fr;
}

.grid-minwidth {
    min-width: 350px;
}

.grid-2 {
    display: grid;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    grid-template-columns: 1fr 1fr;
}

.grid-2-split12 {
    display: grid;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    grid-template-columns: 1fr 2fr;
}

.grid-2-1 {
    grid-column: 1;
    align-items: center;
    justify-self: center;
    padding: 20px;
    width: 90%;
}

.grid-2-2 {
    grid-column: 2;
    align-items: center;
    justify-self: center;
    padding: 20px;
    width: 90%;
}

.grid-2-padding-0 {
    padding: 0px;
}

.grid-2-padding-10 {
    padding: 0px 10px 20px 0px;
    justify-self: left;
}

.grid-3 {
    display: grid;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    grid-template-columns: auto auto auto;
    gap: 40px;
}

.grid-3.equal {
    grid-template-columns: 1fr 1fr 1fr;
}

.grid-3-1 {
    grid-column: 1;
    align-items: center;
    justify-self: center;
    width: 80%;
}

.grid-3-2 {
    grid-column: 2;
    align-items: center;
    justify-self: center;
    width: 100%;
}

.grid-3-3 {
    grid-column: 3;
    align-items: center;
    justify-self: center;
    width: 90%;
}

.grid-24 {
    display: grid;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    grid-template-columns: 1fr 8fr;
    grid-template-rows: 1fr 1fr 1fr 1fr;
}

.grid-24-11 {
    grid-column: 1;
    grid-row: 1;
    align-items: center;
    justify-self: center;
}

.grid-24-12 {
    grid-column: 1;
    grid-row: 2;
    align-items: center;
    justify-self: center;
}

.grid-24-13 {
    grid-column: 1;
    grid-row: 3;
    align-items: center;
    justify-self: center;
}

.grid-24-14 {
    grid-column: 1;
    grid-row: 4;
    align-items: center;
    justify-self: center;
}

.grid-24-21 {
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    justify-self: left;
}

.grid-24-22 {
    grid-column: 2;
    grid-row: 2;
    align-items: center;
    justify-self: left;
}

.grid-24-23 {
    grid-column: 2;
    grid-row: 3;
    align-items: center;
    justify-self: left;
}

.grid-24-24 {
    grid-column: 2;
    grid-row: 4;
    align-items: center;
    justify-self: left;
}

.general-text-main {
    display: block;
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.5;
}

.general-text-detail {
    display: block;
    width: 100%;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 6px;
    line-height: 1.5;
}

.color-picker {
    width: 60px;
    height: 60px;
    margin-left: 0px;
}

.keytest-box {
    border-radius: 8px;
    border: 2px solid var(--dim-color);
}

#notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.notification {
    color: white;
    padding: 15px 20px;
    margin: 0;
    border-radius: 8px;
    font-family: sans-serif;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: gray;
    /* fallback */
    opacity: 1;
    animation: fadein 0.3s;
}

.success {
    background-color: #28a745;
}

.error {
    background-color: #dc3545;
}

.info {
    background-color: #007bff;
}

@keyframes fadein {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeout {
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}