/* ============================================
   VIDEO ANALYSIS PAGE STYLES
   ============================================ */

/* Analysis Header */
.analysis-header {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 80px 0 60px;
    overflow: hidden;
    border-bottom: 2px solid rgba(220, 38, 38, 0.3);
}

.analysis-welcome {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.analysis-welcome h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(220, 38, 38, 0.3);
}

.analysis-welcome p {
    font-size: 1.2rem;
    color: #b0b0b0;
    max-width: 600px;
}

.analysis-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 12px;
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #b0b0b0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Video Upload Section */
.video-upload-section {
    padding: 3rem 0 4rem;
    background: #0f0f0f;
    min-height: 600px;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 3rem;
}

.upload-card, .analyses-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 1px solid #404040;
    border-radius: 16px;
    padding: 2rem;
    height: fit-content;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #333;
}

.card-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin: 0;
}

.supported-formats {
    color: #b0b0b0;
    font-size: 0.85rem;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed #404040;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

.drop-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    color: #404040;
    transition: color 0.3s ease;
}

.drop-zone:hover .drop-icon {
    color: #dc2626;
}

.drop-zone h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: #b0b0b0;
    margin: 1rem 0;
}

.browse-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

/* Upload Helper */
.upload-helper {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.helper-content .helper-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.3));
}

.helper-content h5 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.helper-content p {
    color: #b0b0b0;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.helper-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block;
    text-align: left;
}

.helper-content li {
    color: #e0e0e0;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.helper-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #dc2626;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Video Preview */
.video-preview {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.video-preview video {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

.video-info {
    flex: 1;
}

.filename {
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.filesize {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin: 0;
}

/* Analysis Options */
.analysis-options {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.analysis-options h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #404040;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item:hover {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.option-item input[type="radio"] {
    margin-right: 8px;
    accent-color: #dc2626;
}

.option-label {
    color: white;
    font-weight: 500;
}

.additional-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    color: #b0b0b0;
    font-weight: 500;
    font-size: 0.9rem;
}

.input-group input,
.analysis-priority select {
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transition: border-color 0.3s ease;
}

.input-group input:focus,
.analysis-priority select:focus {
    outline: none;
    border-color: #dc2626;
}

.analysis-priority {
    margin-bottom: 2rem;
}

.analysis-priority label {
    display: block;
    color: #b0b0b0;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Camera Angle Section */
.camera-angle-section {
    margin-bottom: 2rem;
}

.camera-angle-section h4 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.camera-angle-section .angle-description {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.angle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.angle-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #404040;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.angle-item:hover {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    transform: translateY(-2px);
}

.angle-item input[type="radio"] {
    display: none;
}

.angle-item input[type="radio"]:checked + .angle-visual {
    color: #dc2626;
}

.angle-item input[type="radio"]:checked + .angle-visual svg {
    color: #dc2626;
}

.angle-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.angle-visual svg {
    width: 32px;
    height: 32px;
    color: #b0b0b0;
    transition: color 0.3s ease;
}

.angle-visual span {
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
}

.angle-item p {
    color: #888;
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.3;
}

.angle-tips {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    margin-top: 1rem;
}

.tip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.angle-tips p {
    color: #bfdbfe;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.angle-tips strong {
    color: #93c5fd;
}

/* Upload Actions */
.upload-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary, .btn-primary {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary {
    background: #2a2a2a;
    color: #b0b0b0;
    border: 1px solid #404040;
}

.btn-secondary:hover {
    background: #3a3a3a;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

.btn-primary.btn-disabled {
    background: linear-gradient(135deg, #666 0%, #555 100%);
    cursor: not-allowed;
    transform: none;
}

.btn-primary.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-primary svg {
    width: 16px;
    height: 16px;
}

/* Upload Progress */
.upload-progress, .analysis-progress {
    text-align: center;
}

.progress-info h4 {
    color: white;
    margin-bottom: 0.5rem;
}

.progress-info p {
    color: #b0b0b0;
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    color: #b0b0b0;
    font-size: 0.9rem;
}

/* Analysis Progress */
.analysis-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.step-icon {
    width: 40px;
    height: 40px;
    background: #2a2a2a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #404040;
}

.step.active .step-icon {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
}

.step-icon svg {
    width: 20px;
    height: 20px;
}

.step-info h5 {
    color: white;
    margin-bottom: 0.25rem;
}

.step-info p {
    color: #b0b0b0;
    margin: 0;
    font-size: 0.9rem;
}

.analysis-timer {
    color: #b0b0b0;
    font-style: italic;
}

/* Recent Analyses */
.view-all-btn {
    background: transparent;
    color: #dc2626;
    border: 1px solid #dc2626;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

.analyses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.analysis-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.analysis-item:hover {
    background: rgba(220, 38, 38, 0.1);
}

.analysis-thumbnail {
    position: relative;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.analysis-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.analysis-score {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
}

.analysis-score.excellent {
    background: #22c55e;
}

.analysis-score.good {
    background: #3b82f6;
}

.analysis-score.average {
    background: #f59e0b;
}

.analysis-score.poor {
    background: #ef4444;
}

.analysis-details {
    flex: 1;
}

.analysis-details h5 {
    color: white;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.analysis-details > p {
    color: #b0b0b0;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.analysis-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.tag.excellent {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.tag.good {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.tag.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.analysis-date {
    color: #666;
    font-size: 0.8rem;
}

.view-analysis-btn {
    background: transparent;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.view-analysis-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

.view-analysis-btn svg {
    width: 16px;
    height: 16px;
}

/* Upload Quota */
.upload-quota {
    border-top: 2px solid #333;
    padding-top: 1.5rem;
}

.quota-info h4 {
    color: white;
    margin-bottom: 1rem;
}

.quota-bar {
    width: 100%;
    height: 8px;
    background: #2a2a2a;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.quota-fill {
    height: 100%;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transition: width 0.3s ease;
}

.quota-info p {
    color: #b0b0b0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.upgrade-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* Features Section */
.features-section {
    padding: 4rem 0;
    background: #1a1a1a;
}

.features-header {
    text-align: center;
    margin-bottom: 3rem;
}

.features-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.features-header p {
    font-size: 1.1rem;
    color: #b0b0b0;
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    border: 1px solid #404040;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: #dc2626;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.2);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-card h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.feature-card p {
    color: #b0b0b0;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .analysis-welcome {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .analysis-welcome h1 {
        font-size: 2.5rem;
    }

    .analysis-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .upload-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .upload-actions {
        flex-direction: column;
    }

    .option-grid {
        grid-template-columns: 1fr;
    }

    .additional-info {
        grid-template-columns: 1fr;
    }

    .angle-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .angle-item {
        padding: 0.75rem;
    }

    .angle-visual svg {
        width: 28px;
        height: 28px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SHAREABLE OVERLAY CLIP (analysis result)
   ============================================ */
.result-overlay { margin: 1.25rem 0; }
.result-overlay h4 { margin: 0 0 .6rem; font-size: 1rem; color: #f4f4f5; }
.result-overlay .overlay-vid {
    width: 100%; max-width: 420px; display: block; border-radius: 14px;
    border: 1px solid #26262c; background: #000; box-shadow: 0 10px 30px -12px rgba(0,0,0,.7);
}
.result-overlay .overlay-actions {
    display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: .8rem;
}
.result-overlay .overlay-hint { color: #a1a1aa; font-size: .82rem; }
.result-overlay .overlay-hint strong { color: #f87171; }
@media (max-width: 480px) {
    .result-overlay .overlay-vid { max-width: 100%; }
    .result-overlay .overlay-actions .btn { width: 100%; text-align: center; }
}

/* ============================================
   ANALYSIS PROGRESS BAR (accurate per-stage)
   ============================================ */
.anp { margin: 0 0 1.4rem; }
.anp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.anp-head #anpStage { color: #f4f4f5; font-weight: 600; font-size: .95rem; }
.anp-head #anpPct { color: #f87171; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; }
.anp-track { height: 10px; background: #1a1a1f; border: 1px solid #2a2a30; border-radius: 999px; overflow: hidden; }
.anp-fill { height: 100%; width: 0%; border-radius: 999px;
    background: linear-gradient(90deg, #b91c1c, #ef4444, #f87171);
    box-shadow: 0 0 12px -2px rgba(239,68,68,.6); transition: width .35s ease; }
/* completed steps in the 3-step row */
.analysis-steps .step.done .step-icon { opacity: .9; }
.analysis-steps .step.done { opacity: .85; }
@media (prefers-reduced-motion: reduce) { .anp-fill { transition: none; } }
