/**
 * Aysa Credit Usage Analytics Styles
 */

/* Credit Stat Display - chenar frumos cu colțuri rotunjite */
.aysa-credit-stat {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border: 2px solid #4a90e2;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.aysa-credit-stat:hover {
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.2);
    transform: translateY(-2px);
}

.aysa-credit-stat h3 {
    color: #2c5aa0;
    font-weight: 700;
    font-size: 24px;
    margin: 0 0 5px 0;
}

.aysa-credit-stat p {
    color: #333;
    font-weight: 500;
    margin: 0;
    font-size: 13px;
}

/* Credit Summary Grid */
.aysa-credit-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.aysa-credit-summary-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.aysa-credit-summary-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.aysa-credit-summary-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
}

.aysa-credit-summary-content h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aysa-credit-summary-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

/* Credit Breakdown Section */
.aysa-credit-breakdown-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.aysa-credit-breakdown-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.aysa-credit-breakdown-container {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.aysa-credit-breakdown-chart {
    flex: 0 0 300px;
}

.aysa-credit-breakdown-legend {
    flex: 1;
    min-width: 200px;
}

.aysa-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.aysa-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.aysa-legend-label {
    font-weight: 500;
    color: #333;
}

.aysa-legend-value {
    margin-left: auto;
    font-weight: bold;
    color: #666;
}

/* Transaction History Section */
.aysa-transaction-history-section {
    margin-bottom: 30px;
}

.aysa-transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.aysa-transaction-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.aysa-transaction-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.aysa-transaction-filters .aysa-select,
.aysa-transaction-filters .aysa-input {
    min-width: 120px;
}

.aysa-transaction-table-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.aysa-transaction-table {
    width: 100%;
    border-collapse: collapse;
}

.aysa-transaction-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.aysa-transaction-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
    font-size: 14px;
}

.aysa-transaction-table tbody tr:hover {
    background: #f8f9fa;
}

.aysa-transaction-table tbody tr:last-child td {
    border-bottom: none;
}

.aysa-loading-cell {
    text-align: center;
    padding: 40px 15px !important;
    color: #999;
}

/* Transaction Type Badges */
.aysa-transaction-type {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aysa-transaction-type.earned {
    background: #e8f5e8;
    color: #2e7d32;
}

.aysa-transaction-type.spent {
    background: #ffebee;
    color: #c62828;
}

.aysa-transaction-type.expired {
    background: #fff3e0;
    color: #ef6c00;
}

/* Transaction Amount */
.aysa-transaction-amount {
    font-weight: 600;
}

.aysa-transaction-amount.positive {
    color: #2e7d32;
}

.aysa-transaction-amount.negative {
    color: #c62828;
}

/* Pagination */
.aysa-transaction-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

#pagination-info {
    color: #666;
    font-size: 14px;
}

/* Credit Analytics Controls */
.aysa-credit-analytics-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
}

.aysa-last-updated {
    color: #666;
    font-size: 14px;
}

#last-updated-time {
    font-weight: 500;
}

/* Loading Spinner */
.aysa-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: aysa-spin 1s linear infinite;
}

@keyframes aysa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .aysa-credit-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .aysa-credit-breakdown-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .aysa-credit-breakdown-chart {
        flex: none;
        align-self: center;
    }
    
    .aysa-transaction-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .aysa-transaction-filters {
        justify-content: stretch;
    }
    
    .aysa-transaction-filters .aysa-select,
    .aysa-transaction-filters .aysa-input {
        flex: 1;
        min-width: auto;
    }
    
    .aysa-transaction-table-container {
        overflow-x: auto;
    }
    
    .aysa-transaction-table {
        min-width: 600px;
    }
    
    .aysa-credit-analytics-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
}

/* Empty State */
.aysa-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.aysa-empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.aysa-empty-state h5 {
    margin: 0 0 10px 0;
    color: #666;
}

.aysa-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Error State */
.aysa-error-state {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #c62828;
}

.aysa-error-state-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.aysa-error-state h5 {
    margin: 0 0 10px 0;
    color: #c62828;
}

.aysa-error-state p {
    margin: 0;
    font-size: 14px;
}

/* Success State */
.aysa-success-message {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 15px;
    color: #2e7d32;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aysa-success-message-icon {
    font-size: 20px;
}