/*
 * Path: /public/css/app-billing.css
 * File: app-billing.css (v2.0 - Balance, Tariffs & Transactions)
 */

/* Баланс в шапке страницы */
.balance-display__value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--success-color);
}

/* Сетка тарифов */
.tariff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.tariff-card {
    background: var(--background-color, #ffffff);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.tariff-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tariff-card.current-plan {
    border-color: var(--primary-color);
    background: var(--primary-color-light);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
}

.tariff-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color-light);
}

.tariff-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tariff-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color-primary);
    margin-bottom: 0.25rem;
}

.tariff-price--free {
    color: var(--text-color-secondary);
}

.tariff-price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color-secondary);
}

.tariff-price-monthly {
    font-size: 1.1rem;
    color: var(--text-color-secondary);
}

.tariff-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    text-align: left;
    flex-grow: 1;
}

.tariff-features li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.icon-success {
    color: var(--success-color);
    margin-right: 0.5rem;
    font-size: 1.1em;
}

.icon-disabled {
    color: var(--danger-color);
    margin-right: 0.5rem;
    font-size: 1.1em;
    opacity: 0.5;
}

.tariff-footer {
    padding-top: 1.5rem;
}

/* Блок выбора длительности тарифа */
.plan-select-container {
    margin-bottom: 1rem;
    text-align: left;
    padding: 1rem;
    background: var(--background-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color-light);
}

.plan-select-container label {
    font-weight: 600;
    margin-right: 1rem;
}

.plan-select-container select {
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.plan-select-container .price-display {
    display: block;
    margin-top: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.plan-price-label {
    font-weight: 600;
    color: var(--text-color-secondary);
}

/* Текущий тариф */
.current-tariff-status {
    background: var(--info-color-light);
    border: 1px solid var(--info-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.current-tariff-status strong {
    font-weight: 700;
}

/* Пополнение баланса */
.balance-topup-row {
    gap: 1rem;
}

.balance-topup-label {
    min-width: 150px;
}

.balance-topup-input-group {
    flex: 1;
}

/* Таблица истории транзакций */
.table-striped {
    width: 100%;
    border-collapse: collapse;
}

.table-striped th {
    white-space: nowrap;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color-light);
}

.table-striped td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color-light);
    vertical-align: middle;
    font-size: 0.95rem;
}

.table-striped tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-child(odd) {
    background-color: var(--background-light);
}

/* Ширина столбцов */
.table-striped th:nth-child(1),
.table-striped td:nth-child(1) {
    width: 5%;
    min-width: 50px;
    font-weight: 700;
}

.table-striped th:nth-child(2),
.table-striped td:nth-child(2) {
    width: 20%;
    min-width: 130px;
}

.table-striped th:nth-child(5),
.table-striped td:nth-child(5) {
    width: 15%;
    min-width: 100px;
}

/* Бейджи статуса */
.badge {
    padding: 0.3em 0.6em;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.badge-success {
    background-color: var(--success-color);
    color: #fff;
}

.badge-warning {
    background-color: var(--warning-color);
    color: var(--text-color-primary);
}

.badge-danger {
    background-color: var(--danger-color);
    color: #fff;
}

/* Цвет зачисления (+ / -) */
.balance-credited {
    font-weight: 600;
}

.balance-credited--plus {
    color: var(--success-color);
}

.balance-credited--minus {
    color: var(--danger-color);
}

/* Адаптивность */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

@media (max-width: 992px) {
    .tariff-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .balance-topup-row {
        flex-direction: column;
        align-items: stretch;
    }

    .balance-topup-label {
        min-width: 0;
    }
}

