/* ========================================
   ACCOUNTS.CSS - СЧЕТА И БАЛАНС
   ========================================
   
   Содержит:
   - Блок баланса
   - Детали счетов
   - Кнопка добавления счета
   - Цветовые индикаторы счетов
   - Редактирование названий счетов
   - Скрытие/показ счетов
   - Выбор дефолтного счета
*/

/* Блок баланса */
.balance-block {
    background: #353942;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    padding: 20px 30px 15px 15px;
    text-align: center;
    position: relative;
    user-select: none;
}

/* Основной баланс */
.balance-main {
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 10px;
    display: inline-block;
}

/* Детали по счетам */
.balance-details {
    margin-top: 10px;
    text-align: left;
    border-top: 1px solid #444;
    padding-top: 10px;
    display: none;
}

.balance-details.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* Строка счета в балансе */
.balance-account-row {
    margin: 5px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 6px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.balance-account-row:last-child {
    border-bottom: none;
}

/* Скрытый счет */
.balance-account-row.hidden-account {
    opacity: 0.5;
}

.balance-account-row.hidden-account .balance-account-name {
    text-decoration: line-through;
    color: #666;
}

.balance-account-row.hidden-account .balance-account-sum {
    color: #666 !important;
}

/* Правая часть строки счета */
.balance-account-right {
    display: flex;
    align-items: center;
    gap: 25px;
    font-size: 14px;
}

/* Названия счетов в балансе */
.balance-account-name {
    color: #a6b1c2;
    user-select: none;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 14px;
}

.balance-account-name:hover {
    color: #44bd32;
}

/* Подпись дефолтного счета */
.default-account-label {
    color: #666 !important;
    font-size: 0.8em;
    font-weight: 500;
    padding: 0 0 0 10px;
}

/* Кнопка глаза для скрытия/показа счета */
.account-eye-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75em;
    width: 6px;
    height: 6px;
    padding: 0;
    border-radius: 2px;
    transition: background-color 0.2s ease;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.account-eye-btn:hover {
    background-color: rgba(68, 189, 50, 0.2);
    opacity: 1;
}

/* Суммы счетов */
.balance-account-sum.positive {
    color: #44bd32;
    font-weight: 600;
    user-select: none;
}

.balance-account-sum.negative {
    color: #e84118;
    font-weight: 600;
    user-select: none;
}

/* Редактируемое название счета */
.balance-account-name.editing {
    width: auto;
    min-width: 50px;
    color: #44bd32;
    font-weight: 700;
    background: transparent;
    border: none;
    outline: none;
    border-bottom: 1px solid #44bd32;
    padding: 0 4px;
}

/* Кнопка добавления счета */
.add-account-btn {
    position: absolute;
    right: 16px;
    top: 20px;
    background: #23272f;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.3em;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 28px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-account-btn svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.add-account-btn:hover {
    background: #44bd32;
}

/* Цветовые индикаторы счетов */
.account-color-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Цветовые индикаторы в разных местах */
.balance-account-name .account-color-indicator {
    width: 10px;
    height: 10px;
    margin-right: 6px;
}

.modal-account-btn .account-color-indicator,
.transfer-modal__account-btn .account-color-indicator {
    width: 8px;
    height: 8px;
    margin-right: 8px;
}

.operation-category-small .account-color-indicator {
    width: 8px;
    height: 8px;
    margin-right: 5px;
}

/* Выбор цвета для нового счета */
.color-selection {
    margin: 16px 0;
}

.color-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #a6b1c2;
}

.color-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #444a56;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color-button:hover {
    transform: scale(1.1);
    border-color: #f5f6fa;
}

.color-button.selected {
    border-color: #6e726e;
    transform: scale(1.1);
}

.color-button.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
}

.settings-btn {
    background: linear-gradient(90deg, #353942 60%, #23272f 100%);
    color: #a6b1c2;
    border: 1px solid #444a56;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 1em;
    font-weight: 500;
    margin: 8px 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    outline: none;
    display: inline-block;
}
.settings-btn:hover, .settings-btn:focus {
    background: linear-gradient(90deg, #44bd32 60%, #23272f 100%);
    color: #fff;
    border-color: #44bd32;
    box-shadow: 0 4px 16px rgba(68,189,50,0.10);
} 

@media (max-width: 500px) {
    .balance-details {
    margin-top: 10px;
    text-align: left;
    border-top: 1px solid #444;
    padding-top: 10px;
    }
    
    /* Увеличиваем размер текста на 2px для мобильных */
    .balance-account-name {
        font-size: 14px; /* было 12px */
    }
    
    .balance-account-sum {
        font-size: 14px; /* увеличиваем на 2px */
    }
    
    .balance-account-right {
        font-size: 14px; /* было 12px */
    }
}