/* 
 * Strava Connector - Consolidated Frontend Styles
 * This file contains all frontend CSS for the Strava Connector plugin
 */

/* =============================================================================
   CORE DASHBOARD STYLES (from strava-user-dashboard.css)
   ========================================================================== */

.strava-profile { 
    max-width: 800px; 
    margin: 20px auto; 
    padding: 20px; 
    background: #fff; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.strava-header { 
    text-align: center; 
    margin-bottom: 30px; 
}

.strava-profile-image { 
    width: 150px; 
    height: 150px; 
    border-radius: 50%; 
    margin-bottom: 15px; 
}

.strava-location { 
    color: #666; 
    margin: 5px 0; 
}

.strava-stats { 
    margin: 20px 0; 
}

.stat-box { 
    background: #f8f9fa; 
    padding: 20px; 
    border-radius: 6px; 
}

.stat-box ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.stat-box li { 
    margin: 10px 0; 
    color: #333; 
}

.activity-list { 
    margin-top: 20px; 
}

.activity-item { 
    background: #f8f9fa; 
    padding: 15px; 
    margin-bottom: 15px; 
    border-radius: 6px; 
}

.activity-details { 
    display: flex; 
    gap: 15px; 
    margin: 10px 0; 
    flex-wrap: wrap; 
}

.activity-details span { 
    background: #fff; 
    padding: 5px 10px; 
    border-radius: 4px; 
    font-size: 0.9em; 
}

.activity-date { 
    color: #666; 
    font-size: 0.9em; 
}

.activity-actions { 
    margin-top: 10px; 
}

.strava-connect-prompt { 
    max-width: 500px; 
    margin: 40px auto; 
    padding: 30px; 
    background: #fffbe6; 
    border: 1px solid #ffe58f; 
    border-radius: 8px; 
    text-align: center; 
}

.strava-connect-prompt .button { 
    margin-top: 15px; 
}

/* Loading state for download buttons */
.strava-download-gpx.loading {
    opacity: 0.6;
    pointer-events: none;
}

.strava-download-gpx.loading::after {
    content: " (Downloading...)";
    font-style: italic;
}

/* Enhanced loading animation */
.strava-download-gpx.loading {
    opacity: 0.6;
    cursor: not-allowed !important;
    pointer-events: none;
}

.strava-download-gpx.loading:after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 5px;
    border: 2px solid #ccc;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: gpx-spin 1s linear infinite;
}

@keyframes gpx-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* GPX Download Button Styles */
.strava-download-gpx {
    background: #fc4c02;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.strava-download-gpx:hover {
    background: #e34402;
    color: white;
}        

.strava-profile {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.strava-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #fc4c02;
}

.strava-profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 15px;
}

.strava-header h2 {
    margin: 0;
    color: #fc4c02;
}

.strava-location {
    color: #666;
    margin: 5px 0 0 0;
}

.strava-stats {
    margin-bottom: 30px;
}

.stat-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-box h3 {
    margin-top: 0;
    color: #333;
}

.stat-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stat-box li {
    margin: 10px 0;
    font-size: 1.1em;
}

.strava-recent-activities h3 {
    color: #fc4c02;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.activity-list {
    display: grid;
    gap: 20px;
}

.activity-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.activity-item h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.activity-header h4 {
    margin: 0;
    flex: 1;
    color: #333;
}

.activity-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-saved-badge {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    border: 1px solid #c3e6cb;
}

.strava-sync-single-activity {
    background: #007cba;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.strava-sync-single-activity:hover {
    background: #005a8a;
}

.strava-sync-single-activity:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.activity-embed {
    padding: 0;
}

.strava-embed-placeholder {
    min-height: 200px;
    width: 100%;
    border: none;
}

.activity-actions {
    padding: 15px 20px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.strava-connect-prompt {
    text-align: center;
    padding: 40px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    margin: 20px 0;
}

/* =============================================================================
   CLUB STYLES (from strava-club.css)
   ========================================================================== */

.strava-club { 
    max-width: 1200px; 
    margin: 20px auto; 
    padding: 20px; 
}

/* Permission-based visibility */
.strava-club-guest .admin-only,
.strava-club-guest .member-only {
    display: none !important;
}

.strava-club-member .admin-only {
    display: none !important;
}

.strava-club-admin .admin-only,
.strava-club-admin .member-only {
    display: block;
}

.strava-club-member .member-only {
    display: block;
}

/* Permission indicators */
.strava-club-permission-admin {
    border-left: 4px solid #28a745;
}

.strava-club-permission-member {
    border-left: 4px solid #007bff;
}

.strava-club-permission-none {
    border-left: 4px solid #6c757d;
}

.club-header { 
    text-align: center; 
    margin-bottom: 40px; 
}

.club-title-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.club-title-section h2 {
    margin: 0;
}

.permission-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.admin-badge {
    background: #28a745;
    color: white;
}

.member-badge {
    background: #007bff;
    color: white;
}

.club-description { 
    color: #666; 
    margin: 15px 0; 
}

.club-stats { 
    margin: 20px 0; 
}

.admin-controls,
.member-controls {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.admin-controls .button,
.member-controls .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    margin: 0;
}

.permission-message {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font-style: italic;
}

.club-members-restricted,
.club-activities-restricted {
    text-align: center;
    padding: 40px 20px;
}

.member-actions {
    margin-top: 10px;
    text-align: center;
}

.activity-admin-actions {
    margin-left: auto;
}

.member-count { 
    background: #f8f9fa; 
    padding: 8px 16px; 
    border-radius: 20px; 
    font-weight: bold; 
}

.members-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 20px; 
    margin: 20px 0; 
}

.member-card { 
    background: #fff; 
    padding: 15px; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    text-align: center;
    transition: transform 0.2s ease;
}

.member-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.member-avatar { 
    width: 80px; 
    height: 80px; 
    border-radius: 50%; 
    margin-bottom: 10px;
    object-fit: cover;
}

.member-info h4 { 
    margin: 5px 0; 
    font-size: 1.1em;
}

.member-location { 
    color: #666; 
    font-size: 0.9em;
    margin: 5px 0;
}

.activity-list { 
    margin-top: 20px; 
}

.activity-item { 
    background: #fff; 
    padding: 20px; 
    margin-bottom: 20px; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.activity-header { 
    display: flex; 
    align-items: center; 
    margin-bottom: 15px; 
}

.activity-avatar { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    margin-right: 10px;
    object-fit: cover;
}

.activity-athlete h4 { 
    margin: 0; 
}

.activity-type { 
    background: #f8f9fa; 
    padding: 4px 8px; 
    border-radius: 4px; 
    font-size: 0.9em; 
}

.activity-stats { 
    display: flex; 
    gap: 15px; 
    margin: 10px 0; 
    flex-wrap: wrap; 
}

.activity-stats span { 
    background: #f8f9fa; 
    padding: 5px 10px; 
    border-radius: 4px; 
    font-size: 0.9em; 
}

.activity-date { 
    color: #666; 
    font-size: 0.9em; 
}

.club-activities-note {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 15px;
    color: #6c757d;
    font-size: 0.9em;
}

.activity-actions { 
    margin-top: 10px; 
}

/* Dashboard Styles */
.strava-user-dashboard {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    background: linear-gradient(135deg, #fc4c02 0%, #ff6b35 100%);
    color: white;
    border-radius: 8px;
}

.dashboard-header h2 {
    margin: 0 0 10px 0;
    color: white;
}

.dashboard-section {
    margin-bottom: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #fc4c02;
    padding-bottom: 10px;
}

/* User Clubs Section */
.user-clubs {
    display: grid;
    gap: 20px;
}

.club-membership-card {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.club-membership-card h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.membership-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.club-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-action {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.add-club-section {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.stat-card h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #fc4c02;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.stat-details {
    display: flex;
    justify-content: space-around;
    font-size: 0.8em;
    color: #6c757d;
}

/* Challenge Styles */
.strava-challenge-create,
.strava-challenge-management,
.strava-challenge-view,
.strava-challenge-list {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
}

.challenges-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.challenges-header h3 {
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.management-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-button.active {
    border-bottom-color: #fc4c02;
    color: #fc4c02;
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.challenge-admin-actions {
    display: flex;
    gap: 10px;
}

/* Recent Activities in Dashboard */
.recent-activities .activity-list {
    display: grid;
    gap: 15px;
}

.recent-activities .activity-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.recent-activities .activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.recent-activities .activity-header h4 {
    margin: 0;
    color: #333;
}

.recent-activities .activity-type {
    background: #fc4c02;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.recent-activities .activity-stats {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.recent-activities .activity-stats span {
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid #dee2e6;
}

.recent-activities .activity-actions {
    margin-top: 10px;
    text-align: right;
}

/* =============================================================================
   SYNC CONTROLS STYLES (from inline CSS)
   ========================================================================== */

/* Main Sync Controls Component */
.strava-sync-controls {
    margin-bottom: 20px;
}

.strava-info-banner {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.strava-info-banner p {
    margin: 0;
    color: #0c5460;
    font-size: 0.9em;
}

.sync-time-frame {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sync-time-frame label {
    font-weight: 600;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

.strava-sync-time-frame-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 150px;
    cursor: pointer;
}

.strava-sync-time-frame-select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.sync-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.layout-horizontal .sync-buttons {
    flex-direction: row;
}

.layout-vertical .sync-buttons {
    flex-direction: column;
    align-items: flex-start;
}

.layout-vertical .sync-time-frame {
    flex-direction: column;
    align-items: flex-start;
}

.layout-grouped .sync-buttons {
    flex-direction: row;
    flex-wrap: wrap;
}

.align-left .sync-buttons,
.align-left .sync-time-frame {
    justify-content: flex-start;
}

.align-center .sync-buttons,
.align-center .sync-time-frame {
    justify-content: center;
}

.align-right .sync-buttons,
.align-right .sync-time-frame {
    justify-content: flex-end;
}

.sync-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.sync-status.strava-sync-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.sync-status.strava-sync-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.sync-status.strava-sync-info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.refresh-button {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.refresh-button:hover {
    background: #5a6268;
    border-color: #545b62;
    color: white;
}

.strava-sync-controls-connect,
.strava-sync-controls-error {
    padding: 20px;
    text-align: center;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* =============================================================================
   INDIVIDUAL SYNC BUTTON STYLES (from inline CSS in shortcodes)
   ========================================================================== */

/* Profile Sync Button */
.strava-sync-profile-wrapper {
    display: inline-block;
}

.strava-sync-profile-button {
    text-decoration: none !important;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strava-sync-profile-button.size-small {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.2;
}

.strava-sync-profile-button.size-normal {
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.4;
}

.strava-sync-profile-button.size-large {
    padding: 12px 24px;
    font-size: 16px;
    line-height: 1.4;
}

.strava-sync-profile-button.button-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.strava-sync-profile-button.button-secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    color: white;
}

.strava-sync-profile-button.button-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.strava-sync-profile-button.button-primary:hover {
    background: #005a87;
    border-color: #005a87;
    color: white;
}

.strava-sync-profile-connect,
.strava-sync-profile-error {
    padding: 15px;
    text-align: center;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
    margin: 10px 0;
}

.strava-sync-profile-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Activities Sync Button */
.strava-sync-activities-wrapper {
    margin: 10px 0;
}

.strava-sync-activities-wrapper.layout-horizontal {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.strava-sync-activities-wrapper.layout-vertical .sync-time-frame {
    margin-bottom: 10px;
}

.strava-sync-activities-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

.strava-sync-activities-btn.size-small {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.2;
}

.strava-sync-activities-btn.size-normal {
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.4;
}

.strava-sync-activities-btn.size-large {
    padding: 12px 24px;
    font-size: 16px;
    line-height: 1.4;
}

.strava-sync-activities-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.strava-sync-activities-connect,
.strava-sync-activities-error {
    padding: 15px;
    text-align: center;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
    margin: 10px 0;
}

.strava-sync-activities-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Routes Sync Button */
.strava-sync-routes-wrapper {
    margin: 10px 0;
}

.strava-sync-routes-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

.strava-sync-routes-btn.size-small {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.2;
}

.strava-sync-routes-btn.size-normal {
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.4;
}

.strava-sync-routes-btn.size-large {
    padding: 12px 24px;
    font-size: 16px;
    line-height: 1.4;
}

.strava-sync-routes-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.strava-sync-routes-connect,
.strava-sync-routes-error {
    padding: 15px;
    text-align: center;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 6px;
    margin: 10px 0;
}

.strava-sync-routes-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* =============================================================================
   RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 768px) {
    .strava-profile {
        margin: 10px;
        padding: 15px;
    }

    .activity-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .activity-header h4 {
        font-size: 1em;
    }

    .activity-status {
        width: 100%;
        justify-content: flex-end;
    }

    .strava-sync-single-activity {
        font-size: 0.8em;
        padding: 5px 10px;
    }

    .activity-item h4 {
        padding: 10px 15px;
    }
    
    .activity-actions {
        padding: 10px 15px;
    }

    /* Sync Controls Responsive */
    .sync-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .layout-horizontal .sync-buttons {
        flex-direction: column;
    }
    
    .sync-time-frame {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .strava-sync-time-frame-select {
        width: 100%;
        min-width: auto;
    }
    
    .strava-info-banner {
        padding: 12px;
    }
    
    .strava-info-banner p {
        font-size: 0.85em;
    }

    /* Individual Sync Buttons Responsive */
    .strava-sync-profile-button,
    .strava-sync-activities-btn,
    .strava-sync-routes-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .strava-sync-activities-wrapper.layout-horizontal {
        flex-direction: column;
        align-items: stretch;
    }
} 