/* Exercise Stats Dashboard Styles */

/* Hero Cards Grid */
.stats-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Stat Card Base */
.stat-card {
    background: linear-gradient(135deg, var(--card-gradient-start), var(--card-gradient-end));
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.stat-card:hover::before {
    opacity: 1;
}

/* Stat Card Content */
.stat-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.stat-icon {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-details {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-trend.trend-up {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.stat-trend.trend-down {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.trend-icon {
    font-size: 1rem;
}

/* Color Variants */
.stat-card-primary {
    --card-gradient-start: #667eea;
    --card-gradient-end: #764ba2;
}

.stat-card-success {
    --card-gradient-start: #56ab2f;
    --card-gradient-end: #a8e063;
}

.stat-card-warning {
    --card-gradient-start: #f093fb;
    --card-gradient-end: #f5576c;
}

.stat-card-info {
    --card-gradient-start: #4facfe;
    --card-gradient-end: #00f2fe;
}

.stat-card-danger {
    --card-gradient-start: #fa709a;
    --card-gradient-end: #fee140;
}

.stat-card-purple {
    --card-gradient-start: #667eea;
    --card-gradient-end: #764ba2;
}

.stat-card-blue {
    --card-gradient-start: #2196F3;
    --card-gradient-end: #21CBF3;
}

.stat-card-green {
    --card-gradient-start: #11998e;
    --card-gradient-end: #38ef7d;
}

.stat-card-orange {
    --card-gradient-start: #ee0979;
    --card-gradient-end: #ff6a00;
}

/* Chart Container */
.chart-container {
    background: var(--bg-dark-secondary, #2d2d2d);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #f3f4f6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-subtitle {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-full-width {
    grid-column: 1 / -1;
}

/* Accordion Styles */
.stats-accordion {
    margin-top: 2rem;
}

.accordion-item {
    background: #2d2d2d;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    background: linear-gradient(135deg, #353535, #2d2d2d);
    transition: background 0.2s ease;
    user-select: none;
}

.accordion-header:hover {
    background: linear-gradient(135deg, #3a3a3a, #353535);
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #e2e8f0;
}

.accordion-icon {
    font-size: 1.5rem;
}

.accordion-toggle {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    color: #94a3b8;
}

.accordion-toggle.open {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.accordion-content.open {
    max-height: 5000px;
    padding: 1.5rem;
}

/* Loading State */
.stats-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.stats-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: #6b7280;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-message {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-hero-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-icon {
        font-size: 2.5rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chart-container {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .stat-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .chart-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .accordion-content {
        max-height: none !important;
        padding: 1rem !important;
    }
}
