/* Frontend styles for User Balance Manager */

.ubm-balance-display {
    background: #F5F7FA;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    max-width: 300px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Dashboard styles */
.ubm-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ubm-dashboard-title {
    margin-bottom: 30px;
    color: #1e293b;
    text-align: center;
}

.ubm-balance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.ubm-balance-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ubm-balance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.ubm-balance-card.primary {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
}

.ubm-balance-card.deposits {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.ubm-balance-card.profits {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.ubm-balance-card.investments {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}

.ubm-balance-card.withdrawals {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}

.ubm-balance-label {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.ubm-balance-amount {
    font-size: 28px;
    font-weight: bold;
    color: #1e293b;
    margin: 0;
    line-height: 1.2;
}

/* History section styles */
.ubm-dashboard-history {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-top: 32px;
}

.ubm-dashboard-history h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1e293b;
    font-size: 18px;
}

.ubm-history-list {
    space-y: 12px;
}

.ubm-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.ubm-history-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ubm-history-date {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.ubm-history-type {
    font-size: 14px;
    color: #475569;
    font-weight: 600;
}

.ubm-history-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.ubm-change {
    font-weight: bold;
    font-size: 16px;
}

.ubm-change.positive {
    color: #059669;
}

.ubm-change.negative {
    color: #dc2626;
}

.ubm-reason {
    font-size: 12px;
    color: #64748b;
    max-width: 200px;
    text-align: right;
}

.ubm-no-history {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 20px;
}

/* Table styles */
.ubm-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ubm-table th,
.ubm-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.ubm-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ubm-table tbody tr:hover {
    background: #f8fafc;
}

.ubm-balance-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
    max-width: 400px;
    margin: 20px auto;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .ubm-balance-display {
        margin: 10px;
        padding: 15px;
        max-width: none;
    }
    
    .ubm-balance-amount {
        font-size: 24px;
    }
}

/* Integration with popular themes */
.ubm-balance-display.compact {
    padding: 12px 16px;
    margin: 10px 0;
    display: inline-block;
    max-width: none;
}

.ubm-balance-display.compact .ubm-balance-label {
    font-size: 12px;
    margin-bottom: 4px;
}

.ubm-balance-display.compact .ubm-balance-amount {
    font-size: 18px;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .ubm-balance-display {
        background: #1e293b;
        border-color: #334155;
    }
    
    .ubm-balance-label {
        color: #94a3b8;
    }
    
    .ubm-balance-amount {
        color: #f1f5f9;
    }
    
    .ubm-balance-error {
        background: #450a0a;
        border-color: #7f1d1d;
        color: #fca5a5;
    }
}

/* Widget Area Styling */
.widget .ubm-balance-display {
    margin: 0;
    max-width: none;
}

/* Sidebar Integration */
.sidebar .ubm-balance-display {
    margin: 0 0 20px 0;
}

/* Dashboard Widget Specific Styles */
#ubm_user_balance_widget .ubm-dashboard-widget {
    text-align: center;
    padding: 10px 0;
}

#ubm_user_balance_widget .ubm-balance-large {
    font-size: 24px;
    font-weight: bold;
    color: #2c5282;
    margin: 0 0 8px 0;
}

#ubm_user_balance_widget .ubm-balance-description {
    color: #666;
    margin: 0;
    font-size: 13px;
}

/* Dashboard Shortcode Styles */
.ubm-dashboard {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ubm-dashboard-title {
    color: #2d3748;
    font-size: 24px;
    margin: 0 0 20px 0;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.ubm-balance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.ubm-balance-card {
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

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

.ubm-balance-card.deposits {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ubm-balance-card.profits {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.ubm-balance-card.investments {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.ubm-balance-card.withdrawals {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #2d3748;
}

.ubm-balance-card .ubm-balance-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: white;
}

.ubm-balance-card .ubm-balance-amount {
    font-size: 36px;
    font-weight: bold;
    margin: 0;
    color: white;
}

.ubm-dashboard-history h4 {
    color: #2d3748;
    font-size: 18px;
    margin: 0 0 15px 0;
}

.ubm-history-list {
    space-y: 10px;
}

.ubm-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f7fafc;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #e2e8f0;
}

.ubm-history-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ubm-history-type {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ubm-history-date {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.ubm-history-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ubm-change {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
}

.ubm-change.positive {
    background: #c6f6d5;
    color: #22543d;
}

.ubm-change.negative {
    background: #fed7d7;
    color: #742a2a;
}

.ubm-reason {
    font-size: 14px;
    color: #4a5568;
    font-style: italic;
}

.ubm-no-history {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 20px;
}

/* History Table Styles */
.ubm-history-table {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.ubm-history-table h3 {
    color: #2d3748;
    margin: 0 0 20px 0;
    font-size: 20px;
}

.ubm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.ubm-table th,
.ubm-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.ubm-table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ubm-table tbody tr:hover {
    background: #f7fafc;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .ubm-dashboard {
        padding: 20px;
        margin: 10px;
    }
    
    .ubm-balance-card {
        padding: 20px;
    }
    
    .ubm-balance-card .ubm-balance-amount {
        font-size: 28px;
    }
    
    .ubm-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .ubm-history-details {
        width: 100%;
        justify-content: space-between;
    }
    
    .ubm-table {
        font-size: 14px;
    }
    
    .ubm-table th,
    .ubm-table td {
        padding: 8px;
    }
}
