/* css/pages/Функции_index/treasury.css */

/* Основной контейнер казны */
.treasury-section {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background: rgba(22, 27, 34, 0.9);
    border: 1px solid rgba(19, 135, 58, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.treasury-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #13873a, #10b981, #3b82f6);
    z-index: 1;
}

/* Заголовок */
.treasury-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(19, 135, 58, 0.3);
    position: relative;
}

.treasury-header h2 {
    color: #13873a;
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.treasury-header h2 i {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

.treasury-header p {
    color: #adb5bd;
    margin: 0;
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Контент - диаграмма и статистика */
.treasury-content {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(28, 33, 41, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Круговая диаграмма */
.pie-chart-container {
    position: relative;
    flex-shrink: 0;
}

.pie-chart-svg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* Убраны все эффекты наведения для диаграммы */
.pie-budget,
.pie-expenses,
.pie-balance {
    transition: none;
    cursor: default; /* Меняем курсор на стандартный */
}

/* Убраны эффекты наведения */
.pie-budget:hover,
.pie-expenses:hover,
.pie-balance:hover {
    stroke-width: 1; /* Оставляем стандартную толщину */
    filter: none; /* Убираем подсветку */
}

/* Центр диаграммы */
.pie-chart-svg::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #161b22;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Статистика */
.treasury-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.stat-item.budget {
    border-left: 3px solid #10b981;
}

.stat-item.expenses {
    border-left: 3px solid #ef4444;
}

.stat-item.balance {
    border-left: 3px solid #3b82f6;
}

.stat-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 1.2rem;
}

.stat-item.budget .stat-icon i {
    color: #10b981;
}

.stat-item.expenses .stat-icon i {
    color: #ef4444;
}

.stat-item.balance .stat-icon i {
    color: #3b82f6;
}

.stat-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-title {
    color: #d1d5db;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-percent {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    width: fit-content;
}

.stat-item.budget .stat-percent {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.stat-item.expenses .stat-percent {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.stat-item.balance .stat-percent {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.stat-value {
    text-align: right;
}

.stat-value span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-item.budget .stat-value span {
    color: #10b981;
}

.stat-item.expenses .stat-value span {
    color: #ef4444;
}

.stat-item.balance .stat-value span {
    color: #3b82f6;
}

/* Информация и валюта */
.treasury-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(28, 33, 41, 0.7);
    border-radius: 8px;
    margin-bottom: 0; /* Убрали отступ снизу, так как кнопки нет */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #adb5bd;
    font-size: 0.9rem;
}

.info-item i {
    color: #13873a;
    font-size: 1rem;
}

.info-item strong {
    color: #fff;
    font-weight: 600;
}

/* УДАЛЕНО: Кнопка обновления */

/* Сообщение об ошибке */
.treasury-error {
    text-align: center;
    padding: 40px 20px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.treasury-error i {
    color: #ef4444;
    margin-bottom: 15px;
}

.treasury-error h3 {
    color: #fff;
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.treasury-error p {
    color: #adb5bd;
    margin: 0 0 20px 0;
    font-size: 0.9rem;
}

.treasury-error .btn {
    background: #13873a;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.treasury-error .btn:hover {
    background: #16a34a;
}

/* Подсказка для секторов диаграммы */
.pie-tooltip {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Анимация загрузки */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spinner.fa-spin {
    animation: spin 1s linear infinite;
}

/* Адаптивность */
@media (max-width: 768px) {
    .treasury-section {
        margin: 20px 15px;
        padding: 15px;
    }
    
    .treasury-content {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }
    
    .treasury-header h2 {
        font-size: 1.5rem;
    }
    
    .pie-chart-svg {
        width: 150px;
        height: 150px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-value span {
        font-size: 1.3rem;
    }
    
    .treasury-info {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .treasury-section {
        margin: 15px 10px;
        padding: 12px;
    }
    
    .treasury-header h2 {
        font-size: 1.3rem;
    }
    
    .treasury-content {
        padding: 12px;
    }
    
    .pie-chart-svg {
        width: 120px;
        height: 120px;
    }
    
    .stat-info {
        gap: 8px;
    }
    
    .stat-icon {
        width: 35px;
        height: 35px;
    }
    
    .stat-title {
        font-size: 0.85rem;
    }
    
    .stat-percent {
        font-size: 0.8rem;
    }
    
    .stat-value span {
        font-size: 1.2rem;
    }
    
}