/* Plan Statistics Styles */

.yrt-statistics-container {
    font-family: 'Rajdhani', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #17131b;
}

.yrt-statistics-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f1ebe7;
    border-radius: 8px;
    border: 1px solid #d0ee88;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.yrt-header-content {
    flex: 1;
    text-align: left;
}

.yrt-statistics-header h2 {
    margin: 0;
    color: #16361c;
    font-family: 'League Spartan', 'Rajdhani', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    font-size: 24px;
}

.yrt-statistics-subtitle {
    margin-top: 8px;
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* Refresh Button Styles */
.yrt-refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #d0ee88;
    color: #17131b;
    border: 2px solid #16361c;
    border-radius: 25px;
    padding: 12px 20px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.yrt-refresh-btn:hover {
    background-color: #16361c;
    color: #d0ee88;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.yrt-refresh-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.yrt-refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.yrt-refresh-btn.loading {
    pointer-events: none;
}

.yrt-refresh-btn.loading svg {
    animation: spin 1s linear infinite;
}

.yrt-refresh-btn svg {
    transition: transform 0.3s ease;
}

.yrt-refresh-btn:hover svg {
    transform: rotate(180deg);
}

/* Success Message */
.yrt-refresh-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading State */
.yrt-statistics-container.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.yrt-statistics-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #d0ee88;
    border-top: 4px solid #16361c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.yrt-statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.yrt-stat-card {
    background-color: #f1ebe7;
    border-radius: 8px;
    border: 1px solid #d0ee88;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    padding: 25px;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.yrt-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.yrt-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #d0ee88;
}

.yrt-stat-header h3 {
    margin: 0;
    color: #16361c;
    font-family: 'League Spartan', 'Rajdhani', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 18px;
}

.yrt-stat-icon {
    font-size: 12px;
    background-color: #d0ee88;
    color: #17131b;
    padding: 8px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Bars */
.yrt-progress-section {
    margin-bottom: 15px;
}

.yrt-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.yrt-progress-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.yrt-progress-value {
    font-weight: 700;
    color: #16361c;
    font-size: 14px;
}

.yrt-progress-bar {
    width: 100%;
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.yrt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d0ee88 0%, #16361c 100%);
    border-radius: 6px;
    transition: width 0.8s ease;
    position: relative;
}

.yrt-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.yrt-progress-percentage {
    text-align: center;
    font-weight: 800;
    color: #16361c;
    font-size: 16px;
}

/* Weekly Progress */
.yrt-weekly-stats {
    max-height: 300px;
    overflow-y: auto;
}

.yrt-week-stat {
    margin-bottom: 15px;
    padding: 12px;
    background-color: rgba(208, 238, 136, 0.1);
    border-radius: 6px;
    border-left: 4px solid #d0ee88;
}

.yrt-week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.yrt-week-number {
    font-weight: 700;
    color: #16361c;
    font-size: 14px;
}

.yrt-week-completion {
    font-weight: 600;
    color: #666;
    font-size: 12px;
}

.yrt-week-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.yrt-week-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.yrt-week-distance {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Key Metrics */
.yrt-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.yrt-metric {
    text-align: center;
    padding: 15px 10px;
    background-color: rgba(208, 238, 136, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(208, 238, 136, 0.3);
    transition: all 0.2s ease;
}

.yrt-metric:hover {
    background-color: rgba(208, 238, 136, 0.2);
    transform: translateY(-1px);
}

.yrt-metric-value {
    font-size: 24px;
    font-weight: 800;
    color: #16361c;
    margin-bottom: 5px;
}

.yrt-metric-label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Recent Activity */
.yrt-activity-list {
    max-height: 250px;
    overflow-y: auto;
}

.yrt-activity-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background-color: rgba(208, 238, 136, 0.1);
    border-radius: 6px;
    border-left: 4px solid #d0ee88;
    transition: all 0.3s ease;
    position: relative;
    min-height: 50px;
    gap: 12px;
}

.yrt-activity-item:hover {
    background-color: rgba(208, 238, 136, 0.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

/* Workout Type Colors - Matching Active Plan Exactly */
.yrt-activity-item.yrt-activity-strength {
    border-left-color: #4a90e2;
    background-color: #e8f4f8;
}

.yrt-activity-item.yrt-activity-strength:hover {
    background-color: #d1e7f0;
}

.yrt-activity-item.yrt-activity-strength .yrt-activity-icon {
    color: #4a90e2;
}

.yrt-activity-item.yrt-activity-easy {
    border-left-color: #28a745;
    background-color: #e8f5e8;
}

.yrt-activity-item.yrt-activity-easy:hover {
    background-color: #d1f2d1;
}

.yrt-activity-item.yrt-activity-easy .yrt-activity-icon {
    color: #28a745;
}

.yrt-activity-item.yrt-activity-long {
    border-left-color: #2196f3;
    background-color: #e3f2fd;
}

.yrt-activity-item.yrt-activity-long:hover {
    background-color: #bbdefb;
}

.yrt-activity-item.yrt-activity-long .yrt-activity-icon {
    color: #2196f3;
}

.yrt-activity-item.yrt-activity-interval {
    border-left-color: #f44336;
    background-color: #ffebee;
}

.yrt-activity-item.yrt-activity-interval:hover {
    background-color: #ffcdd2;
}

.yrt-activity-item.yrt-activity-interval .yrt-activity-icon {
    color: #f44336;
}

.yrt-activity-item.yrt-activity-tempo {
    border-left-color: #9c27b0;
    background-color: #f3e5f5;
}

.yrt-activity-item.yrt-activity-tempo:hover {
    background-color: #e1bee7;
}

.yrt-activity-item.yrt-activity-tempo .yrt-activity-icon {
    color: #9c27b0;
}

.yrt-activity-item.yrt-activity-recovery {
    border-left-color: #795548;
    background-color: #efebe9;
}

.yrt-activity-item.yrt-activity-recovery:hover {
    background-color: #d7ccc8;
}

.yrt-activity-item.yrt-activity-recovery .yrt-activity-icon {
    color: #795548;
}

.yrt-activity-item.yrt-activity-race {
    border-left-color: #f44336;
    background-color: #fff8f8;
}

.yrt-activity-item.yrt-activity-race:hover {
    background-color: #ffebee;
}

.yrt-activity-item.yrt-activity-race .yrt-activity-icon {
    color: #f44336;
}

.yrt-activity-item.yrt-activity-shakeout {
    border-left-color: #795548;
    background-color: #efebe9;
}

.yrt-activity-item.yrt-activity-shakeout:hover {
    background-color: #d7ccc8;
}

.yrt-activity-item.yrt-activity-shakeout .yrt-activity-icon {
    color: #795548;
}

.yrt-activity-item.yrt-activity-workout {
    border-left-color: #6c757d;
    background-color: #f8f9fa;
}

.yrt-activity-item.yrt-activity-workout:hover {
    background-color: #e9ecef;
}

.yrt-activity-item.yrt-activity-workout .yrt-activity-icon {
    color: #6c757d;
}

/* Graph Section */
.yrt-graph-canvas {
    width: 100%;
    height: 400px;
    position: relative;
    background-color: #17131b;
    border-radius: 6px;
    border: 1px solid #d0ee88;
    overflow: hidden;
    margin-bottom: 15px;
    max-height: 400px;
    min-height: 400px;
}

.yrt-graph-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.yrt-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #17131b;
}

.yrt-legend-color {
    width: 16px;
    height: 3px;
    border-radius: 2px;
}

.yrt-legend-projected {
    background-color: #16361c;
}

.yrt-legend-actual {
    background-color: #d0ee88;
}

/* Missed Workouts Section */
.yrt-missed-summary {
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(220, 53, 69, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.yrt-missed-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.yrt-missed-stat {
    text-align: center;
    flex: 1;
}

.yrt-missed-label {
    display: block;
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.yrt-missed-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #dc3545;
}

.yrt-activity-icon {
    font-size: 12px;
    width: 50px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 8px;
    background-color: rgba(0,0,0,0.1);
    border-radius: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yrt-activity-details {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.yrt-activity-title {
    font-weight: 600;
    color: #16361c;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yrt-activity-meta {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yrt-activity-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.yrt-activity-status.done {
    background-color: #28a745;
    color: white;
}

.yrt-activity-status.missed {
    background-color: #dc3545;
    color: white;
}

.yrt-no-activity {
    text-align: center;
    padding: 30px 20px;
    color: #666;
    font-style: italic;
}

.yrt-no-activity p {
    margin: 0;
    font-size: 14px;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .yrt-statistics-container {
        padding: 10px;
        margin: 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .yrt-statistics-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 15px;
        margin: 0 0 20px 0;
    }
    
    .yrt-header-content {
        text-align: center;
    }
    
    .yrt-header-content h2 {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .yrt-statistics-subtitle {
        font-size: 14px;
    }
    
    .yrt-refresh-btn {
        padding: 10px 16px;
        font-size: 12px;
        min-width: 120px;
        justify-content: center;
        align-self: center;
    }
    
    .yrt-refresh-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .yrt-statistics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 0;
        padding: 0;
    }
    
    .yrt-stat-card {
        padding: 15px;
        margin: 0 0 15px 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .yrt-stat-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .yrt-stat-header h3 {
        font-size: 16px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .yrt-stat-icon {
        width: 35px;
        height: 35px;
        font-size: 20px;
        flex-shrink: 0;
    }
    
    .yrt-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
    }
    
    .yrt-metric {
        padding: 12px 8px;
        min-width: 0;
        word-wrap: break-word;
    }
    
    .yrt-metric-value {
        font-size: 18px;
        word-wrap: break-word;
    }
    
    .yrt-metric-label {
        font-size: 9px;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .yrt-progress-label,
    .yrt-progress-value {
        font-size: 12px;
        word-wrap: break-word;
    }
    
    .yrt-progress-percentage {
        font-size: 14px;
    }
    
    .yrt-progress-info {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .yrt-missed-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .yrt-missed-stat {
        text-align: center;
    }
    
    .yrt-graph-canvas {
        height: 250px;
        width: 100%;
        max-width: 100%;
    }
    
    .yrt-graph-legend {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .yrt-legend-item {
        font-size: 10px;
        flex-wrap: wrap;
        text-align: center;
    }
    
    .yrt-activity-item {
        padding: 10px;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .yrt-activity-icon {
        width: 40px;
        font-size: 10px;
        padding: 4px 6px;
    }
    
    .yrt-activity-details {
        min-width: 0;
        flex: 1;
    }
    
    .yrt-activity-title {
        font-size: 12px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .yrt-activity-meta {
        font-size: 10px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .yrt-activity-status {
        font-size: 9px;
        padding: 3px 6px;
        flex-shrink: 0;
    }
    
    .yrt-week-stat {
        padding: 10px;
    }
    
    .yrt-week-header {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .yrt-week-number {
        font-size: 12px;
    }
    
    .yrt-week-completion {
        font-size: 11px;
    }
    
    .yrt-week-distance {
        font-size: 11px;
    }
    
    .yrt-refresh-success {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
        font-size: 13px;
        padding: 12px 20px;
    }
    
    /* Ensure no horizontal overflow */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix for any potential overflow issues */
    .yrt-statistics-container,
    .yrt-statistics-grid,
    .yrt-stat-card,
    .yrt-activity-list,
    .yrt-weekly-stats {
        overflow-x: hidden;
    }
}

/* Tablet adjustments */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .yrt-statistics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scrollbar Styling */
.yrt-weekly-stats::-webkit-scrollbar,
.yrt-activity-list::-webkit-scrollbar {
    width: 6px;
}

.yrt-weekly-stats::-webkit-scrollbar-track,
.yrt-activity-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.yrt-weekly-stats::-webkit-scrollbar-thumb,
.yrt-activity-list::-webkit-scrollbar-thumb {
    background: #d0ee88;
    border-radius: 3px;
}

.yrt-weekly-stats::-webkit-scrollbar-thumb:hover,
.yrt-activity-list::-webkit-scrollbar-thumb:hover {
    background: #16361c;
}

/* Animation for progress bars */
.yrt-progress-fill,
.yrt-week-progress-fill {
    animation: progressFill 1s ease-out;
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: var(--progress-width); }
}

/* Print styles */
@media print {
    .yrt-statistics-container {
        background-color: white;
        box-shadow: none;
    }
    
    .yrt-stat-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .yrt-progress-fill,
    .yrt-week-progress-fill {
        animation: none;
    }
} 