/* Card Styles */

.card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

/* Stats Grid - Main KPIs */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Stat Cards - Enhanced Design */
.stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

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

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(129, 140, 248, 0.15));
    color: var(--primary);
}

.stat-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.15));
    color: var(--success);
}

.stat-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.15));
    color: var(--warning);
}

.stat-icon.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(248, 113, 113, 0.15));
    color: var(--danger);
}

.stat-icon.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(96, 165, 250, 0.15));
    color: #3B82F6;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-sublabel {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 4px;
}

.stat-card.highlight {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.03), rgba(129, 140, 248, 0.03));
}

.stat-card.highlight .stat-icon {
    background: var(--primary);
    color: white;
}

/* Secondary stats row */
.stats-secondary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stats-secondary .stat-card {
    padding: 16px;
}

.stats-secondary .stat-value {
    font-size: 22px;
}

/* Performer Cards */
.performer-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.performer-card {
    padding: 24px;
    border-radius: 16px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.performer-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.performer-card.best {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.performer-card.worst {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.performer-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.performer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    border: 2px solid rgba(255,255,255,0.3);
}

.performer-info {
    flex: 1;
}

.performer-name {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 4px;
}

.performer-title {
    font-size: 13px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 6px;
}

.performer-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.performer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.performer-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.performer-stat-value {
    font-size: 20px;
    font-weight: 700;
}

.performer-stat-label {
    font-size: 10px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick Stats Mini Cards */
.quick-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.quick-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
}

.quick-stat-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-stat-value {
    font-weight: 600;
    color: var(--gray-900);
}

.quick-stat-label {
    color: var(--gray-500);
}

/* Enhanced hover effects */
.card, .stat-card, .performer-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.performer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.25);
}

/* Metric Comparison Cards */
.metric-comparison {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
}

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

.metric-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

.metric-value-large {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.metric-bar {
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.metric-bar-fill.success {
    background: linear-gradient(90deg, var(--success), #34D399);
}

.metric-bar-fill.warning {
    background: linear-gradient(90deg, var(--warning), #FBBF24);
}

.metric-bar-fill.primary {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* Date Range Indicator */
.date-range-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(129, 140, 248, 0.08));
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--gray-700);
}

.date-range-indicator.visible {
    display: flex;
}

.date-range-indicator svg {
    color: var(--primary);
    flex-shrink: 0;
}

.date-range-indicator span {
    font-weight: 500;
}

/* Mobile Card Improvements */
@media (max-width: 768px) {
    .card {
        padding: 16px;
        border-radius: 10px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card-inner {
        gap: 12px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-label {
        font-size: 11px;
    }

    .performer-card {
        padding: 20px;
    }

    .performer-header {
        gap: 12px;
    }

    .performer-avatar {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }

    .performer-name {
        font-size: 16px;
    }

    .performer-stats {
        gap: 8px;
    }

    .performer-stat-value {
        font-size: 16px;
    }

    .performer-stat-label {
        font-size: 9px;
    }

    .date-range-indicator {
        flex-wrap: wrap;
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 14px;
        margin-bottom: 12px;
    }

    .stat-card-inner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .stat-value {
        font-size: 20px;
    }

    .performer-header {
        flex-direction: column;
        text-align: center;
    }

    .performer-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .performer-stat {
        padding: 8px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    .quick-stats {
        flex-direction: column;
    }

    .quick-stat {
        width: 100%;
        justify-content: center;
    }

    .metric-comparison {
        grid-template-columns: 1fr;
    }
}
