/* Horse Jump Analyzer - Modern CSS Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 0;
    text-align: center;
}

.logo {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.logo i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Main Content */
.main-content {
    padding: 40px 0;
}

/* Section Styles */
.section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

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

.section-header h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.section-header h2 i {
    margin-right: 10px;
    color: #3498db;
}

.section-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Upload Section */
.upload-area {
    border: 3px dashed #3498db;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.upload-area:hover {
    border-color: #2980b9;
    background: linear-gradient(45deg, #e3f2fd, #bbdefb);
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: #27ae60;
    background: linear-gradient(45deg, #e8f5e8, #c8e6c9);
    transform: scale(1.05);
}

.upload-icon {
    font-size: 4rem;
    color: #3498db;
    margin-bottom: 20px;
    display: block;
}

.upload-content h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.upload-link {
    color: #3498db;
    text-decoration: underline;
    cursor: pointer;
}

.upload-info {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 10px;
}

.upload-status {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(45deg, #d4edda, #c3e6cb);
    border: 1px solid #27ae60;
    border-radius: 10px;
    text-align: center;
}

.status-icon {
    color: #27ae60;
    font-size: 1.2rem;
    margin-right: 10px;
}

/* Progress Styles */
.progress-container {
    margin: 30px 0;
}

.progress-bar {
    width: 100%;
    height: 15px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-weight: 600;
}

#progress-percentage {
    color: #3498db;
}

#progress-message {
    color: #7f8c8d;
}

/* Speed Indicator Styles */
#speed-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-align: center;
    margin: 15px auto;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    animation: speedPulse 2s infinite;
    max-width: 600px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#speed-indicator.completed {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    animation: none;
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.4);
}

@keyframes speedPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    }
}

/* Live Preview Styles */
.live-preview-container {
    margin: 30px 0;
}

.live-preview {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
}

.live-preview h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.preview-frame {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

#live-frame {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
}

.preview-placeholder {
    text-align: center;
    color: #7f8c8d;
}

.preview-icon {
    font-size: 3rem;
    color: #bdc3c7;
    margin-bottom: 15px;
    display: block;
}

.frame-info {
    display: flex;
    justify-content: space-between;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #34495e;
    margin-bottom: 20px;
}

.live-jump-controls {
    text-align: center;
}

.jump-instruction {
    color: #27ae60;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.jump-instruction i {
    margin-right: 8px;
}

.jump-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.jump-buttons .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.jump-buttons .btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* Analysis Instructions */
.analysis-instructions {
    margin: 20px 0;
}

.instruction-card {
    background: linear-gradient(45deg, #e8f5e8, #f0f8f0);
    border: 1px solid #27ae60;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.instruction-card h4 {
    color: #27ae60;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.instruction-card h4 i {
    margin-right: 10px;
}

.instruction-card ul {
    list-style: none;
    padding-left: 0;
}

.instruction-card li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.instruction-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.instruction-card strong {
    color: #2c3e50;
}

/* Processing Status */
.processing-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.status-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.status-item i {
    font-size: 1.5rem;
    margin-right: 15px;
    color: #3498db;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: auto;
}

.status-indicator.loading {
    background: #f39c12;
    animation: pulse 1.5s infinite;
}

.status-indicator.completed {
    background: #27ae60;
}

.status-indicator.pending {
    background: #bdc3c7;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Video Styles */
.video-container {
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#processed-video {
    width: 100%;
    height: auto;
    display: block;
}

.video-controls {
    background: linear-gradient(45deg, #2c3e50, #34495e);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.timestamp-display {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
}

.jump-markers {
    display: flex;
    gap: 15px;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.btn-danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #138496);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.2rem;
}

/* Jump Timeline */
.jump-timeline {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.jump-timeline h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.timeline-container {
    margin: 20px 0;
    position: relative;
}

.timeline-track {
    height: 40px;
    background: #ecf0f1;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.jump-marker {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.jump-marker.success {
    background: #27ae60;
}

.jump-marker.failed {
    background: #e74c3c;
}

.jump-marker:hover {
    transform: translateY(-50%) scale(1.5);
    z-index: 10;
}

.jump-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.jump-column h4 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.text-success {
    color: #27ae60;
}

.text-danger {
    color: #e74c3c;
}

.jump-list-items {
    list-style: none;
}

.jump-list-items li {
    background: white;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    border-left: 4px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jump-list-items li.success {
    border-left-color: #27ae60;
}

.jump-list-items li.failed {
    border-left-color: #e74c3c;
}

.jump-list-items li:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.jump-time {
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.jump-actions {
    display: flex;
    gap: 5px;
}

.jump-actions button {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: color 0.3s ease;
}

.jump-actions button:hover {
    color: #2c3e50;
}

/* Analysis Actions */
.analysis-actions {
    text-align: center;
    margin-top: 30px;
}

/* Report Styles */
.report-container {
    margin-top: 20px;
}

.report-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.report-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.analysis-report h2 {
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.report-timestamp {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 30px;
}

.report-section {
    margin-bottom: 40px;
}

.report-section h3 {
    color: #34495e;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.summary-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    white-space: pre-wrap;
}

.ai-analysis {
    background: linear-gradient(45deg, #f8f9ff, #e6f3ff);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #b3d9ff;
    line-height: 1.8;
}

.recommendations ul {
    padding-left: 0;
}

.recommendations li {
    background: #e8f5e8;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
    list-style: none;
    position: relative;
    padding-left: 45px;
}

.recommendations li::before {
    content: '💡';
    position: absolute;
    left: 15px;
    top: 15px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

.notification.success {
    border-left-color: #27ae60;
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification.info {
    border-left-color: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .jump-list {
        grid-template-columns: 1fr;
    }
    
    .video-controls {
        flex-direction: column;
        text-align: center;
    }
    
    .report-actions {
        justify-content: center;
    }
    
    .processing-status {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .jump-markers {
        flex-direction: column;
        width: 100%;
    }
    
    .jump-markers .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Enhanced Report Styles for JSON Format */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-item {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

.assessment, .key-findings, .biomech-analysis, .strengths, .weaknesses {
    margin-bottom: 20px;
}

.assessment h4, .key-findings h4, .biomech-analysis h4, .strengths h4, .weaknesses h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.biomech-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.strengths {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    padding: 15px;
    border-radius: 8px;
    color: white;
}

.strengths h4 {
    color: white;
}

.weaknesses {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    padding: 15px;
    border-radius: 8px;
    color: white;
}

.weaknesses h4 {
    color: white;
}

.severity-indicator {
    margin-top: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
}

.severity-low {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
}

.severity-medium {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.severity-high {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .biomech-analysis {
        grid-template-columns: 1fr;
    }
}