/* VRC Core - Strava Integration Styles */

/* Connection Widget */
.vrc-strava-widget {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
}

.vrc-strava-widget h4 {
    margin: 0 0 15px 0;
    color: #333;
}

/* Button Styles */
.vrc-btn {
    display: inline-block;
    padding: 12px 20px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.vrc-btn-strava {
    background: #fc4c02;
    color: white;
}

.vrc-btn-strava:hover {
    background: #e43700;
    color: white;
}

.vrc-btn-strava svg {
    margin-right: 8px;
    vertical-align: middle;
}

.vrc-btn-primary {
    background: #0073aa;
    color: white;
}

.vrc-btn-primary:hover {
    background: #005a87;
    color: white;
}

.vrc-btn-secondary {
    background: #666;
    color: white;
}

.vrc-btn-secondary:hover {
    background: #555;
    color: white;
}

/* Connection Info */
.vrc-strava-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

.vrc-strava-info p {
    margin: 5px 0;
}

.vrc-status-active {
    color: #46b450;
    font-weight: bold;
}

.vrc-status-expired {
    color: #dc3232;
    font-weight: bold;
}

/* Messages */
.vrc-strava-messages {
    margin: 15px 0;
}

.vrc-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.vrc-message-success {
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.vrc-message-error {
    background: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}

.vrc-message-info {
    background: #d9edf7;
    border: 1px solid #bce8f1;
    color: #31708f;
}

/* Activities */
.vrc-strava-activities {
    margin: 20px 0;
}

.vrc-activity-item {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.vrc-activity-item:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.vrc-activity-title {
    margin: 0 0 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
}

.vrc-activity-type {
    font-size: 0.8em;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: normal;
}

.vrc-activity-date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.vrc-activity-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.vrc-activity-details span {
    font-size: 0.9em;
    padding: 5px 10px;
    background: #f8f8f8;
    border-radius: 3px;
}

/* Statistics */
.vrc-strava-stats {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
}

.vrc-strava-stats h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.vrc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.vrc-stat-item {
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.vrc-stat-item:hover {
    border-color: #0073aa;
}

.vrc-stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
    line-height: 1.2;
}

.vrc-stat-label {
    font-size: 0.9em;
    color: #666;
}

/* Leaderboard */
.vrc-strava-leaderboard {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.vrc-strava-leaderboard h4 {
    margin: 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    border-bottom: 1px solid #ddd;
}

.vrc-leaderboard-table {
    display: table;
    width: 100%;
}

.vrc-leaderboard-header,
.vrc-leaderboard-row {
    display: table-row;
}

.vrc-leaderboard-header > div,
.vrc-leaderboard-row > div {
    display: table-cell;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.vrc-leaderboard-header > div {
    background: #f9f9f9;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
}

.vrc-leaderboard-row:hover {
    background: #f8f8f8;
}

.vrc-rank {
    width: 60px;
    text-align: center;
    font-weight: bold;
}

.vrc-name {
    width: 40%;
}

.vrc-metric {
    width: 25%;
    text-align: right;
    font-weight: bold;
}

.vrc-activities {
    width: 20%;
    text-align: right;
    color: #666;
}

/* Medal positions */
.vrc-leaderboard-row:nth-child(2) .vrc-rank {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    line-height: 35px;
    margin: auto;
}

.vrc-leaderboard-row:nth-child(3) .vrc-rank {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #333;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    line-height: 35px;
    margin: auto;
}

.vrc-leaderboard-row:nth-child(4) .vrc-rank {
    background: linear-gradient(135deg, #cd7f32, #d4af6a);
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    line-height: 35px;
    margin: auto;
}

/* New Strava Integration Interface Styles */

/* Strava Connect Section (when not connected) */
.vrc-strava-connect-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddd;
}

.vrc-strava-header img {
    display: block;
    margin: 0 auto 15px auto;
    max-width: 200px;
    height: auto;
}

.vrc-strava-benefits {
    text-align: left;
    background: white;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid #fc4c02;
}

.vrc-strava-benefits h4 {
    color: #fc4c02;
    margin-top: 0;
}

.vrc-strava-benefits ul {
    margin: 10px 0;
    padding-left: 20px;
}

.vrc-strava-benefits li {
    margin: 8px 0;
    color: #555;
}

.vrc-strava-actions {
    margin: 20px 0;
}

.vrc-strava-connect-btn {
    background: #fc4c02 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 5px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

.vrc-strava-connect-btn:hover {
    background: #e43700 !important;
}

.vrc-strava-connect-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
}

.vrc-strava-privacy {
    margin-top: 15px;
}

.vrc-small-text {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

/* Strava Connected Section (when connected) */
.vrc-strava-connected-section {
    background: #f0f8f0;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #c3e6c3;
}

.vrc-strava-status {
    margin-bottom: 15px;
}

.vrc-strava-user-info h4 {
    color: #2d5d2d;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vrc-last-sync {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.vrc-token-expired {
    background: #ffeaa7;
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #fdcb6e;
    margin-top: 10px;
}

.vrc-token-expired p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vrc-strava-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.vrc-strava-sync-btn {
    background: #28a745 !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

.vrc-strava-sync-btn:hover {
    background: #218838 !important;
}

.vrc-strava-sync-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
}

.vrc-strava-reconnect-btn {
    background: #fc4c02 !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.vrc-strava-reconnect-btn:hover {
    background: #e43700 !important;
}

.vrc-strava-disconnect-btn {
    color: #dc3545 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    padding: 8px 12px !important;
}

.vrc-strava-disconnect-btn:hover {
    color: #c82333 !important;
    text-decoration: underline !important;
}

/* Button Loading States */
.vrc-btn-loading {
    display: none;
}

.vrc-btn-text {
    display: inline;
}

/* Strava Activities Display */
.vrc-strava-activities {
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
    margin-top: 15px;
}

.vrc-strava-activities:empty {
    display: none;
}

.vrc-strava-activities h4 {
    background: #f8f9fa;
    margin: 0;
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

/* Strava Message Area */
.vrc-strava-message {
    margin-top: 15px;
}

.vrc-strava-message .notice {
    margin: 0;
    padding: 12px 15px;
    border-radius: 5px;
}

.vrc-strava-message .notice-success {
    background-color: #d1eddd;
    border-color: #badbcc;
    color: #155724;
}

.vrc-strava-message .notice-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.vrc-strava-message .notice-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Strava Not Configured */
.vrc-strava-not-configured {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
    padding: 15px;
    border-radius: 5px;
}

.vrc-strava-not-configured p {
    margin: 0;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vrc-strava-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .vrc-strava-connect-btn,
    .vrc-strava-sync-btn,
    .vrc-strava-reconnect-btn {
        width: 100%;
        text-align: center;
    }

    .vrc-strava-benefits {
        text-align: left;
    }
}

/* Admin Styles */
.vrc-stat-boxes {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.vrc-stat-box {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    text-align: center;
    min-width: 140px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.vrc-stat-box h3 {
    font-size: 2.2em;
    margin: 0 0 8px 0;
    color: #0073aa;
    font-weight: bold;
}

.vrc-stat-box p {
    margin: 0;
    color: #666;
    font-size: 0.9em;
}

.vrc-setup-instructions {
    margin-top: 30px;
    background: #f9f9f9;
    padding: 20px;
    border-left: 4px solid #0073aa;
    border-radius: 0 5px 5px 0;
}

.vrc-setup-instructions h2 {
    margin-top: 0;
}

.vrc-setup-instructions ol {
    line-height: 1.6;
}

.vrc-webhook-item {
    margin: 5px 0;
    padding: 8px;
    background: #f8f8f8;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vrc-status-inactive {
    color: #dc3232;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vrc-stat-boxes {
        flex-direction: column;
    }

    .vrc-activity-details {
        flex-direction: column;
        gap: 10px;
    }

    .vrc-stats-grid {
        grid-template-columns: 1fr;
    }

    .vrc-leaderboard-header > div,
    .vrc-leaderboard-row > div {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .vrc-name {
        width: 35%;
    }

    .vrc-metric {
        width: 30%;
    }

    .vrc-activities {
        width: 25%;
    }
}

@media (max-width: 480px) {
    .vrc-strava-widget,
    .vrc-strava-stats,
    .vrc-strava-leaderboard {
        margin: 10px 0;
        padding: 15px;
    }

    .vrc-btn {
        display: block;
        margin: 10px 0;
        text-align: center;
    }

    .vrc-activity-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
