/* =============================================================
   WORKOUT STYLES - Conditional CSS for workout entry pages
   ============================================================= */

.entry-workout {
    margin: var(--spacing-md) 0;
}

/* Main Stats Chips */
.workout-stats-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.workout-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.workout-stat-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.workout-stat-chip .stat-icon {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0;
}

.workout-stat-chip .stat-value {
    white-space: nowrap;
}

/* Specific stat chip colors */
.workout-stat-chip.distance {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

.workout-stat-chip.distance .stat-icon {
    color: #22c55e !important;
}

.workout-stat-chip.duration {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.workout-stat-chip.duration .stat-icon {
    color: #3b82f6 !important;
}

.workout-stat-chip.pace {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #d97706;
}

.workout-stat-chip.pace .stat-icon {
    color: #f59e0b !important;
}

.workout-stat-chip.elevation {
    background: #faf5ff;
    border-color: #8b5cf6;
    color: #7c3aed;
}

.workout-stat-chip.elevation .stat-icon {
    color: #8b5cf6 !important;
}

.workout-stat-chip.calories {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.workout-stat-chip.calories .stat-icon {
    color: #ef4444 !important;
}

.workout-stat-chip.heart-rate {
    background: #fdf2f8;
    border-color: #ec4899;
    color: #be185d;
}

.workout-stat-chip.heart-rate .stat-icon {
    color: #ec4899 !important;
}

/* Section Titles */
.workout-section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.workout-section-title svg {
    width: 18px !important;
    height: 18px !important;
    color: var(--color-accent);
}

/* Map Container */
.workout-map-container {
    margin-bottom: var(--spacing-xl);
}

.workout-map {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

@media (max-width: 768px) {
    .workout-map {
        height: 250px;
    }
}

/* Elevation Chart */
.workout-elevation-container {
    margin-bottom: var(--spacing-xl);
}

.workout-elevation-chart {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

@media (max-width: 768px) {
    .workout-elevation-chart {
        height: 150px;
    }
}

/* Splits Table */
.workout-splits-container {
    margin-bottom: var(--spacing-xl);
}

.workout-splits-table {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-background);
}

.splits-header {
    display: grid;
    grid-template-columns: 60px repeat(3, 1fr) auto auto;
    background: var(--color-table-header);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 0.875rem;
}

.splits-row {
    display: grid;
    grid-template-columns: 60px repeat(3, 1fr) auto auto;
    border-bottom: 1px solid var(--color-border-light);
}

.splits-row:last-child {
    border-bottom: none;
}

.splits-row:nth-child(even) {
    background: var(--color-surface);
}

.split-col {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.split-number {
    font-weight: 600;
    color: var(--color-accent);
}

/* Additional Metrics */
.workout-additional-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.additional-metric {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 120px;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .workout-stats-chips {
        gap: var(--spacing-xs);
    }

    .workout-stat-chip {
        font-size: 0.8rem;
        padding: var(--spacing-xs);
    }

    .workout-stat-chip .stat-icon {
        width: 14px !important;
        height: 14px !important;
    }

    .splits-header,
    .splits-row {
        grid-template-columns: 40px repeat(2, 1fr) 60px;
        font-size: 0.75rem;
    }

    .split-col {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    /* Hide some columns on mobile */
    .splits-header .split-col:nth-child(4),
    .splits-row .split-col:nth-child(4),
    .splits-header .split-col:nth-child(5),
    .splits-row .split-col:nth-child(5),
    .splits-header .split-col:nth-child(6),
    .splits-row .split-col:nth-child(6) {
        display: none;
    }

    .workout-additional-metrics {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .additional-metric {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .workout-stats-chips {
        flex-direction: column;
        align-items: flex-start;
    }

    .workout-stat-chip {
        width: 100%;
        justify-content: flex-start;
    }

    .workout-map,
    .workout-elevation-chart {
        height: 250px;
    }
}

/* Workout Map Markers */
.workout-marker-container {
    background: none !important;
    border: none !important;
}

.workout-marker {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    min-width: 60px;
}

.workout-start {
    background: #10b981;
    color: white;
}

.workout-finish {
    background: #ef4444;
    color: white;
}

/* Workout Summary on Index */
.workout-summary-text {
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
    font-size: 1rem;
    line-height: 1.4;
}

.workout-summary-text strong {
    font-weight: 600;
}

/* Entry text spacing in workout entries */
.entry-workout .entry-text {
    margin-bottom: var(--spacing-xl);
}

/* Workout Button Styling */
.post-action-btn[href*="workout"] {
    background: #f3e8ff;
    color: #000000;
    border-color: #c4b5fd;
}

.post-action-btn[href*="workout"]:hover {
    background: #ede9fe;
    color: #000000;
    border-color: #a78bfa;
    transform: translateY(-1px);
}

/* Workout photos display */
.workout-photos-container {
    margin: var(--spacing-lg) 0;
}

.workout-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.workout-photo-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--color-surface);
    aspect-ratio: 1;
}

.workout-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.workout-photo:hover {
    transform: scale(1.05);
}

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