/* --- History Tab + Strava Integration --- */

/* Strava connect section */
.strava-connect-section {
    text-align: center;
    padding: 32px 20px;
}

.strava-btn {
    background: #fc4c02;
    color: #fff;
}

.strava-btn:hover:not(:disabled) {
    background: #e04400;
}

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

/* Connected header */
.strava-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #232735;
}

.strava-athlete-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.strava-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.strava-athlete-name {
    font-weight: 700;
    color: #e2e4ea;
    font-size: 15px;
}

/* History grid */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.history-card {
    background: #1E2130;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    transition: all 0.2s;
}

.history-card:hover {
    background: #232735;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.history-card-name {
    font-weight: 700;
    font-size: 15px;
    color: #e2e4ea;
}

.history-delete-btn {
    background: none;
    border: none;
    color: #5c6078;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.history-delete-btn:hover {
    color: #e53e3e;
}

.history-card-date {
    font-size: 13px;
    color: #8b8fa3;
    margin-bottom: 8px;
}

.history-card-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #8b8fa3;
    font-weight: 600;
    flex-wrap: wrap;
}

.history-card-footer {
    margin-top: 10px;
}

.history-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-badge-uploaded {
    background: rgba(102, 126, 234, 0.15);
    color: #7f8ff4;
}

.history-badge-in-progress {
    background: rgba(99, 179, 237, 0.15);
    color: #63b3ed;
}

.history-card-in-progress {
    border-color: #667eea;
    border-style: dashed;
}

/* Mini workout profile in history cards */
.history-profile {
    height: 60px;
    margin: 8px 0;
}

/* Upload prompt overlay */
.upload-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.upload-prompt-overlay.hidden {
    display: none;
}

.upload-prompt-card {
    background: #151821;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.upload-prompt-card h3 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #e2e4ea;
}

.upload-prompt-card p {
    margin: 0 0 20px;
    color: #8b8fa3;
    font-size: 15px;
}

.upload-prompt-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .history-grid {
        grid-template-columns: 1fr;
    }

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

    .upload-prompt-actions {
        flex-direction: column;
    }
}
