/**
 * Sport Pose Analyzer - Styles
 */

/* Main Container */
.spa-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.spa-header {
    text-align: center;
    margin-bottom: 30px;
}

.spa-header h2 {
    color: #333;
    margin-bottom: 10px;
}

.spa-header p {
    color: #666;
    font-size: 14px;
}

/* Video Container */
.spa-video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.spa-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
}

#spa-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* Hidden, we show canvas instead */
}

#spa-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Controls */
.spa-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.spa-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spa-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.spa-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.spa-btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.spa-btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.spa-btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.spa-btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.spa-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status */
.spa-status {
    text-align: center;
    padding: 10px;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    font-weight: 500;
    color: #495057;
}

/* Feedback Panel */
.spa-feedback-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    padding: 20px;
    color: white;
    margin-bottom: 20px;
}

.spa-score {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.spa-feedback-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spa-feedback-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Info Grid */
.spa-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.spa-info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.spa-info-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
}

.spa-info-card p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Exercise Selector */
.spa-exercise-selector {
    margin-bottom: 20px;
    text-align: center;
}

.spa-exercise-selector label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.spa-exercise-selector select {
    padding: 10px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    min-width: 200px;
}

.spa-exercise-selector select:focus {
    outline: none;
    border-color: #667eea;
}

/* Admin Styles */
.spa-admin-container {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.spa-admin-header {
    border-bottom: 2px solid #667eea;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.spa-admin-header h1 {
    margin: 0;
    color: #333;
}

.spa-settings-form {
    max-width: 600px;
}

.spa-form-group {
    margin-bottom: 20px;
}

.spa-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.spa-form-group input[type="text"],
.spa-form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.spa-form-group input[type="checkbox"] {
    margin-right: 8px;
}

/* History Table */
.spa-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.spa-history-table th,
.spa-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.spa-history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.spa-history-table tr:hover {
    background: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .spa-container {
        padding: 15px;
    }
    
    .spa-controls {
        flex-direction: column;
    }
    
    .spa-btn {
        width: 100%;
        justify-content: center;
    }
    
    .spa-info-grid {
        grid-template-columns: 1fr;
    }
    
    .spa-score {
        font-size: 24px;
    }
}

/* Loading Animation */
.spa-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spa-spin 1s ease-in-out infinite;
}

@keyframes spa-spin {
    to { transform: rotate(360deg); }
}

/* Notifications */
.spa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: spa-slideIn 0.3s ease-out;
}

@keyframes spa-slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.spa-notification.success {
    border-left: 4px solid #28a745;
}

.spa-notification.error {
    border-left: 4px solid #dc3545;
}