/* Trend Analysis Styles */
.trend-btn {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.2);
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.trend-btn:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.trend-btn-small {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.2);
    padding: 0.25rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    margin-left: auto;
}

.trend-btn-small:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.workout-count-badge {
    background: rgba(46, 204, 113, 0.12);
    color: #27ae60;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.trend-summary {
    background: rgba(52, 152, 219, 0.05);
    border: 1px solid rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.trend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.trend-header h3 {
    margin: 0;
    color: #2c3e50;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.trend-improving {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.trend-declining {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.trend-stable {
    background: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
    border: 1px solid rgba(149, 165, 166, 0.2);
}

.trend-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.trend-stat {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.trend-stat label {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trend-stat value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.trend-history {
    margin-top: 2rem;
}

.trend-history h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Enhanced Exercise Trend Filters */
.trend-filters {
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-range-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-lg .modal-content {
    max-width: 1000px;
    width: 95vw;
}

.trend-chart-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.trend-chart-section h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.chart-container {
    text-align: center;
    background: #fafbfc;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.chart-container canvas {
    display: block;
    max-width: 100%;
}

.trend-stat value.positive {
    color: #27ae60 !important;
}

.trend-stat value.negative {
    color: #e74c3c !important;
}

@media (max-width: 768px) {
    .modal-lg .modal-content {
        max-width: 95vw;
        margin: 1rem;
    }

    .date-range-buttons {
        gap: 0.25rem;
    }

    .trend-filters {
        padding: 1rem;
    }

    /* Make trend buttons more visible on mobile */
    .trend-btn, .trend-btn-small {
        background: rgba(52, 152, 219, 0.15) !important;
        border: 2px solid rgba(52, 152, 219, 0.3) !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 8px !important;
    }

    .trend-btn i, .trend-btn-small i {
        font-size: 1.1rem !important;
    }

    /* Add pulse animation to make trend buttons more discoverable */
    .trend-btn, .trend-btn-small {
        animation: trendPulse 3s infinite;
    }

    @keyframes trendPulse {
        0%, 90% { transform: scale(1); }
        95% { transform: scale(1.05); }
        100% { transform: scale(1); }
    }
}

/* Exercise trend charts now use the same canvas-based styling as weight trends */

.trend-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.trend-table th {
    background: #f8f9fa;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #dee2e6;
}

.trend-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
}

.trend-table tr:hover {
    background: rgba(52, 152, 219, 0.05);
}

.performance-badge {
    background: linear-gradient(45deg, #3498db, #9b59b6);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.text-success {
    color: #27ae60 !important;
}

.text-danger {
    color: #e74c3c !important;
}

.text-muted {
    color: #95a5a6 !important;
}

/* Exercise header adjustments for trend buttons */
.exercise-card .exercise-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.exercise-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .trend-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-bars {
        min-width: 300px;
        height: 80px;
    }

    .trend-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .trend-indicator {
        align-self: center;
    }
}
