/* Statistics Styles */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    padding: 24px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-600);
    text-transform: uppercase;
    font-weight: 500;
}

.workout-history {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    padding: 24px;
}

.workout-history h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 24px;
    text-align: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--gray-100);
    border-radius: 8px;
    /* border-bottom: 2px solid #2196f3; */
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-date {
    min-width: 100px;
}

.header-exercise {
    flex: 1;
}

.header-performance {
    min-width: 80px;
    text-align: center;
}

.header-duration {
    min-width: 80px;
    text-align: center;
}

.header-calories {
    min-width: 80px;
    text-align: center;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--gray-100);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.history-item:hover {
    background: var(--primary-light);
    transform: translateX(4px);
}

.history-date {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
    min-width: 100px;
}

.history-exercise {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
}

.history-reps {
    font-size: 14px;
    color: var(--gray-600);
    min-width: 80px;
    text-align: center;
}

.history-duration {
    font-size: 14px;
    color: var(--gray-600);
    min-width: 80px;
    text-align: center;
}

.history-calories {
    font-size: 14px;
    color: #ff9800;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

/* Empty State */
.stats-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-600);
}

.stats-empty i {
    font-size: 64px;
    color: var(--gray-400);
    margin-bottom: 16px;
}

.stats-empty h3 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
}

.stats-empty p {
    font-size: 16px;
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-summary {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 16px;
    }

    .stat-card {
        padding: 20px;
    }

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

    /* Hide table header on mobile since we're switching to card layout */
    .history-header {
        display: none;
    }

    /* Add labels for mobile context without changing container */
    .history-date::before { content: "Date: "; font-weight: 500; color: var(--text-color); }
    .history-reps::before { content: "Performance: "; font-weight: 500; color: var(--text-color); }
    .history-duration::before { content: "Duration: "; font-weight: 500; color: var(--text-color); }
    .history-calories::before { content: "Calories: "; font-weight: 500; color: var(--text-color); }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .history-date,
    .history-reps,
    .history-duration,
    .history-calories {
        min-width: auto;
    }
}

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

    .stat-card {
        padding: 16px;
    }

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

    .workout-history {
        padding: 16px;
    }

    /* Hide table header completely on mobile */
    .history-header {
        display: none;
    }

    .history-item {
        padding: 12px;
    }

    .history-exercise {
        font-size: 14px;
    }
}

/* Loading, error, and empty states */
.no-data {
    text-align: center;
    color: var(--gray-600);
    font-style: italic;
    padding: 32px;
    background: var(--gray-100);
    border-radius: 8px;
    border: 2px dashed var(--gray-300);
}

.error-message {
    text-align: center;
    color: var(--danger-color);
    font-weight: 500;
    padding: 16px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.loading-stats {
    text-align: center;
    color: var(--gray-600);
    padding: 32px;
}

.loading-stats::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60% { content: "..."; }
    80%, 100% { content: ""; }
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 16px 0;
}

.page-info {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
    min-width: 100px;
    text-align: center;
}

.pagination-controls .btn {
    min-width: 100px;
    padding: 8px 16px;
    font-size: 14px;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
