/**
 * Honor Run Tracker CSS Styles
 * Responsive design for the honor run tracking system
 */

/* Base Styles */
.honor-run-tracker {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* Header Styles */
.tracker-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #00308f 0%, #0047ab 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tracker-header h2 {
    margin: 0 0 15px 0;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
}

.tracker-subtitle {
    margin: 0;
    font-size: 18px;
    opacity: 0.9;
    font-weight: 300;
}

/* Overview Section */
.tracker-overview {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.overview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #00308f;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #00308f;
    margin: 0;
}

/* Progress Bar */
.overall-progress-bar {
    height: 25px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #17a2b8 100%);
    transition: width 0.8s ease;
    border-radius: 12px;
    position: relative;
}

.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%); }
}

/* Segments */
.tracker-segments {
    display: grid;
    gap: 25px;
}

.segment-item {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 6px solid #dee2e6;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.segment-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #dee2e6;
    transition: background 0.3s ease;
}

.segment-item.active {
    border-left-color: #28a745;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.2);
    transform: translateY(-2px);
}

.segment-item.active::before {
    background: #28a745;
}

.segment-item.completed {
    border-left-color: #00308f;
}

.segment-item.completed::before {
    background: #00308f;
}

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

.segment-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.segment-status {
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    text-align: center;
}

.segment-status.active {
    background: #d4edda;
    color: #155724;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.segment-status.completed {
    background: #d1ecf1;
    color: #0c5460;
    box-shadow: 0 2px 4px rgba(0, 48, 143, 0.2);
}

.segment-status.pending {
    background: #fff3cd;
    color: #856404;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

/* Progress Bars */
.segment-progress {
    margin-bottom: 20px;
}

.progress-bar {
    height: 15px;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00308f 0%, #0047ab 100%);
    transition: width 0.8s ease;
    border-radius: 8px;
    position: relative;
}

.progress-text {
    font-size: 15px;
    color: #666;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Content */
.honor-message {
    font-style: italic;
    color: #666;
    margin: 20px 0 15px 0;
    line-height: 1.6;
    font-size: 16px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #00308f;
}

.casualties {
    font-size: 16px;
    color: #00308f;
    font-weight: 600;
    margin: 0;
    padding: 10px 0;
}

.segment-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    padding: 5px 0;
}

.detail-label {
    color: #666;
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    color: #333;
}

/* Footer */
.tracker-footer {
    text-align: center;
    margin-top: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.tracker-footer .honor-message {
    font-style: italic;
    color: #666;
    margin: 0 0 15px 0;
    font-size: 18px;
    background: none;
    padding: 0;
    border: none;
}

.last-updated {
    font-size: 14px;
    color: #999;
    margin: 0;
    font-weight: 500;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-style: italic;
    font-size: 16px;
}

.error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    background: #f8d7da;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
}

/* Success/Error Messages */
.honor-run-success,
.honor-run-error {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 300px;
}

.honor-run-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.honor-run-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Garmin Integration Styles */
.garmin-status {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.garmin-status.connected {
    border-color: #28a745;
    background: #f8fff9;
}

.garmin-status.disconnected {
    border-color: #dc3545;
    background: #fff8f8;
}

.garmin-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.garmin-data-item {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.garmin-data-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.garmin-data-value {
    font-size: 18px;
    font-weight: bold;
    color: #00308f;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tracker-header h2 {
        font-size: 24px;
    }
    
    .tracker-subtitle {
        font-size: 16px;
    }
    
    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .segment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .segment-title {
        font-size: 20px;
    }
    
    .segment-item {
        padding: 20px;
    }
    
    .honor-message {
        font-size: 15px;
    }
    
    .garmin-info {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .overview-stats {
        grid-template-columns: 1fr;
    }
    
    .garmin-info {
        grid-template-columns: 1fr;
    }
    
    .tracker-header {
        padding: 20px 15px;
    }
    
    .tracker-overview {
        padding: 20px;
    }
    
    .segment-item {
        padding: 15px;
    }
}

/* Print Styles */
@media print {
    .honor-run-tracker {
        max-width: none;
        margin: 0;
    }
    
    .tracker-header {
        background: #f8f9fa !important;
        color: #333 !important;
        box-shadow: none;
    }
    
    .segment-item {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .honor-run-success,
    .honor-run-error {
        display: none;
    }
}

/* Error and Success Messages */
.honor-run-error,
.honor-run-success {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.honor-run-error {
    background: #dc3545;
}

.honor-run-success {
    background: #28a745;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 20px 0;
}

/* Race Day Status */
.race-day-status {
    background: #e3f2fd;
    color: #1976d2;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
    margin-bottom: 20px;
    font-weight: 500;
    text-align: center;
}

