/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500&display=swap");

:root {
    --bs-body-line-height: 1;
}

/* Общие стили */
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

body {
    font-family: "Poppins", sans-serif;
    background-color: #0d0d0d;
    color: #f0f0f0;
    margin: 0;
    padding: 0;
}

input,
button {
  border: none;
  outline: none;
}

a {
  text-decoration: none;
}


.site-title {
    font-size: 1.8em;
    color: #f0f0f0;
    font-weight: bold;
    letter-spacing: 1px;
}

.table_edit {
    width: 1em;
    max-width: unset;
}
.table_edit:hover {
    cursor: pointer;
}

button,
a.button {
    background-color: #000;
    color: #ff3b3b;
    border: 2px solid #ff3b3b;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 5px;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    transition: background-color 0.3s, color 0.3s;
}

/* Эффект при наведении на все кнопки */
button:not(.disabled-button):hover,
a.button:not(.disabled-button):hover {
    background-color: #ff3333;
    color: #fff;
    cursor: pointer;
}

/* Для красивой кнопки, если она станет активной */
button.disabled-button,
a.button.disabled-button {
    background-color: #000;
    color: #ff3333;
    border: 2px solid #ff3333;
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0.5;
    cursor: not-allowed;
}

div:not(.login) form select, 
div:not(.login) form input[type="text"],
div:not(.login) form input[type="password"],
div:not(.login) form input[type="file"],
div:not(.login) input[type="date"] {
    width: 100%;
    padding: 12px;
    background-color: #0d0d0d;
    border: 1px solid #ff3b3b;
    color: #f0f0f0;
    border-radius: 5px;
    margin-bottom: 1em;
}

div:not(.login) form input[type="file"]::-webkit-file-upload-button {
    padding: 12px;
    background-color: #0d0d0d;
    border: 1px solid #ff3b3b;
    color: #f0f0f0;
    border-radius: 5px;
    cursor: pointer;
}

/* Сбрасываем стандартный вид чекбокса */
div:not(.login) form input[type="checkbox"] {
    appearance: none;           /* Сбрасываем вид */
    -webkit-appearance: none;   /* Для Safari/Chrome */
    background-color: #0d0d0d;  /* Фон, как у текстовых полей */
    border: 1px solid #ff3b3b;  /* Красная рамка */
    color: #f0f0f0;             /* Текст (если нужно) */
    width: 48px;                /* Ширина */
    height: 48px;               /* Высота */
    border-radius: 5px;         /* Округлые края */
    cursor: pointer;            /* Указываем, что кликабельно */
    margin-bottom: 1em;         /* Отступ, как у input */
    position: relative;         /* Чтобы псевдоэлемент позиционировался относительно чекбокса */
    outline: none;
    transition: background-color 0.3s, border 0.3s;
}

/* При наведении можно чуть менять цвет рамки */
div:not(.login) form input[type="checkbox"]:hover {
    border: 1px solid #f0f0f0;
}

/* Состояние checked: фон меняем на красный */
div:not(.login) form input[type="checkbox"]:checked {
    background-color: #ff3b3b;
}

/* Для чекнутого чекбокса добавим галочку псевдоэлементом */
div:not(.login) form input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 0px;
    left: 12px;
    width: 20px;
    height: 30px;
    border: solid #0d0d0d;   /* Цвет галочки контрастный фону */
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Можно добавить эффект при фокусе */
div:not(.login) form input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(255, 59, 59, 0.5);
}

form button {
    background-color: #ff3b3b;
    color: #0d0d0d;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    border-radius: 5px;
}

form button:hover {
    background-color: #f0f0f0;
    color: #ff3b3b;
    transition: background-color 0.3s, color 0.3s;
}

.disabled-button {
    pointer-events: none;
    opacity: 0.5;
}


/* Стили для поля поиска */
#search {
    width: 200px;
    height: 40px;
    background-color: #000;
    color: #ff3333;
    border: 2px solid #ff3333;
    padding: 10px;
    border-radius: 5px;
}


/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
 
/* Firefox */
input[type=number] {
  -moz-appearance:textfield;
}

input:last-child {
    margin-bottom: 0 !important;
}


/* CAMPAIGN */
#campaignForm {
    padding: 20px;
}

.container_2 {
    display: flex;
    flex-flow: row nowrap;
    gap: 2em;
}

.form-section {
    width: 100%;
    height: fit-content;
    background-color: #1a1a1a;
    padding: 20px;
    border: 2px solid #ff3b3b;
    border-radius: 10px;
    color: #f0f0f0;
}

.flows-container_2 {
    display: flex;
    flex-flow: column nowrap;
    gap: 1em;
}

.form-section h2 {
    color: #ff3b3b;
    margin: 0;
    text-align: center;
}

.flows-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flow-block {
    background-color: #2a2a2a;
    padding: 15px;
    border: 1px solid #ff3b3b;
    border-radius: 5px;
}

.flow-block h3 {
    margin: 0 0 10px 0;
    color: #ff3b3b;
}

.need_red {
    color: #ff3b3b;
}

.form_hr {
    background-color: #0d0d0d;
    height: 5px;
    border: none;
    margin: 0.5em 0 1em;
}








#selection-search {
    width: 200px;
    padding: 8px;
    background-color: #0d0d0d;
    border: 1px solid #ff3b3b;
    color: #f0f0f0;
    border-radius: 5px;
}

.selection-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 5px;
    margin-bottom: 10px;
}

.selection-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #2a2a2a;
}

.selection-item:last-child {
    border-bottom: none;
}

.selection-item input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}


/* Стили для контейнеров выбранных элементов */
.distribution-container {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #1a1a1a;
    border-radius: 5px;
    border: 1px solid #2a2a2a;
}

.distribution-container h3 {
    margin-top: 0;
    color: #ff3b3b;
    margin-bottom: 15px;
}

.selected-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.selected-items-table th,
.selected-items-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #2a2a2a;
}

.selected-items-table th {
    white-space: nowrap;
    background-color: #2a2a2a;
    color: #f0f0f0;
}

.selected-items-table input[type="number"] {
    width: 60px;
    padding: 5px;
    background-color: #0d0d0d;
    border: 1px solid #ff3b3b;
    color: #f0f0f0;
    border-radius: 3px;
}

.add-item-btn {
    background-color: #2a2a2a;
    color: #ff3b3b;
    border: 1px solid #ff3b3b;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.add-item-btn:hover:not(.disabled-button) {
    background-color: #ff3b3b;
    color: #0d0d0d;
}

.add-item-btn.disabled-button {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
    color: #666;
}

.valid-percentage {
    color: #4CAF50;
}

.invalid-percentage {
    color: #FF5252;
}

.error-message {
    color: #FF5252;
    font-size: 0.9em;
    margin-top: 5px;
}

/* Группа распределения */
.distribution-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.distribution-group-title {
    color: #ff3b3b;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}

/* Кнопка удаления (крестик) */
.remove-btn {
    background-color: #ff3b3b;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.remove-btn:hover {
    background-color: #ff0000;
}

/* Стили для элементов в таблице */
.item-line {
    border-bottom: 1px dashed #343434;
    padding: 3px 0;
    margin-bottom: 5px;
}

.item-line:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Стили для ID элемента */
.item-id {
    color: #999;
    font-size: 0.9em;
    margin-right: 5px;
    display: inline-block;
}

/* Стили для Geo элемента */
.item-geo {
    color: #ff3b3b;
    background-color: #2a2a2a;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 5px;
    font-size: 0.9em;
    display: inline-block;
}

/* Стили для имени элемента */
.item-name {
    display: inline-block;
}

/* Стили для процента элемента */
.item-perc {
    background-color: #2a2a2a;
    color: #4CAF50;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    font-size: 0.9em;
    display: inline-block;
}