/* Стили для иконки шестеренки */
.settings-icon {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.settings-icon:hover {
    transform: rotate(90deg);
}

.settings-icon svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Стили для модального окна */
.settings-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 200, 255, 0.7);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    z-index: 1001;
    min-width: 300px;
}

.settings-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #ffc107;
    text-align: center;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

/* Стили для вкладок */
.tabs {
    display: flex;
}

.tab-item {
    flex: 1;
    padding: 10px 15px;
    cursor: pointer;
    color: #fff;
    transition: all 0.3s ease;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    background: rgba(0, 200, 255, 0.7);
    text-align: center;
}

.tab-item.active {
    background: #007090;
    font-weight: bold;
    color: #fff;
}

.tab-item:not(.active):hover {
    background: rgba(0, 162, 207, 0.7);
}

/* Содержимое вкладок */
.tab-content {
    display: block;
    background: #007090;
    padding: 30px 16px 16px 16px;
}

/* Группа настроек (для отступов и выравнивания) */

.setting-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Группа переключателей */
.switch-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Контейнер переключателя */
.switch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.switch-item:hover {
    background: #f0f0f0;
}

.switch-item:hover .switch-label {
    color: #333;
}

/* Скрытый радио‑вход */
.switch-input {
    opacity: 0;
    position: absolute;
    width: 1px;
    height: 1px;
    clip: rect(0 0 0 0);
}

/* Текст переключателя */
.switch-label {
    font-weight: 500;
    color: #ffffff;
    flex: 1;
}

/* Стиль при активации */
.switch-item.active {
    background: #ffeb3b;
    border-color: #ffc107;
}

.switch-input:checked + .switch-label {
    color: #333;
    font-weight: 600;
}

/* Стили для клавиш */

.key-content {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.key-setting {
    flex: 1 1 45%; /* Каждая карточка занимает ~45% ширины, остаётся место на отступы */
    min-width: 250px; /* Минимальная ширина, чтобы не сжимались слишком сильно */
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0; /* Убираем вертикальный margin, т. к. есть gap */
}

.key-setting label {
    font-weight: bold;
    margin-right: 10px;
}

.key-input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    min-width: 120px;
    text-align: center;
    transition: all 0.3s ease;
}

.key-input:hover {
    background: #f0f0f0;
    color: #333;
}

.key-input.recording {
    color: #333;
    background: #ffeb3b;
    border-color: #ffc107;
}