/* DS Backgamom Credits - Frontend Styles */

/* Balance Shortcode Styles */
.ds-credit-badge {
    background: #28a745;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
}

.ds-credit-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 200px;
    margin: 10px 0;
}

.ds-credit-card .amount {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.ds-credit-card .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Dashboard Styles */
.ds-credit-dashboard {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.ds-balance-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.balance-label {
    opacity: 0.9;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.balance-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: #28a745;
    color: white;
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.ds-stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.ds-history-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ds-history-section h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.history-item:last-child {
    border-bottom: none;
}

.history-info {
    flex: 1;
}

.history-type {
    font-weight: 600;
    color: #333;
}

.history-date {
    font-size: 0.85rem;
    color: #666;
}

.history-amount {
    font-weight: 700;
}

.history-amount.positive {
    color: #28a745;
}

.history-amount.negative {
    color: #dc3545;
}

.btn-link {
    background: none;
    color: #007cba;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px 16px;
}

.ds-credit-login-required {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

/* History Detailed Styles */
.ds-credit-history {
    max-width: 800px;
    margin: 20px auto;
}

.history-filters {
    margin-bottom: 20px;
}

.filter-type {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.history-detailed-item {
    background: white;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-type-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-deposit {
    background: #d4edda;
    color: #155724;
}

.badge-withdrawal {
    background: #f8d7da;
    color: #721c24;
}

.badge-manual-addition {
    background: #d1ecf1;
    color: #0c5460;
}

.history-observation {
    color: #666;
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Stats Styles */
.ds-credit-stats {
    max-width: 600px;
    margin: 20px auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

/* Widget Styles */
.ds-credit-widget {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 16px;
    max-width: 280px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ds-widget-minimal {
    padding: 12px;
    border: none;
    background: #f8f9fa;
}

.ds-widget-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.widget-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.widget-balance {
    font-size: 1.4rem;
    font-weight: 700;
    color: #28a745;
}

.ds-widget-card .widget-balance {
    color: white;
}

.widget-last-transaction {
    margin-bottom: 12px;
    color: #666;
}

.ds-widget-card .widget-last-transaction {
    color: rgba(255,255,255,0.8);
}

.widget-actions {
    display: flex;
    gap: 8px;
}

.widget-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.widget-btn-primary {
    background: #28a745;
    color: white;
}

.widget-btn-secondary {
    background: #6c757d;
    color: white;
}

.ds-widget-card .widget-btn-primary {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.widget-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ds-credit-widget-login {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .balance-amount {
        font-size: 2.5rem;
    }
    
    .balance-actions {
        flex-direction: column;
    }
    
    .ds-stats-section {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .history-amount {
        align-self: flex-end;
    }
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

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

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}