/**
 * Aicoso Wishlist Admin Analytics Styles
 */

/* Analytics Page Specific Styles */
.aicoso-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.aicoso-date-filter {
    display: flex;
    align-items: center;
    gap: 15px;
}

.aicoso-date-filter label {
    font-weight: 600;
    color: #374151;
}

.aicoso-date-filter select {
    padding: 8px 35px 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

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

.aicoso-metric-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: transform 0.3s ease;
}

.aicoso-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.aicoso-metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aicoso-metric-icon .dashicons {
    color: white;
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.aicoso-metric-content {
    flex: 1;
}

.aicoso-metric-content h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aicoso-metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.aicoso-metric-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.aicoso-metric-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.aicoso-metric-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.aicoso-metric-change.neutral {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.aicoso-metric-change .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aicoso-metric-subtext {
    color: #6b7280;
    font-size: 13px;
}

.aicoso-charts-row {
    margin-bottom: 30px;
}

.aicoso-chart-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.aicoso-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.aicoso-chart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.aicoso-chart-period {
    color: #6b7280;
    font-size: 13px;
}

.aicoso-chart-content {
    position: relative;
    height: 300px;
}

.aicoso-table-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.aicoso-table-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aicoso-table-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.aicoso-table-period {
    color: #6b7280;
    font-size: 13px;
}

.aicoso-table-content {
    padding: 0;
}

.aicoso-data-table {
    width: 100%;
    border-collapse: collapse;
}

.aicoso-data-table thead th {
    background: #f8fafc;
    padding: 12px 20px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e7eb;
}

.aicoso-data-table tbody td {
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.aicoso-data-table tbody tr:hover {
    background: #fafbfc;
}

.aicoso-product-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.aicoso-product-cell img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.aicoso-product-info {
    display: flex;
    flex-direction: column;
}

.aicoso-product-info strong {
    color: #1e293b;
    margin-bottom: 5px;
}

.aicoso-product-price {
    color: #6b7280;
    font-size: 13px;
}

.aicoso-count-badge {
    display: inline-block;
    padding: 5px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.aicoso-empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
}

.aicoso-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    opacity: 0.3;
    margin-bottom: 20px;
}

.aicoso-export-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.aicoso-export-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Top Products Header & Badges */
.aicoso-table-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aicoso-badge-count {
    background: #e0e7ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.2px;
}

.aicoso-table-content {
    position: relative;
    min-height: 160px;
}

.aicoso-table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Table Pagination Footer */
.aicoso-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #fafbfc;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 16px;
}

.aicoso-footer-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.aicoso-pagination-summary {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.aicoso-per-page-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

.aicoso-per-page-select {
    padding: 4px 28px 4px 10px !important;
    font-size: 13px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #334155 !important;
    min-height: 30px !important;
    cursor: pointer;
    transition: border-color 0.2s;
}

.aicoso-per-page-select:focus {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 0 1px #8b5cf6 !important;
    outline: none;
}

/* Pagination Buttons */
.aicoso-pagination-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.aicoso-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.aicoso-page-btn:hover:not(.disabled):not(.active) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
}

.aicoso-page-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.35);
    cursor: default;
}

.aicoso-page-btn.disabled {
    opacity: 0.35;
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
}

.aicoso-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 32px;
    color: #94a3b8;
    font-weight: 700;
}

/* Loading Overlay */
.aicoso-table-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    border-radius: 0 0 12px 12px;
}

.aicoso-table-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.aicoso-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: aicoso-spin 0.8s linear infinite;
}

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

@media (max-width: 782px) {
    .aicoso-table-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .aicoso-pagination-controls {
        width: 100%;
        justify-content: center;
    }
}