/*
 * Analytics Dashboard Styles - RiPro Style
 */

/* ===== Dashboard Container ===== */
.analytics-dashboard {
    max-width: 1600px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.dashboard-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-title i {
    color: var(--theme-color);
    font-size: 32px;
}

.btn-refresh-stats {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--hover-color) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-refresh-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--theme-color-rgb), 0.4);
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 28px;
    color: #fff;
}

.stat-revenue .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-orders .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-users .stat-icon {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-conversion .stat-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #999;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 13px;
    color: #666;
}

.stat-change.positive {
    color: #52c41a;
}

.stat-change.negative {
    color: #ff4d4f;
}

/* ===== Charts Grid ===== */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title i {
    color: var(--theme-color);
}

.chart-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: #666;
}

.filter-btn:hover {
    background: #e8e8e8;
}

.filter-btn.active {
    background: var(--theme-color);
    color: #fff;
}

.chart-body {
    height: 350px;
}

/* ===== Rankings Grid ===== */
.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.ranking-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.ranking-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--hover-color) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ranking-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ranking-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.ranking-body {
    padding: 20px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead th {
    padding: 12px;
    text-align: left;
    font-size: 13px;
    color: #999;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
}

.ranking-table tbody tr {
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.3s ease;
}

.ranking-table tbody tr:hover {
    background: #fafafa;
}

.ranking-table td {
    padding: 15px 12px;
    vertical-align: middle;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
    color: #fff;
}

.rank-badge:not(.rank-1):not(.rank-2):not(.rank-3) {
    background: #f0f0f0;
    color: #666;
}

.product-link {
    display: block;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.product-link:hover {
    color: var(--theme-color);
}

.product-type {
    display: inline-block;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
}

.revenue-text {
    color: var(--theme-color);
    font-weight: 600;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-data i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

.no-data p {
    margin: 0;
    font-size: 16px;
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .rankings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-title {
        font-size: 22px;
    }
    
    .chart-body {
        height: 250px;
    }
    
    .ranking-table {
        font-size: 13px;
    }
    
    .ranking-table thead th,
    .ranking-table tbody td {
        padding: 10px 8px;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .dashboard-header,
    .stat-card,
    .chart-card,
    .ranking-card {
        background: #1a1a1a;
    }
    
    .dashboard-title,
    .chart-title,
    .ranking-title,
    .stat-value,
    .product-link {
        color: #e0e0e0;
    }
    
    .stat-label,
    .stat-change {
        color: #999;
    }
    
    .filter-btn {
        background: #2a2a2a;
        color: #ccc;
    }
    
    .filter-btn:hover {
        background: #333;
    }
    
    .ranking-table tbody tr {
        border-bottom-color: #333;
    }
    
    .ranking-table tbody tr:hover {
        background: #2a2a2a;
    }
    
    .ranking-table thead th {
        color: #999;
        border-bottom-color: #333;
    }
    
    .product-type {
        background: #2a2a2a;
    }
    
    .rank-badge:not(.rank-1):not(.rank-2):not(.rank-3) {
        background: #333;
        color: #ccc;
    }
}
