/* ====================================
   BALANCE CARD STYLES - Modern & Elegant
   ==================================== */

.balance-info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 4px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
    animation: fadeIn 0.5s ease-in-out;
    transition: all 0.3s ease;
}

.balance-info-card:hover {
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.balance-info-inner {
    background: white;
    border-radius: 14px;
    padding: 20px;
}

.balance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.balance-item {
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.balance-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.balance-item:hover::before {
    left: 100%;
}

.balance-item.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.balance-item.current .balance-label,
.balance-item.current .balance-amount {
    color: white !important;
}

.balance-item.price {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.balance-item.price .balance-label,
.balance-item.price .balance-amount {
    color: white !important;
}

.balance-item.result-positive {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.balance-item.result-positive .balance-label,
.balance-item.result-positive .balance-amount {
    color: white !important;
}

.balance-item.result-negative {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.balance-item.result-negative .balance-label,
.balance-item.result-negative .balance-amount {
    color: white !important;
}

.balance-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: inline-block;
    animation: bounce 2s infinite;
}

.balance-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-amount {
    /* font-size: 18px; */
    font-weight: 700;
    color: #1f2937;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Progress Bar */
.balance-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.balance-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.balance-progress-bar.low {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.balance-progress-bar.insufficient {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.balance-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* Insufficient Balance Alert */
.insufficient-alert {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: fadeInSoft 0.4s ease-in-out;
}

.insufficient-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.insufficient-icon {
    font-size: 24px;
    animation: pulse 1.5s infinite;
}

.insufficient-text {
    flex: 1;
}

.insufficient-title {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
}

.insufficient-amount {
    font-size: 16px;
    font-weight: 700;
    color: #b45309;
}

.btn-deposit {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.btn-deposit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

.btn-deposit:active {
    transform: translateY(0);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes countUp {
    from {
        opacity: 0.7;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInSoft {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .balance-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .balance-amount {
        /* font-size: 16px; */
    }
    
    .insufficient-alert {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-deposit {
        width: 100%;
        justify-content: center;
    }
}

/* Success State */
.balance-success-message {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    animation: fadeInSoft 0.4s ease-in-out;
}

.balance-success-message .icon {
    font-size: 20px;
    color: #065f46;
}

.balance-success-message .text {
    font-size: 14px;
    font-weight: 600;
    color: #047857;
}

/* Loading State */
.balance-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.balance-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Tooltip */
.balance-tooltip {
    position: relative;
    cursor: help;
}

.balance-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #1f2937;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.balance-tooltip:hover::after {
    opacity: 1;
}

/* ===========================================
   DARK MODE SUPPORT
   =========================================== */

body.dark-mode .balance-info-inner {
    background: #2d3748;
}

body.dark-mode .balance-item {
    background: linear-gradient(135deg, #374151 0%, #4a5568 100%);
}

body.dark-mode .balance-item:not(.current):not(.price):not(.result-positive):not(.result-negative) .balance-label,
body.dark-mode .balance-item:not(.current):not(.price):not(.result-positive):not(.result-negative) .balance-amount {
    color: #e2e8f0 !important;
}

/* Current, price, result items keep their original gradients and white text */

body.dark-mode .balance-tooltip::after {
    background: #4a5568;
    color: #e2e8f0;
}
