* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Color Palette Variables */
:root {
    --blue: rgb(90, 111, 239);
    --light-blue: rgb(139, 177, 252);
    --purple: rgb(198, 121, 233);
    --pinkish: rgb(225, 89, 197);
    --orange: rgb(217, 170, 131);
    --green: rgb(155, 218, 130);
    --lighter-gray: rgb(38, 38, 38);
    --darker-gray: rgb(64, 64, 64);
    --dark-gray: rgb(23, 23, 23);
}

html {
    /* Prevent horizontal shifting from scrollbar appearance/disappearance */
    scrollbar-gutter: stable;
    overflow-y: scroll; /* Force scrollbar space to always be reserved */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--dark-gray) 0%, var(--lighter-gray) 100%);
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
    /* Additional scrollbar stability */
    width: 100%;
    margin: 0;
    padding: 0;
    /* Global zoom to make everything smaller */
    zoom: 0.67;
}

/* Counteract zoom for video elements to fix progress bar synchronization */
video {
    zoom: 1.492537; /* 1 / 0.67 = 1.492537 to counteract the body zoom */
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

/* Main Header with 4 elements */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 30px;
    /* Prevent layout shifts during header adjustments */
    transition: width 0.1s ease, min-width 0.1s ease;
    /* Isolate header from layout systems below and ensure consistent width */
    flex-shrink: 0;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
}

/* Reserve space for language switcher to prevent layout shift */
.main-header::after {
    content: '';
    min-width: 80px; /* Same as language-switcher-button min-width */
    height: 40px; /* Approximate height of language switcher */
    flex-shrink: 0;
    opacity: 0; /* Invisible placeholder */
    transition: opacity 0.1s ease;
}

/* Hide the placeholder when language switcher is present */
.main-header:has(.language-switcher)::after,
.main-header.has-language-switcher::after {
    display: none;
}


/* 1. Gymnast Photo Container with Effects */
.gymnast-photo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 40px;
}

.photo-illumination {
    position: absolute;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(240, 240, 240, 0.6) 0%, rgba(220, 220, 220, 0.4) 30%, rgba(200, 200, 200, 0.2) 50%, transparent 80%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(12px);
}

.photo-gradient-hoop {
    position: absolute;
    width: 96px;
    height: 96px;
    background: conic-gradient(
        from 0deg,
        var(--blue),
        var(--light-blue),
        var(--purple),
        var(--pinkish),
        var(--orange),
        var(--blue)
    );
    border-radius: 50%;
    z-index: 2;
    padding: 3px;
}

.photo-gradient-hoop::before {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--dark-gray);
    border-radius: 50%;
}

.gymnast-photo {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 3;
    background: var(--darker-gray);
}

.gymnast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 2. Gymnast Info Column */
.gymnast-info-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    flex: 1;
}

.gymnast-name {
    font-size: 2.2rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.gymnast-details {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    background: var(--darker-gray);
}

.academy-icon,
.lazy-academy-logo {
    width: 40px;
    height: 30px;
    object-fit: contain;
    /* No background - let transparency show through */
}

.country-name,
.academy-name {
    color: #cccccc;
    font-weight: 400;
}



/* 3. Object Info Row */
.object-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-right: 40px;
}

.object-name {
    font-size: 2.2rem;
    font-weight: 500;
    color: #ffffff;
    line-height: 1;
}

.object-icon {
    width: 4.4rem;
    height: 4.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.object-icon .apparatus-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

/* 4. Championship Info Column */
.championship-info-column {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    text-align: right;
}

.championship-name {
    font-size: 2.2rem;
    font-weight: 600;
    color: #999999;
    transition: all 0.3s ease;
}

.championship-name.clickable {
    cursor: pointer;
    position: relative;
}

.championship-name.clickable::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.championship-name.clickable:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

.championship-name.clickable:hover::after {
    transform: scaleX(1);
}

.gymnast-level {
    font-size: 1.6rem;
    font-weight: 400;
    color: #999999;
}

/* Main Layout - Now 2-column */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    padding: 30px;
    flex: 1;
    align-items: start;
}

/* Video Section */
.video-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.video-stack {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

.video-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.overlay-video {
    pointer-events: none;
    mix-blend-mode: normal;
}

/* Video layer z-index stacking order */
#main-video, #contrastive-video {
    z-index: 1;
}

#performer-3d-skeletons-video {
    z-index: 2;
}

#contrastive-video {
    z-index: 3;
}

#performer-contacts-video {
    z-index: 4;
}

#performer-2d-skeletons-video {
    z-index: 5;
}


/* Split-screen layout for 3D skeleton mode */
.video-stack {
    transition: all 0.5s ease;
}

.video-stack.split-screen {
    display: flex;
    flex-direction: row;
    gap: 2px; /* Small gap between panels */
}

.video-stack.split-screen .video-panel-left {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    border-radius: 8px 0 0 8px;
}

.video-stack.split-screen .video-panel-right {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    border-radius: 0 8px 8px 0;
}

/* Videos in split-screen left panel - positioned to show middle portion */
.video-stack.split-screen .video-panel-left .video-layer {
    position: absolute;
    top: 0;
    left: -25%; /* Shift left to show middle 50% portion */
    width: 150%; /* Scale up to maintain aspect ratio */
    height: 100%;
    object-fit: cover;
}

/* 3D skeleton video in right panel */
.video-stack.split-screen .video-panel-right .video-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Preserve aspect ratio for 3D visualization */
}

/* Normal mode - all videos full width */
.video-stack:not(.split-screen) .video-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}



/* Analysis Controls */
.analysis-controls {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
}

.control-group h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.analysis-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.analysis-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.analysis-toggle input[type="checkbox"] {
    display: none;
}

/* Custom Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--lighter-gray);
    border: 1px solid var(--darker-gray);
    border-radius: 24px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    /* Fix alignment by using transform-based centering for the dot */
    display: flex;
    align-items: center;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--darker-gray);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%);
}

/* ON state styling */
.analysis-toggle input[type="checkbox"]:checked + .toggle-switch {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
    border-color: var(--purple);
}

.analysis-toggle input[type="checkbox"]:checked + .toggle-switch::before {
    transform: translateX(20px) translateY(-50%);
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle-label {
    color: #cccccc;
    font-weight: 400;
    transition: all 0.3s ease;
}

/* Bold text when toggle is selected */
.analysis-toggle input[type="checkbox"]:checked ~ .toggle-label {
    font-weight: 700;
    color: #ffffff;
}

/* Disabled analysis toggle styling */
.analysis-toggle.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
}

.analysis-toggle.disabled:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: none;
}

.analysis-toggle.disabled .toggle-switch {
    opacity: 0.5;
    cursor: not-allowed;
}

.analysis-toggle.disabled .toggle-label {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Compact Toggle for Video Controls (used in detailed views) */
.analysis-toggle-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--purple);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    margin-left: 8px;
}

.analysis-toggle-compact:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--blue);
    transform: translateY(-1px);
}

.analysis-toggle-compact input[type="checkbox"] {
    display: none;
}

.analysis-toggle-compact .toggle-switch {
    position: relative;
    width: 32px;
    height: 18px;
    background: var(--lighter-gray);
    border: 1px solid var(--darker-gray);
    border-radius: 12px;
    transition: all 0.3s ease;
    /* Fix alignment by using transform-based centering for the dot */
    display: flex;
    align-items: center;
}

.analysis-toggle-compact .toggle-switch::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--darker-gray);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translateY(-50%);
}

.analysis-toggle-compact input[type="checkbox"]:checked + .toggle-switch {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
    border-color: var(--purple);
}

.analysis-toggle-compact input[type="checkbox"]:checked + .toggle-switch::before {
    transform: translateX(14px) translateY(-50%);
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.analysis-toggle-compact .toggle-label {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analysis-toggle-compact input[type="checkbox"]:checked ~ .toggle-label {
    color: var(--pinkish);
}

/* Timeline Section */
.timeline-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

.timeline-container {
    position: relative;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1), box-shadow 0.4s ease;
}

.timeline-container:active {
    cursor: grabbing;
}

.timeline {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    transform: translateY(0);
}

.timeline.slide-out {
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.6, 1), opacity 0.3s ease;
}

.timeline.slide-in {
    transform: translateY(100%);
    opacity: 0;
}

/* Stack-like depth effect during transition */
.timeline-container.transitioning {
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.timeline-container.transitioning::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: -3px;
    bottom: -3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: -1;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.timeline-container.transitioning::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: -6px;
    bottom: -6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    z-index: -2;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.timeline-container:not(.transitioning)::before,
.timeline-container:not(.transitioning)::after {
    opacity: 0;
}

.timeline-segment {
    position: absolute;
    height: 50px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    z-index: 5;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
}

/* Group Color Classes - Normal State */
.timeline-segment.group-dance-steps {
    background: linear-gradient(135deg, var(--blue), var(--light-blue));
}

.timeline-segment.group-rotation {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
}

.timeline-segment.group-jump {
    background: linear-gradient(135deg, var(--pinkish), var(--orange));
}

.timeline-segment.group-balance {
    background: linear-gradient(135deg, var(--orange), var(--light-blue));
}

.timeline-segment.group-dynamic {
    background: linear-gradient(135deg, var(--light-blue), var(--purple));
}

.timeline-segment.group-vertical {
    background: linear-gradient(135deg, var(--green), var(--blue));
}

.timeline-segment.group-technical,
.timeline-segment.group-unknown {
    background: linear-gradient(135deg, #ffffff, #cccccc);
    color: #333333;
}

/* DA Action Group Color Classes - Normal State */
.timeline-segment.group-dance-connections {
    background: linear-gradient(135deg, var(--blue), var(--green));
}

.timeline-segment.group-mixed-movements {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
}

.timeline-segment.group-apparatus-work {
    background: linear-gradient(135deg, var(--orange), var(--light-blue));
}

.timeline-segment.group-acrobatic {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.timeline-segment.group-flexibility {
    background: linear-gradient(135deg, var(--pinkish), #f39c12);
}

.timeline-segment.group-jumps {
    background: linear-gradient(135deg, var(--light-blue), var(--blue));
}

.timeline-segment.group-turns {
    background: linear-gradient(135deg, var(--green), #27ae60);
}

.timeline-segment.group-dynamic {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.timeline-segment.group-combined {
    background: linear-gradient(135deg, var(--purple), var(--blue), var(--green));
}

/* Muted State - for past segments */
.timeline-segment.muted.group-dance-steps {
    background: linear-gradient(135deg, rgba(90, 111, 239, 0.4), rgba(139, 177, 252, 0.4));
}

.timeline-segment.muted.group-rotation {
    background: linear-gradient(135deg, rgba(198, 121, 233, 0.4), rgba(225, 89, 197, 0.4));
}

.timeline-segment.muted.group-jump {
    background: linear-gradient(135deg, rgba(225, 89, 197, 0.4), rgba(217, 170, 131, 0.4));
}

.timeline-segment.muted.group-balance {
    background: linear-gradient(135deg, rgba(217, 170, 131, 0.4), rgba(139, 177, 252, 0.4));
}

.timeline-segment.muted.group-dynamic {
    background: linear-gradient(135deg, rgba(139, 177, 252, 0.4), rgba(198, 121, 233, 0.4));
}

.timeline-segment.muted.group-vertical {
    background: linear-gradient(135deg, rgba(155, 218, 130, 0.4), rgba(90, 111, 239, 0.4));
}

.timeline-segment.muted.group-technical,
.timeline-segment.muted.group-unknown {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(204, 204, 204, 0.3));
    color: rgba(51, 51, 51, 0.6);
}

/* DA Action Muted State - for past segments */
.timeline-segment.muted.group-dance-connections {
    background: linear-gradient(135deg, rgba(90, 111, 239, 0.4), rgba(155, 218, 130, 0.4));
}

.timeline-segment.muted.group-mixed-movements {
    background: linear-gradient(135deg, rgba(198, 121, 233, 0.4), rgba(225, 89, 197, 0.4));
}

.timeline-segment.muted.group-apparatus-work {
    background: linear-gradient(135deg, rgba(217, 170, 131, 0.4), rgba(139, 177, 252, 0.4));
}

.timeline-segment.muted.group-acrobatic {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.4), rgba(192, 57, 43, 0.4));
}

.timeline-segment.muted.group-flexibility {
    background: linear-gradient(135deg, rgba(225, 89, 197, 0.4), rgba(243, 156, 18, 0.4));
}

.timeline-segment.muted.group-jumps {
    background: linear-gradient(135deg, rgba(139, 177, 252, 0.4), rgba(90, 111, 239, 0.4));
}

.timeline-segment.muted.group-turns {
    background: linear-gradient(135deg, rgba(155, 218, 130, 0.4), rgba(39, 174, 96, 0.4));
}

.timeline-segment.muted.group-dynamic {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.4), rgba(243, 156, 18, 0.4));
}

.timeline-segment.muted.group-combined {
    background: linear-gradient(135deg, rgba(198, 121, 233, 0.4), rgba(90, 111, 239, 0.4), rgba(155, 218, 130, 0.4));
}

/* Timeline Mask - covers everything to the right of cursor */
.timeline-mask {
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(23, 23, 23, 0) 0%,
        rgba(23, 23, 23, 0.8) 1%,
        rgba(23, 23, 23, 1) 5%,
        rgba(23, 23, 23, 1) 100%
    );
    z-index: 8;
    pointer-events: none;
    transition: left 0.1s ease-out, width 0.1s ease-out;
    border-radius: 0 8px 8px 0;
}


/* Timeline Crosses - for reductions */
.timeline-cross {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 7; /* Below timeline mask (z-index 8) so they get hidden */
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.timeline-cross:hover {
    transform: translateY(-50%) scale(1.1);
}

.timeline-cross.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

@keyframes spring {
    0% { transform: translateY(-50%) scale(1); }
    20% { transform: translateY(-50%) scale(1.4) rotate(5deg); }
    40% { transform: translateY(-50%) scale(0.9) rotate(-3deg); }
    60% { transform: translateY(-50%) scale(1.2) rotate(2deg); }
    80% { transform: translateY(-50%) scale(0.95) rotate(-1deg); }
    100% { transform: translateY(-50%) scale(1) rotate(0deg); }
}

.timeline-cross.spring-animation {
    animation: spring 0.6s ease-out;
}

.cross-image {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
    margin-left: -10px; /* Center the image horizontally */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.timeline-cross:hover .cross-image {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.timeline-segment:hover {
    transform: translateY(-50%) translateY(-2px);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Active state - enhanced saturation and glow */
.timeline-segment.active {
    transform: translateY(-50%) translateY(-4px);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
    filter: brightness(1.2) saturate(1.3);
}

.timeline-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffffff;
    border-radius: 2px;
    left: 0;
    transition: left 0.1s;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    z-index: 10;
}


.timeline-cursor::before,
.timeline-cursor::after {
    content: '';
    position: absolute;
    left: -4px;
    width: 11px;
    height: 11px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

.timeline-cursor::before {
    top: -6px;
}

.timeline-cursor::after {
    bottom: -6px;
}

/* Timeline View Switch Button */
.timeline-view-switch {
    position: absolute;
    top: 50%;
    right: 6px; /* Position in padding space, not overlapping timeline-container */
    transform: translateY(-50%); /* Vertically center */
    width: 12px;
    height: 80px; /* Match timeline-container height */
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10; /* Above timeline mask */
    padding: 0;
}

.timeline-view-switch:hover {
    transform: translateY(-50%) scale(1.1);
}

.timeline-view-switch:active {
    transform: translateY(-50%) scale(0.9);
}

.triple-dots {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    height: 100%;
    justify-content: center;
}

.triple-dots .dot {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.timeline-view-switch:hover .dot {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

/* Analysis Panel */
.analysis-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: sticky;
    top: 0;
    align-self: start; /* Don't stretch vertically */
}

/* Combined Score - Updated layout with sub-scores */
.combined-score {
    background: linear-gradient(135deg, var(--blue), var(--pinkish), var(--orange));
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(90, 111, 239, 0.3);
    min-height: 120px; /* Increased to accommodate 2x3 grid */
    max-height: 180px; /* Increased max height for 2 rows */
    flex-shrink: 0; /* Don't shrink this element */
}

.combined-score h3 {
    font-size: 1.6rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.2; /* Prevent excessive height */
}

.combined-score h3 .total-score {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
}

.sub-scores-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0; /* Prevent shrinking */
}

.sub-score-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

/* Legacy support for old .sub-scores class */
.sub-scores {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-shrink: 0; /* Prevent shrinking */
}

.sub-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.sub-score-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
    line-height: 1.2;
}

.sub-score-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

/* Disabled sub-score styling (performance page) */
.sub-score.score-disabled {
    opacity: 0.4;
}

.sub-score.score-disabled .sub-score-label,
.sub-score.score-disabled .sub-score-value {
    color: #666;
}

/* Analysis Comments - Keep gray background */
.analysis-comments {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Height will be set dynamically by JavaScript */
    /* Start with a reasonable height before JS calculates exact height */
    height: 400px;
}

/* Floating Audio Toggle */
.audio-toggle-floating {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.audio-toggle-floating:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.audio-toggle-floating input[type="checkbox"] {
    display: none;
}

.audio-toggle-floating .toggle-switch {
    position: relative;
    width: 28px;
    height: 16px;
    background: var(--lighter-gray);
    border: 1px solid var(--darker-gray);
    border-radius: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    /* Fix alignment by using transform-based centering for the dot */
    display: flex;
    align-items: center;
}

.audio-toggle-floating .toggle-switch::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 1px;
    width: 12px;
    height: 12px;
    background: var(--darker-gray);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%);
}

.audio-toggle-floating input[type="checkbox"]:checked + .toggle-switch {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
    border-color: var(--purple);
}

.audio-toggle-floating input[type="checkbox"]:checked + .toggle-switch::before {
    transform: translateX(12px) translateY(-50%);
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.audio-toggle-floating .toggle-label {
    color: #cccccc;
    font-size: 1.0rem;
    transition: all 0.3s ease;
    min-width: 16px;
    text-align: center;
}

.audio-toggle-floating input[type="checkbox"]:checked ~ .toggle-label {
    color: #ffffff;
    transform: scale(1.1);
}

.comments-chat {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    padding: 10px 0;
    scroll-behavior: smooth;
    min-height: 0;
    gap: 12px;
}

/* Individual comment items with improved positioning and transparency */
.comment-item {
    position: relative;
    padding: 16px 24px 16px 32px;
    margin-right: 8px;
    border-radius: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    overflow: hidden;
}

/* Bottom layer - full width gradient background */
.comment-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--blue), var(--pinkish), var(--orange));
    border-radius: 12px;
    z-index: 1;
}

/* Top layer - gray overlay with smooth transparency at 45 degrees */
.comment-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 3%;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg, 
        var(--lighter-gray) 0%,
        var(--lighter-gray) 50%,
        rgba(38, 38, 38, 0.9) 60%,
        rgba(38, 38, 38, 0.7) 75%,
        rgba(38, 38, 38, 0.4) 90%,
        rgba(38, 38, 38, 0.1) 100%
    );
    border-radius: 12px;
    z-index: 2;
}

/* Detailed view comments - slimmer gradient area */
.detailed-view .comment-item::after {
    left: 1%;
}

.comment-item:hover::after {
    background: linear-gradient(
        45deg, 
        rgba(38, 38, 38, 0.98) 0%,
        rgba(38, 38, 38, 0.98) 50%,
        rgba(38, 38, 38, 0.9) 60%,
        rgba(38, 38, 38, 0.75) 75%,
        rgba(38, 38, 38, 0.5) 90%,
        rgba(38, 38, 38, 0.2) 100%
    );
}

/* Detailed view comments hover - slimmer gradient area */
.detailed-view .comment-item:hover::after {
    left: 1%;
}

.comment-item:hover {
    transform: translateX(4px);
}

/* Content positioning - moved to the right for better readability */
.comment-timestamp,
.comment-text {
    position: relative;
    z-index: 3;
    margin-left: 8px;
}

/* Most recent comment (first in reverse order) */
.comment-item:first-child .comment-text {
    color: #ffffff;
}

.comment-item:first-child .comment-timestamp {
    color: var(--light-blue);
}

/* Older comments - grayer */
.comment-item:not(:first-child) .comment-text {
    color: #999999;
}

.comment-item:not(:first-child) .comment-timestamp {
    color: #666666;
}

.comment-timestamp {
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Scrollbar Styling */
.comments-chat::-webkit-scrollbar {
    width: 8px;
}

.comments-chat::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.comments-chat::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.comments-chat::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Logo Styling - Now sits below main layout */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 30px;
    margin-top: 20px;
    gap: 10px;
}

.sberai-logo {
    max-width: 150px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.sberai-logo:hover {
    opacity: 1;
}

/* DETAILED VIEW STYLES */

/* Detailed Layout - Single column with full width */
.detailed-layout {
    display: flex;
    flex-direction: column;
    padding: 30px;
    gap: 30px;
    flex: 1;
}

.action-details-section {
    flex: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.view-toggle-button {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-toggle-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(90, 111, 239, 0.3);
}

/* Multiple button layout in view toggle */
.view-toggle {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.view-toggle .view-toggle-button {
    flex-shrink: 0;
}

/* Action Details List */
.action-details-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.action-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-detail-row::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 1;
}

/* Group color styling for action rows */
.action-detail-row.group-dance-steps::before {
    background: linear-gradient(135deg, var(--blue), var(--light-blue));
}

.action-detail-row.group-rotation::before {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
}

.action-detail-row.group-jump::before {
    background: linear-gradient(135deg, var(--pinkish), var(--orange));
}

.action-detail-row.group-balance::before {
    background: linear-gradient(135deg, var(--orange), var(--light-blue));
}

.action-detail-row.group-dynamic::before {
    background: linear-gradient(135deg, var(--light-blue), var(--purple));
}

.action-detail-row.group-vertical::before {
    background: linear-gradient(135deg, var(--green), var(--blue));
}

.action-detail-row.group-technical::before,
.action-detail-row.group-unknown::before {
    background: linear-gradient(135deg, #ffffff, #cccccc);
}

/* =============================================================================
   DETAILED VIEW COLOR CODING FOR TIME ELEMENTS
   ============================================================================= */


/* Action group container colors - unified boxy style */
.action-detail-row.group-dance-steps .action-group {
    background: linear-gradient(135deg, var(--blue), var(--light-blue));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-rotation .action-group {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-jump .action-group {
    background: linear-gradient(135deg, var(--pinkish), var(--orange));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-balance .action-group {
    background: linear-gradient(135deg, var(--orange), var(--light-blue));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-dynamic .action-group {
    background: linear-gradient(135deg, var(--light-blue), var(--purple));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-vertical .action-group {
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-technical .action-group,
.action-detail-row.group-unknown .action-group {
    background: linear-gradient(135deg, #ffffff, #cccccc);
    color: #333333;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Comment timestamp colors */
.action-detail-row.group-dance-steps .comment-timestamp {
    color: var(--blue);
    font-weight: 600;
}

.action-detail-row.group-rotation .comment-timestamp {
    color: var(--purple);
    font-weight: 600;
}

.action-detail-row.group-jump .comment-timestamp {
    color: var(--pinkish);
    font-weight: 600;
}

.action-detail-row.group-balance .comment-timestamp {
    color: var(--orange);
    font-weight: 600;
}

.action-detail-row.group-dynamic .comment-timestamp {
    color: var(--light-blue);
    font-weight: 600;
}

.action-detail-row.group-vertical .comment-timestamp {
    color: var(--green);
    font-weight: 600;
}

.action-detail-row.group-technical .comment-timestamp,
.action-detail-row.group-unknown .comment-timestamp {
    color: #666666;
    font-weight: 600;
}

/* Reduction timestamp colors */
.action-detail-row.group-dance-steps .reduction-timestamp {
    color: var(--blue);
    font-weight: 600;
}

.action-detail-row.group-rotation .reduction-timestamp {
    color: var(--purple);
    font-weight: 600;
}

.action-detail-row.group-jump .reduction-timestamp {
    color: var(--pinkish);
    font-weight: 600;
}

.action-detail-row.group-balance .reduction-timestamp {
    color: var(--orange);
    font-weight: 600;
}

.action-detail-row.group-dynamic .reduction-timestamp {
    color: var(--light-blue);
    font-weight: 600;
}

.action-detail-row.group-vertical .reduction-timestamp {
    color: var(--green);
    font-weight: 600;
}

.action-detail-row.group-technical .reduction-timestamp,
.action-detail-row.group-unknown .reduction-timestamp {
    color: #666666;
    font-weight: 600;
}

/* Rewind button colors */
.action-detail-row.group-dance-steps .rewind-button {
    background: linear-gradient(135deg, var(--blue), var(--light-blue));
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.action-detail-row.group-dance-steps .rewind-button:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 4px 15px rgba(90, 111, 239, 0.4);
}

.action-detail-row.group-rotation .rewind-button {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.action-detail-row.group-rotation .rewind-button:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 4px 15px rgba(198, 121, 233, 0.4);
}

.action-detail-row.group-jump .rewind-button {
    background: linear-gradient(135deg, var(--pinkish), var(--orange));
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.action-detail-row.group-jump .rewind-button:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 4px 15px rgba(225, 89, 197, 0.4);
}

.action-detail-row.group-balance .rewind-button {
    background: linear-gradient(135deg, var(--orange), var(--light-blue));
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.action-detail-row.group-balance .rewind-button:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 4px 15px rgba(217, 170, 131, 0.4);
}

.action-detail-row.group-dynamic .rewind-button {
    background: linear-gradient(135deg, var(--light-blue), var(--purple));
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.action-detail-row.group-dynamic .rewind-button:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 4px 15px rgba(139, 177, 252, 0.4);
}

.action-detail-row.group-vertical .rewind-button {
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: white;
    border: none;
    transition: all 0.2s ease;
}

.action-detail-row.group-vertical .rewind-button:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 4px 15px rgba(155, 218, 130, 0.4);
}

.action-detail-row.group-technical .rewind-button,
.action-detail-row.group-unknown .rewind-button {
    background: linear-gradient(135deg, #ffffff, #cccccc);
    color: #333333;
    border: none;
    transition: all 0.2s ease;
}

.action-detail-row.group-technical .rewind-button:hover,
.action-detail-row.group-unknown .rewind-button:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 4px 15px rgba(204, 204, 204, 0.4);
}

/* =============================================================================
   DA DETAILED VIEW COLOR CODING
   ============================================================================= */

/* DA Action row border colors */
.action-detail-row.group-dance-connections::before {
    background: linear-gradient(135deg, var(--blue), var(--green));
}

.action-detail-row.group-mixed-movements::before {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
}

.action-detail-row.group-apparatus-work::before {
    background: linear-gradient(135deg, var(--orange), var(--light-blue));
}

.action-detail-row.group-acrobatic::before {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.action-detail-row.group-flexibility::before {
    background: linear-gradient(135deg, var(--pinkish), #f39c12);
}

.action-detail-row.group-jumps::before {
    background: linear-gradient(135deg, var(--light-blue), var(--blue));
}

.action-detail-row.group-turns::before {
    background: linear-gradient(135deg, var(--green), #27ae60);
}

.action-detail-row.group-dynamic::before {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.action-detail-row.group-combined::before {
    background: linear-gradient(135deg, var(--purple), var(--blue), var(--green));
}



/* DA Action group container colors - unified boxy style */
.action-detail-row.group-dance-connections .action-group {
    background: linear-gradient(135deg, var(--blue), var(--green));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.action-detail-row.group-mixed-movements .action-group {
    background: linear-gradient(135deg, var(--purple), var(--pinkish));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.action-detail-row.group-apparatus-work .action-group {
    background: linear-gradient(135deg, var(--orange), var(--light-blue));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.action-detail-row.group-acrobatic .action-group {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.action-detail-row.group-flexibility .action-group {
    background: linear-gradient(135deg, var(--pinkish), #f39c12);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.action-detail-row.group-jumps .action-group {
    background: linear-gradient(135deg, var(--light-blue), var(--blue));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.action-detail-row.group-turns .action-group {
    background: linear-gradient(135deg, var(--green), #27ae60);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.action-detail-row.group-dynamic .action-group {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

.action-detail-row.group-combined .action-group {
    background: linear-gradient(135deg, var(--purple), var(--blue), var(--green));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* DA Accepted/Not accepted indicator styles - match action-group style */
.action-accepted-indicator {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-not-accepted-indicator {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* =============================================================================
   A DETAILED VIEW LAYOUT & STYLING
   ============================================================================= */

/* Make A detailed layout constrained by video height */
.a-detailed-layout .action-detail-row {
    align-items: start;
}

/* Remove any unnecessary padding/margin from video section in A view */
.a-detailed-layout .action-video-section {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Video container determines the row height */
.a-detailed-layout .action-video-container {
    height: auto;
    max-height: 50vh; /* Video drives the height, constrained to half viewport */
}

/* Make action text section a flex container for A detailed view, constrained by video height */
.a-detailed-layout .action-text-section {
    display: flex;
    flex-direction: column;
    align-self: start;
    overflow: hidden;
}

.a-detailed-layout .action-metadata {
    flex-shrink: 0;
    margin-bottom: 0;
}

.a-detailed-layout .action-header {
    flex-shrink: 0;
    margin-bottom: 0;
}

/* Stills Carousel - integrate with existing detailed view layout */
.a-stills-carousel {
    margin-top: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden; /* Prevent overflow */
}

.stills-container {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 4px 0 0 0; /* Add top padding for hover animation */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    flex: 1;
    align-items: stretch;
    min-height: 0; /* Allow shrinking */
}

.stills-container::-webkit-scrollbar {
    height: 4px;
}

.stills-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.stills-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.no-stills {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    flex: 1;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.still-thumbnail {
    flex: 0 0 auto;
    height: 100%; /* Use all available height */
    aspect-ratio: 4/3; /* Maintain proper thumbnail proportions */
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.still-thumbnail:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
}

.still-thumbnail.active {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(90, 111, 239, 0.3);
}

/* Serial Index Badge */
.highlight-serial-index {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, rgba(90, 111, 239, 0.95), rgba(198, 121, 233, 0.95));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    min-width: 20px;
    text-align: center;
    line-height: 1.2;
    pointer-events: none;
}

.still-thumbnail:hover .highlight-serial-index {
    background: linear-gradient(135deg, rgba(90, 111, 239, 1), rgba(198, 121, 233, 1));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.still-frame {
    border-radius: 6px;
    margin-bottom: 0.3rem;
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.still-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.still-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    text-align: center;
    gap: 8px;
}

.still-image-placeholder .placeholder-icon {
    font-size: 20px;
    opacity: 0.4;
    filter: grayscale(100%);
}

.still-image-placeholder .placeholder-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.2;
}

.still-time {
    color: #ccc;
    font-size: 0.65rem;
    text-align: center;
    font-weight: 500;
    flex-shrink: 0;
    padding: 0.25rem 0;
    margin-top: auto;
}

/* A Action Border Colors */
.action-detail-row.group-musical-interpretation::before {
    background: linear-gradient(135deg, var(--purple), var(--blue));
}

.action-detail-row.group-space-utilization::before {
    background: linear-gradient(135deg, var(--green), var(--blue));
}

.action-detail-row.group-choreographic-creativity::before {
    background: linear-gradient(135deg, var(--orange), var(--pinkish));
}

.action-detail-row.group-artistic-expression::before {
    background: linear-gradient(135deg, var(--pinkish), #e74c3c);
}

.action-detail-row.group-rhythmic-precision::before {
    background: linear-gradient(135deg, var(--blue), var(--purple));
}

.action-detail-row.group-body-lines::before {
    background: linear-gradient(135deg, var(--green), #16a085);
}

.action-detail-row.group-compositional-integrity::before {
    background: linear-gradient(135deg, var(--orange), #f1c40f);
}

.action-detail-row.group-program-conclusion::before {
    background: linear-gradient(135deg, var(--purple), var(--blue), var(--green));
}

/* A Action Group Colors - unified boxy style */
.action-detail-row.group-musical-interpretation .action-group {
    background: linear-gradient(135deg, var(--purple), var(--blue));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-space-utilization .action-group {
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-choreographic-creativity .action-group {
    background: linear-gradient(135deg, var(--orange), var(--pinkish));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-artistic-expression .action-group {
    background: linear-gradient(135deg, var(--pinkish), #e74c3c);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-rhythmic-precision .action-group {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-body-lines .action-group {
    background: linear-gradient(135deg, var(--green), #16a085);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-compositional-integrity .action-group {
    background: linear-gradient(135deg, var(--orange), #f1c40f);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.action-detail-row.group-program-conclusion .action-group {
    background: linear-gradient(135deg, var(--purple), var(--blue), var(--green));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Deductions Group Colors - unified red style for all deduction types */
.action-detail-row.group-deductions-technical .action-group,
.action-detail-row.group-deductions-compositional .action-group,
.action-detail-row.group-deductions-artistic .action-group {
    background: rgba(200, 0, 0, 0.4);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Responsive adjustments for stills */
@media (max-width: 768px) {
    .stills-container {
        gap: 0.5rem;
    }
}

.action-detail-row:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(255, 255, 255, 0.1),
        0 15px 60px rgba(90, 111, 239, 0.3),
        0 20px 80px rgba(198, 121, 233, 0.2),
        0 25px 100px rgba(225, 89, 197, 0.15);
}

/* Video Section */
.action-video-section {
    position: relative;
}

.action-video-container {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    position: relative;
}

.action-video-container .video-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Split-screen layout for detailed view (always enabled) */
.action-video-container .video-stack.split-screen {
    display: flex;
    flex-direction: row;
    gap: 2px; /* Small gap between panels */
}

.action-video-container .video-stack.split-screen .video-panel-left {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    border-radius: 8px 0 0 8px;
}

.action-video-container .video-stack.split-screen .video-panel-right {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
    border-radius: 0 8px 8px 0;
}

/* Videos in split-screen left panel - positioned to show middle portion */
.action-video-container .video-stack.split-screen .video-panel-left .video-layer {
    position: absolute;
    top: 0;
    left: -25%; /* Shift left to show middle 50% portion */
    width: 150%; /* Scale up to maintain aspect ratio */
    height: 100%;
    object-fit: cover;
}

/* 3D skeleton video in right panel */
.action-video-container .video-stack.split-screen .video-panel-right .video-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Preserve aspect ratio for 3D visualization */
}

/* Fallback for non-split screen mode */
.action-video-container .video-stack:not(.split-screen) .video-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Video layer stacking for detailed view */
.action-video-container .main-video {
    z-index: 1;
}

.action-video-container .raw-video {
    z-index: 2;
    mix-blend-mode: multiply;
    opacity: 0.7;
}

.action-video-container .contrastive-video {
    z-index: 3;
}

.action-video-container .contacts-video {
    z-index: 4;
}

.action-video-container .body-viz-video {
    z-index: 5;
}

.action-video-container .skeleton-3d-video {
    z-index: 6;
}


.duration {
    font-size: 0.8rem;
    color: #cccccc;
}

.video-controls-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 11;
}

.rewind-button {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--blue);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 0;
}

/* Custom restart arrow using CSS shapes */
.rewind-button::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--light-blue);
    border-radius: 50%;
    border-top-color: transparent;
    border-right-color: transparent;
    transform: rotate(-10deg);
    transition: border-color 0.3s ease;
}

.rewind-button::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 7px;
    border-color: transparent transparent transparent var(--light-blue);
    top: 11px;
    right: 13px;
    transform: rotate(25deg);
    transition: border-left-color 0.3s ease;
}

.rewind-button:hover {
    background: rgba(90, 111, 239, 0.2);
    border-color: var(--light-blue);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(90, 111, 239, 0.4);
}

.rewind-button:hover::before {
    border-color: #ffffff;
    border-top-color: transparent;
    border-right-color: transparent;
}

.rewind-button:hover::after {
    border-left-color: #ffffff;
}

.rewind-button:active {
    transform: scale(0.95);
}

.rewind-button.rewinding {
    background: var(--blue);
    transform: scale(0.9) rotate(360deg);
}

.rewind-button.rewinding::before {
    border-color: #ffffff;
    border-top-color: transparent;
    border-right-color: transparent;
}

.rewind-button.rewinding::after {
    border-left-color: #ffffff;
}

/* Text Section */
.action-text-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.action-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.action-group-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.action-group {
    font-size: 1rem;
    font-weight: 500;
    color: var(--light-blue);
    background: rgba(139, 177, 252, 0.1);
    border: 1px solid rgba(139, 177, 252, 0.3);
    border-radius: 6px;
    padding: 4px 12px;
    display: inline-block;
}

.action-valuable-indicator {
    font-size: 0.85rem;
    font-weight: 500;
    color: #888888; /* Gray color */
    display: inline-block;
    font-style: normal;
}

/* Metadata Section */
.action-metadata h4,
.action-comments h4,
.action-reductions h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.metadata-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Cross-references section - separate from regular metadata */
.cross-references-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cross-references-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.metadata-item {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.metadata-key {
    font-weight: 500;
    color: #cccccc;
    min-width: 120px;
}

.metadata-value {
    color: #ffffff;
    font-weight: 400;
    flex: 1;
}

/* Cross-reference metadata items */
.cross-reference-item {
    background: linear-gradient(135deg, #b8c6db 0%, #f5f7fa 100%) !important;
    border: 1px solid #c0c8d4 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* Special styling for E deductions cross-reference */
.cross-reference-item.e-deductions-ref {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%) !important;
    border: 1px solid #d8b4fe !important;
}

.cross-reference-item.e-deductions-ref:hover:not(.disabled) {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%) !important;
    border-color: #c4b5fd !important;
}


/* Big comment tooltip styling */
.big-comment-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    position: relative;
    margin-left: 6px;
    vertical-align: middle;
    z-index: 10000; /* Ensure trigger is above other elements */
}

.big-comment-trigger:hover {
    background: #4f46e5;
}

.big-comment-tooltip {
    position: fixed;
    bottom: auto;
    right: 20px;
    top: auto;
    width: 400px;
    max-width: calc(100vw - 40px);
    background: rgba(23, 23, 23, 0.95);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
}

/* Arrow removed - tooltip is now positioned dynamically */

.big-comment-trigger:hover .big-comment-tooltip,
.big-comment-tooltip.active {
    opacity: 1;
    visibility: visible;
}

.cross-reference-item:hover:not(.disabled) {
    background: linear-gradient(135deg, #a8b6cb 0%, #e5e9f0 100%) !important;
    border-color: #95a5b8 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cross-reference-item.disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%) !important;
    border: 1px solid #9ca3af !important;
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(50%);
}

.cross-reference-item .cross-ref-label {
    font-weight: 600;
    color: #374151;
    min-width: 80px;
}

.cross-reference-item .cross-ref-action {
    color: #1f2937;
    letter-spacing: 0.05em;
    flex: 1;
}

.cross-reference-item.disabled .cross-ref-label,
.cross-reference-item.disabled .cross-ref-action {
    color: #6b7280;
}

/* Add a small icon to indicate it's a link */
.cross-reference-item:not(.disabled)::after {
    content: "→";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.cross-reference-item:hover:not(.disabled)::after {
    color: #374151;
    transform: translateY(-50%) translateX(2px);
}

/* Highlight effect for cross-referenced actions */
.highlighted-cross-ref {
    animation: highlightPulse 3s ease-in-out;
    position: relative;
    z-index: 10;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
        background-color: rgba(59, 130, 246, 0.1);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(59, 130, 246, 0.3);
        background-color: rgba(59, 130, 246, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        background-color: transparent;
    }
}

/* Comments Section */
.related-comments, .related-reductions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-item {
    padding: 10px 12px;
    background: rgba(139, 177, 252, 0.1);
    border: 1px solid rgba(139, 177, 252, 0.2);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comment-timestamp {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--light-blue);
}

.comment-text {
    font-size: 0.95rem;
    color: #ffffff;
    line-height: 1.4;
}

/* Reductions Section */
.reduction-item {
    padding: 10px 12px;
    background: rgba(225, 89, 197, 0.1);
    border: 1px solid rgba(225, 89, 197, 0.2);
    border-radius: 8px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.reduction-timestamp {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--pinkish);
}

.reduction-group {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    background: rgba(225, 89, 197, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
}

.reduction-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--pinkish);
}

.reduction-text {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    color: #cccccc;
    line-height: 1.3;
    margin-top: 4px;
}

/* No data messages */
.no-data, .no-metadata, .no-comments, .no-reductions {
    text-align: center;
    color: #666666;
    font-style: italic;
    padding: 20px;
}

/* Navigation Footer */
.navigation-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 30px;
}

.logo-container.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logo-container.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.logo-hint {
    font-size: 0.8rem;
    color: #666666;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.logo-container.clickable:hover .logo-hint {
    opacity: 1;
}

/* View Toggle Layout - matches main grid structure */
.view-toggle-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin: 20px 30px 10px 30px;
}

.view-toggle-main-buttons {
    display: flex;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-toggle-back-container {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main toggle buttons - custom width based on button type */
.view-toggle-main-buttons .view-toggle-main-button {
    padding: 16px 12px;
    background: rgba(60, 60, 60, 0.8);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main overview button takes 50% */
.view-toggle-main-buttons .main-overview-button {
    flex: 5;
    font-size: 15px;
    padding: 16px 24px;
}

/* Detailed buttons take 10% each */
.view-toggle-main-buttons .detailed-button {
    flex: 1;
    font-size: 13px;
    padding: 16px 8px;
}

/* Disabled button state */
.view-toggle-main-buttons .view-toggle-main-button.disabled {
    background: rgba(40, 40, 40, 0.6);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    opacity: 0.6;
}

.view-toggle-main-buttons .view-toggle-main-button.disabled:hover {
    background: rgba(40, 40, 40, 0.6);
    color: rgba(255, 255, 255, 0.4);
    transform: none;
}

/* Header loading states - only apply to pages with caching enabled */
.enable-smooth-loading .gymnast-name, 
.enable-smooth-loading .country-name, 
.enable-smooth-loading .academy-name, 
.enable-smooth-loading .object-name, 
.enable-smooth-loading .championship-name, 
.enable-smooth-loading .gymnast-level {
    transition: opacity 0.3s ease-in-out;
    min-height: 1.2em; /* Prevent layout shift */
}

.enable-smooth-loading .gymnast-name:not(.loaded), 
.enable-smooth-loading .country-name:not(.loaded), 
.enable-smooth-loading .academy-name:not(.loaded), 
.enable-smooth-loading .object-name:not(.loaded), 
.enable-smooth-loading .championship-name:not(.loaded), 
.enable-smooth-loading .gymnast-level:not(.loaded) {
    opacity: 0;
}

.enable-smooth-loading .gymnast-name.loaded, 
.enable-smooth-loading .country-name.loaded, 
.enable-smooth-loading .academy-name.loaded, 
.enable-smooth-loading .object-name.loaded, 
.enable-smooth-loading .championship-name.loaded, 
.enable-smooth-loading .gymnast-level.loaded {
    opacity: 1;
}

.enable-smooth-loading .gymnast-photo img, 
.enable-smooth-loading .flag-icon, 
.enable-smooth-loading .academy-icon {
    transition: opacity 0.3s ease-in-out;
}

.enable-smooth-loading .gymnast-photo img:not(.loaded), 
.enable-smooth-loading .flag-icon:not(.loaded), 
.enable-smooth-loading .academy-icon:not(.loaded) {
    opacity: 0;
}

.enable-smooth-loading .gymnast-photo img.loaded, 
.enable-smooth-loading .flag-icon.loaded, 
.enable-smooth-loading .academy-icon.loaded {
    opacity: 1;
}

/* Loading placeholder for header elements */
.header-loading {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 2s infinite linear;
    border-radius: 4px;
    height: 1.2em;
    display: inline-block;
    min-width: 120px;
}

.main-title.header-loading {
    width: 60%;
    height: 1.4em;
}

.category-name.header-loading,
.chief-judge-first-name.header-loading,
.chief-judge-last-name.header-loading,
.start-date.header-loading,
.end-date.header-loading {
    min-width: 160px;
}

.championship-loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.championship-loading-overlay.is-hidden {
    display: none;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== ENHANCED ANIMATED HEADER SYSTEM ===== */
/* Based on frontend engineer's spectacular design */

/* Enhanced hero configuration - full width like original */
.championships-main-header {
    position: relative;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px 0 0 0;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,.4);
    overflow: hidden;
    --px: 0; --py: 0;
    background: linear-gradient(135deg, rgb(90,111,239), rgb(198,121,233), rgb(225,89,197));
    filter: saturate(1.0);
    user-select: none;
    transition: background .5s ease, filter .5s ease;
}

/* Light theme variant (previous default) */
.championships-main-header.light-theme {
    background:
        radial-gradient(1200px 600px at calc(50% + 90px*var(--px)) calc(50% + 40px*var(--py)), rgba(139, 177, 252, 0.25), transparent 60%),
        radial-gradient(800px 500px at calc(50% - 160px*var(--px)) calc(40% - 60px*var(--py)), rgba(198, 121, 233, 0.22), transparent 60%),
        linear-gradient(180deg, #8BB1FC, #C679E9); /* Light theme: light-blue to purple */
    filter: saturate(1.12);
}

/* Dark Original theme variant (simple animations with dark color palette) */
.championships-main-header.dark-original-theme {
    background: linear-gradient(135deg, 
        #1a1a1a 0%, 
        #2d2d2d 25%, 
        #3a3a3a 50%, 
        #2d2d2d 75%, 
        #1a1a1a 100%);   /* Darker pinkish */
    filter: saturate(0.9);
}

/* Dark theme variant (enhanced animations with dramatic navy effects) */
.championships-main-header.dark-theme {
    background:
        radial-gradient(1200px 600px at calc(50% + 90px*var(--px)) calc(50% + 40px*var(--py)), rgba(63, 175, 255, 0.25), transparent 60%),
        radial-gradient(800px 500px at calc(50% - 160px*var(--px)) calc(40% - 60px*var(--py)), rgba(255, 120, 196, 0.22), transparent 60%),
        linear-gradient(180deg, #0b1020 0%, #121a35 60%, #0a0f20 100%); /* Dark theme: deep navy gradient */
    filter: saturate(1.15);
}

/* ===== ORIGINAL THEME (Simple Emoji Animations) ===== */
/* Header decoration containers */
.header-sparkles, .header-clouds {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Hide original animations in light/dark themes (enhanced themes) */
.light-theme .header-sparkles, 
.light-theme .header-clouds,
.dark-theme .header-sparkles, 
.dark-theme .header-clouds {
    opacity: 0;
    pointer-events: none;
}

/* Show enhanced animations in ALL themes - user requested dynamic improvements */
/* Original theme uses simple sparkles/clouds, but enhanced animations are now visible */
.championships-main-header .header-starfield,
.championships-main-header .enhanced-cloud-group,
.championships-main-header .enhanced-sparkle,
.championships-main-header .shooting-star,
.championships-main-header .header-fog {
    opacity: 1;
    pointer-events: auto;
}

/* Reduce opacity slightly in original themes for more subtle effect */
.championships-main-header:not(.light-theme):not(.dark-theme) .enhanced-cloud-group,
.championships-main-header:not(.light-theme):not(.dark-theme) .enhanced-sparkle {
    opacity: 0.7;
}

/* Original sparkle animations */
.sparkle {
    position: absolute;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    animation: sparkleFloat 6s ease-in-out infinite;
    transition: opacity 0.5s ease;
}

.sparkle-1 { top: 15%; left: 10%; animation-delay: 0s; }
.sparkle-2 { top: 25%; right: 15%; animation-delay: 1s; }
.sparkle-3 { top: 45%; left: 20%; animation-delay: 2s; }
.sparkle-4 { top: 35%; right: 25%; animation-delay: 3s; }
.sparkle-5 { top: 65%; left: 15%; animation-delay: 4s; }
.sparkle-6 { top: 75%; right: 20%; animation-delay: 5s; }
.sparkle-7 { top: 55%; left: 80%; animation-delay: 2.5s; }
.sparkle-8 { top: 85%; right: 10%; animation-delay: 1.5s; }

@keyframes sparkleFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.8; 
    }
    50% { 
        transform: translateY(-10px) rotate(180deg); 
        opacity: 1; 
    }
}

/* Original cloud animations */
.cloud {
    position: absolute;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2rem;
    animation: cloudFloat 8s ease-in-out infinite;
    transition: opacity 0.5s ease;
}

.cloud-1 { top: 20%; right: 10%; animation-delay: 0s; }
.cloud-2 { top: 60%; right: 20%; animation-delay: 2s; }
.cloud-3 { top: 30%; right: 80%; animation-delay: 4s; }
.cloud-4 { top: 70%; right: 85%; animation-delay: 6s; }

@keyframes cloudFloat {
    0%, 100% { 
        transform: translateX(0px); 
        opacity: 0.6; 
    }
    50% { 
        transform: translateX(-15px); 
        opacity: 0.8; 
    }
}

/* Animation layer base */
.header-layer { position: absolute; inset: 0; pointer-events: none; }

/* Enhanced starfield */
.header-starfield { position: absolute; inset: 0; pointer-events: none; }
.header-starfield i { 
    position: absolute; 
    border-radius: 50%; 
    background: rgba(255,255,255,0.95); 
    filter: blur(0.5px); 
}
@keyframes starBlink { 0%,100%{opacity:0.2} 50%{opacity:0.9} }

/* Enhanced cloud system */
.header-enhanced-clouds {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.enhanced-cloud-group {
    position: absolute; width: 220px; height: 120px; opacity: .88;
    animation: cloudDrift var(--cloud-dur, 32s) ease-in-out infinite alternate, cloudFade 18s ease-in-out infinite;
    transition: opacity 1.2s ease-in-out, filter .5s ease, background .5s ease; will-change: transform, opacity;
}
.enhanced-cloud-group.mounting { animation-play-state: paused; }
.enhanced-cloud { 
    position: absolute; 
    background: rgba(139, 177, 252, 0.92); /* Default: light blue clouds */
    border-radius: 999px; 
    filter: blur(2px); 
    box-shadow: 0 0 40px rgba(139, 177, 252, 0.25); 
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

/* Dark theme clouds */
.dark-theme .enhanced-cloud { 
    background: #fff; /* White clouds for dark theme */
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.25); 
}
.enhanced-cloud.puff.a { width: 120px; height: 70px; left: 20px; top: 36px; }
.enhanced-cloud.puff.b { width: 80px; height: 80px; left: 80px; top: 24px; }
.enhanced-cloud.puff.c { width: 140px; height: 90px; left: 110px; top: 40px; }
.enhanced-cloud.puff.d { width: 70px; height: 60px; left: 60px; top: 58px; }
.enhanced-cloud.puff { transform: translate(var(--tx,0px), var(--ty,0px)) scale(var(--ps,1)); will-change: transform; }
.enhanced-cloud-group::after { 
    content:""; 
    position:absolute; 
    inset:0; 
    background: radial-gradient(100px 50px at 60% 40%, rgba(255,255,255,0.45), transparent 70%); 
    mix-blend-mode: screen; 
    transition: background 0.5s ease;
}
@keyframes cloudDrift { 
    0%{ transform: translate(-50%, -50%) scale(var(--s,1)) translateX(-30px);} 
    25%{ transform: translate(-50%, -50%) scale(var(--s,1)) translateX(40px);} 
    50%{ transform: translate(-50%, -50%) scale(var(--s,1)) translateX(-20px);} 
    75%{ transform: translate(-50%, -50%) scale(var(--s,1)) translateX(50px);} 
    100%{ transform: translate(-50%, -50%) scale(var(--s,1)) translateX(-30px);} 
}
@keyframes cloudFade { 0%,100% {opacity: 0.25;} 50% {opacity: 0.9;} }

/* New dynamic cloud animations */
@keyframes cloudCircular {
    0% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) 
                  translateX(calc(var(--circular-radius, 20px) * var(--circular-direction, 1))) 
                  translateY(0px); 
    }
    25% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) 
                  translateX(0px) 
                  translateY(calc(var(--circular-radius, 20px) * var(--circular-direction, 1))); 
    }
    50% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) 
                  translateX(calc(var(--circular-radius, 20px) * var(--circular-direction, 1) * -1)) 
                  translateY(0px); 
    }
    75% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) 
                  translateX(0px) 
                  translateY(calc(var(--circular-radius, 20px) * var(--circular-direction, 1) * -1)); 
    }
    100% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) 
                  translateX(calc(var(--circular-radius, 20px) * var(--circular-direction, 1))) 
                  translateY(0px); 
    }
}

@keyframes cloudPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(calc(var(--s,1) * 0.5)); 
        opacity: 0.3;
    }
    25% { 
        transform: translate(-50%, -50%) scale(calc(var(--s,1) * 1.4)); 
        opacity: 0.8;
    }
    50% { 
        transform: translate(-50%, -50%) scale(calc(var(--s,1) * 0.7)); 
        opacity: 0.5;
    }
    75% { 
        transform: translate(-50%, -50%) scale(calc(var(--s,1) * 1.6)); 
        opacity: 0.9;
    }
}

@keyframes cloudVerticalFloat {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) translateY(0px); 
    }
    25% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) translateY(-20px); 
    }
    50% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) translateY(15px); 
    }
    75% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) translateY(-10px); 
    }
}

@keyframes cloudWobble {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) rotate(0deg); 
    }
    25% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) rotate(var(--max-rotation, 20deg)); 
    }
    50% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) rotate(calc(var(--max-rotation, 20deg) * -0.7)); 
    }
    75% { 
        transform: translate(-50%, -50%) scale(var(--s,1)) rotate(calc(var(--max-rotation, 20deg) * 0.5)); 
    }
}

/* Enhanced sparkles with brand colors */
.header-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.enhanced-sparkle { 
    position: absolute; 
    animation: twinkle 5.2s ease-in-out infinite; 
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.6)); 
    will-change: filter, opacity, transform; 
}
.enhanced-sparkle::before, .enhanced-sparkle::after { 
    content:""; 
    position:absolute; 
    left:50%; 
    top:50%; 
    transform: translate(-50%, -50%); 
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.85), transparent); 
    width: 140%; 
    height: 1px; 
    filter: blur(0.2px);
} 
.enhanced-sparkle::after{ transform: translate(-50%, -50%) rotate(90deg); }
@keyframes twinkle { 
    0%,100%{opacity:0.6; transform: translateY(0) scale(1);} 
    10%{opacity:1; transform: translateY(-1px) scale(1.1);} 
    50%{opacity:.85; transform: translateY(-2px) scale(1.2);} 
    70%{opacity:1; transform: translateY(0) scale(.98);} 
}

/* Shooting stars */
.header-shooters { position: absolute; inset: 0; pointer-events: none; }
.shooting-star { 
    position:absolute; 
    width: 160px; 
    height: 2px; 
    pointer-events:none; 
    animation: shootFade var(--dur, 1800ms) linear forwards; 
}
.shoot-core { 
    position:absolute; 
    left:0; 
    top:-2px; 
    width:6px; 
    height:6px; 
    border-radius:50%; 
    background:#fff; 
    box-shadow: 0 0 12px rgba(139, 177, 252, 0.95), 0 0 26px rgba(90, 111, 239, 0.65); /* Default: blue glow */
    animation: shootMove var(--dur, 1800ms) linear forwards; 
    transition: box-shadow 0.5s ease;
}
.shoot-tail { 
    position:absolute; 
    left:-150px; 
    top:-1px; 
    right:10px; 
    height:2px; 
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(139, 177, 252, 0.9) 70%, rgba(139, 177, 252, 0.35)); /* Default: blue tail */
    filter: drop-shadow(0 0 6px rgba(139, 177, 252, 0.8)); 
    animation: shootMove var(--dur, 1800ms) linear forwards; 
    transition: background 0.5s ease, filter 0.5s ease;
}

/* Dark theme shooting stars */
.dark-theme .shoot-core { 
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.95), 0 0 26px rgba(151, 198, 255, 0.65); /* White with blue glow */
}
.dark-theme .shoot-tail { 
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.9) 70%, rgba(255,255,255,0.4)); /* White tail */
    filter: drop-shadow(0 0 6px rgba(163, 210, 255, 0.8)); 
}
@keyframes shootMove { 0%{ transform: translateX(0) translateY(0);} 100%{ transform: translateX(-440px) translateY(140px);} }
@keyframes shootFade { 0%{opacity:0;} 10%{opacity:1;} 100%{opacity:0;} }

/* Enhanced fog/mist effects */
.header-fog { 
    position:absolute; 
    inset:0; 
    bottom:0; 
    height:28%; 
    mix-blend-mode: screen; 
}
.header-mist { 
    position:absolute; 
    inset:0; 
    opacity:.55; 
    background:
        radial-gradient(220px 90px at 15% 80%, rgba(139, 177, 252, 0.25), transparent 70%),
        radial-gradient(260px 110px at 55% 90%, rgba(198, 121, 233, 0.22), transparent 70%),
        radial-gradient(300px 100px at 85% 85%, rgba(225, 89, 197, 0.2), transparent 70%);
    filter: blur(14px); 
    animation: mistShift 22s ease-in-out infinite; 
    transition: background 0.5s ease;
}
.header-mist.m2 { 
    opacity:.35; 
    filter: blur(18px); 
    animation-duration: 32s; 
    animation-direction: alternate-reverse; 
}
.header-mist.mounting { animation-play-state: paused; }
.header-mist.exiting { opacity: 0 !important; }

/* Dark theme fog/mist */
.dark-theme .header-mist { 
    background:
        radial-gradient(220px 90px at 15% 80%, rgba(255, 255, 255, 0.25), transparent 70%),
        radial-gradient(260px 110px at 55% 90%, rgba(203, 219, 255, 0.25), transparent 70%),
        radial-gradient(300px 100px at 85% 85%, rgba(255, 255, 255, 0.2), transparent 70%);
}
@keyframes mistShift { 
    0%{ transform: translateX(-12px) translateY(0);} 
    50%{ transform: translateX(16px) translateY(-4px);} 
    100%{ transform: translateX(-18px) translateY(2px);} 
}

/* Content with enhanced glass effect */
.header-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 24px;
}

.header-content.glass {
    display: inline-block;
    padding: 16px 20px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Theme variants removed - using fixed dynamic theme in main header rule */

/* Theme toggle button - hidden by default, shown only when user presses "T" key */
.theme-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    user-select: none;
    /* Hidden by default - only shown when user presses 'T' key */
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Hover effect for immediate discovery */
.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Theme toggle visible state */
.theme-toggle.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.theme-toggle.visible:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-toggle.visible:active {
    transform: translateY(0);
}

.theme-toggle .icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.dark-theme .theme-toggle .icon {
    transform: rotate(180deg);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .enhanced-cloud-group, .enhanced-sparkle, .shooting-star, .header-mist, .header-starfield i,
    .sparkle, .cloud { 
        animation: none !important; 
        transition: none !important; 
    }
}

/* Placeholder content styling for disabled detailed views */
.placeholder-content {
    padding: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 auto;
}

.placeholder-content h2 {
    color: white;
    font-size: 1.8em;
    margin-bottom: 20px;
    font-weight: 600;
}

.placeholder-content p {
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 1.1em;
}

.placeholder-content ul {
    text-align: left;
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

.placeholder-content li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.placeholder-content em {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    font-size: 1.1em;
}

.view-toggle-main-buttons .view-toggle-main-button:last-child {
    border-right: none;
}

/* Back button - spans full width of its container */
.view-toggle-back-container .view-toggle-back-button {
    flex: 1;
    width: 100%;
    padding: 16px 20px;
    background: rgba(80, 80, 80, 0.8);
    color: rgba(255, 255, 255, 0.8);
    border: none;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

/* Button hover and active states */
.view-toggle-main-buttons .view-toggle-main-button:hover,
.view-toggle-back-container .view-toggle-back-button:hover {
    background: rgba(100, 100, 100, 0.9);
    color: white;
}

.view-toggle-main-buttons .view-toggle-main-button.active {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.8) 0%, 
        rgba(118, 75, 162, 0.8) 50%, 
        rgba(255, 154, 158, 0.7) 100%);
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Remove old separate back button styles - now part of row */

/* Clean video styling - no overlays needed */
.video-container {
    position: relative;
}

.video-stack {
    border-radius: 16px;
}

.video-stack video {
    border-radius: inherit;
}

/* Layout consistency */
.detailed-layout {
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Responsive design for view toggle layout */
@media (max-width: 1400px) {
    .view-toggle-layout {
        grid-template-columns: 1fr 320px;
        gap: 25px;
        margin: 20px 25px 10px 25px;
    }
}

@media (max-width: 1200px) {
    .view-toggle-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 30px 10px 30px;
    }
}

@media (max-width: 768px) {
    .view-toggle-layout {
        margin: 15px 20px 10px 20px;
        gap: 15px;
    }
    
    .view-toggle-main-buttons {
        flex-direction: column;
        gap: 1px;
    }
    
    .view-toggle-main-buttons .view-toggle-main-button {
        padding: 14px 20px;
        font-size: 13px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .view-toggle-main-buttons .view-toggle-main-button:last-child {
        border-bottom: none;
    }
    
    .view-toggle-back-container .view-toggle-back-button {
        padding: 14px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .view-toggle-layout {
        margin: 10px 15px 5px 15px;
    }
    
    .view-toggle-main-buttons .view-toggle-main-button,
    .view-toggle-back-container .view-toggle-back-button {
        padding: 12px 16px;
        font-size: 12px;
    }
}

/* Loading indicators for lazy video loading */
.video-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 20;
    color: #ffffff;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(139, 177, 252, 0.2);
    border-top: 4px solid var(--light-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--light-blue);
    text-align: center;
}

.loading-error {
    color: var(--pinkish);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    background: rgba(225, 89, 197, 0.1);
    border: 1px solid rgba(225, 89, 197, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
}

/* Video Error Banner with Retry */
.video-error-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 20;
    background: rgba(20, 20, 30, 0.95);
    border: 2px solid rgba(225, 89, 197, 0.3);
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
}

.video-error-banner .banner-icon {
    font-size: 3rem;
}

.video-error-banner .banner-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.video-error-banner .banner-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--pinkish);
}

.video-error-banner .banner-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.video-error-banner .retry-button {
    margin-top: 10px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-error-banner .retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 177, 252, 0.4);
}

.video-error-banner .retry-button:active {
    transform: translateY(0);
}

/* CHAMPIONSHIP OVERVIEW STYLES */

/* Championship Header Styling */
.championship-header {
    background: linear-gradient(135deg, var(--blue), var(--purple), var(--pinkish));
    padding: 20px 40px;
}

.championship-overview-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.championship-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    text-align: center;
}

.championship-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.championship-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.stat-value {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 600;
}

/* Performance Row Styling */
.performance-row {
    cursor: pointer;
    transition: all 0.3s ease;
}

.performance-row:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 40px rgba(255, 255, 255, 0.2),
        0 20px 80px rgba(90, 111, 239, 0.4),
        0 30px 120px rgba(139, 177, 252, 0.3),
        0 40px 160px rgba(198, 121, 233, 0.25),
        0 50px 200px rgba(225, 89, 197, 0.2);
}

.performance-video-container {
    position: relative;
}

/* Rank Badge */
.rank-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    z-index: 15;
    border: 3px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.rank-number {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    z-index: 12;
    border-radius: 12px;
}

.performance-video-container:hover .play-overlay {
    opacity: 1;
}

.play-button {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    transition: all 0.3s ease;
}

.play-button:hover {
    background: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
}

.play-button svg {
    margin-left: 4px; /* Adjust for visual centering */
}

/* Performance Info Section */
.performance-info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
}

.performance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.gymnast-info {
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 1;
}

.gymnast-photo-small {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--darker-gray);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.gymnast-photo-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gymnast-details-small {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gymnast-name-small {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.gymnast-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flag-icon-small {
    width: 18px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

.country-small {
    font-size: 0.9rem;
    color: #cccccc;
    font-weight: 500;
}

.academy-small {
    font-size: 0.85rem;
    color: #999999;
    font-weight: 400;
    line-height: 1.3;
}

/* Performance Score */
.performance-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.total-score-large {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.sub-scores-small {
    display: flex;
    gap: 12px;
}

.sub-score-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sub-score-label-small {
    font-size: 0.7rem;
    font-weight: 600;
    color: #cccccc;
    letter-spacing: 0.5px;
}

.sub-score-value-small {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

/* Performance Actions */
.performance-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 140px;
}

.action-button.primary {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: #ffffff;
}

.action-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 111, 239, 0.3);
}

.action-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.action-button.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.1);
}

/* Performance Quick Stats */
.performance-quick-stats {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.stat-icon {
    font-size: 1rem;
}

.stat-text {
    font-size: 0.85rem;
    color: #cccccc;
    font-weight: 500;
}

/* Preview Button Styling */
.preview-button {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid var(--purple);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: var(--purple);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-button:hover {
    background: rgba(198, 121, 233, 0.2);
    border-color: var(--pinkish);
    color: #ffffff;
    transform: scale(1.1);
}

/* Secondary Button Styling */
.view-toggle-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.view-toggle-button.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Championship Layout Adjustments */
.championship-layout {
    padding: 30px;
}

.championship-section {
    flex: 1;
}

.championship-list {
    gap: 25px;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .main-layout {
        grid-template-columns: 1fr 320px;
        gap: 25px;
        padding: 25px;
    }
    
    .main-header {
        padding: 20px 30px;
        gap: 25px;
    }
}

@media (max-width: 1200px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .analysis-panel {
        position: static;
        max-height: none;
    }
    
    .main-header {
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }
    
    .gymnast-info-column {
        order: 2;
    }
    
    .object-info-row {
        order: 3;
    }
    
    .championship-info-column {
        order: 4;
        align-items: center;
        text-align: center;
    }
    
    /* Detailed view responsive - stack video and text vertically */
    .action-detail-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .detailed-layout {
        padding: 20px;
        gap: 20px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .metadata-grid {
        grid-template-columns: 1fr;
    }
    
    /* Championship responsive - medium screens */
    .championship-header {
        padding: 15px 25px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .championship-stats {
        align-items: center;
        flex-direction: row;
        gap: 20px;
    }
    
    .performance-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .performance-score {
        align-items: center;
    }
    
    .performance-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .gymnast-photo-container {
        margin-right: 0;
    }
    
    .object-info-row {
        margin-right: 0;
    }
    
    .gymnast-details {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .main-layout {
        padding: 20px;
        gap: 20px;
    }
    
    .toggle-row {
        flex-direction: column;
    }
    
    .analysis-toggle {
        justify-content: center;
    }
    
    .timeline-container {
        height: 60px;
    }
    
    .timeline-segment {
        height: 35px;
        font-size: 0.7rem;
    }
    
    .gymnast-name {
        font-size: 1.8rem;
    }
    
    .championship-name {
        font-size: 1.6rem;
    }
    
    .gymnast-level {
        font-size: 1.2rem;
    }
    
    .object-name {
        font-size: 1.3rem;
    }
    
    .sberai-logo {
        max-width: 100px;
        max-height: 50px;
    }
    
    /* Detailed view mobile responsive */
    .detailed-layout {
        padding: 15px;
        gap: 15px;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .action-detail-row {
        padding: 15px;
        gap: 15px;
    }
    
    .action-name {
        font-size: 1.2rem;
    }
    
    .action-group {
        font-size: 0.9rem;
        padding: 3px 8px;
    }
    
    .action-valuable-indicator {
        font-size: 0.75rem;
    }
    
    .action-group-row {
        gap: 8px;
    }
    
    .metadata-key {
        min-width: 90px;
        font-size: 0.85rem;
    }
    
    .metadata-value {
        font-size: 0.85rem;
    }
    
    .view-toggle-button {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    
    .comment-item, .reduction-item {
        padding: 8px 10px;
    }
    
    .logo-hint {
        font-size: 0.7rem;
    }
    
    /* Championship mobile responsive */
    .championship-title {
        font-size: 1.8rem;
    }
    
    .championship-subtitle {
        font-size: 1rem;
    }
    
    .championship-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .performance-quick-stats {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .quick-stat {
        justify-content: center;
    }
    
    .gymnast-name-small {
        font-size: 1.1rem;
    }
    
    .total-score-large {
        font-size: 1.8rem;
    }
    
    .action-button {
        min-width: 120px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .rank-badge {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .play-button {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .photo-illumination {
        width: 110px;
        height: 110px;
    }
    
    .photo-gradient-hoop {
        width: 80px;
        height: 80px;
    }
    
    .gymnast-photo {
        width: 70px;
        height: 70px;
    }
    
    .gymnast-name {
        font-size: 1.5rem;
    }
    
    .championship-name {
        font-size: 1.3rem;
    }
    
    .gymnast-level {
        font-size: 1rem;
    }
    
    .object-name {
        font-size: 1.1rem;
    }
    
    .total-score {
        font-size: 1.6rem;
    }
    
    .sub-score-value {
        font-size: 1.1rem;
    }
    
    .sberai-logo {
        max-width: 80px;
        max-height: 40px;
    }
    
    .logo-container {
        padding-top: 15px;
    }
}

/* ================================
   CHAMPIONSHIPS OVERVIEW STYLES
   ================================ */

/* Championships Overview Container */
.championships-overview {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.lang-btn {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border-color: var(--blue);
    color: white;
}

/* Legacy championships header rule removed - now using enhanced header system */

/* Language switcher positioning for championships overview */
.championships-main-header .language-switcher {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    z-index: 1000 !important; /* Increased z-index for dropdown visibility */
}

/* Ensure language switcher dropdown is always visible on all pages */
.performance-view .language-switcher,
.detailed-view .language-switcher {
    z-index: 99999 !important;
}

.performance-view .language-dropdown,
.detailed-view .language-dropdown {
    z-index: 100000 !important;
}

/* Ensure main header doesn't create stacking context issues */
.performance-view .main-header,
.detailed-view .main-header {
    position: relative;
    z-index: 1;
}

/* Ensure video containers and analysis panels don't block dropdown */
.performance-view .video-section,
.performance-view .analysis-panel,
.detailed-view .action-details-section {
    position: relative;
    z-index: 1;
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    border-radius: inherit;
}

.header-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.9) 0%, 
        rgba(118, 75, 162, 0.9) 50%, 
        rgba(255, 154, 158, 0.8) 100%);
    border-radius: inherit;
}

.header-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: inherit;
}

/* Legacy sparkle and cloud CSS removed - now using enhanced header system */

/* Legacy header-content styles - enhanced system provides better styling */

.main-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 0 30px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

/* Championship subtitle styling in header-content */
.header-content .championship-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin: -20px 0 0 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Chief judge info styling */
.header-content .chief-judge-info {
    font-size: 1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    margin: 8px 0 0 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.header-content .chief-judge-label {
    margin-right: 8px;
    font-weight: 400;
}

.header-content .chief-judge-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

/* Championship info row styling for horizontal layout */
.championship-info-row {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    margin-top: 20px;
    gap: 120px;
    flex-wrap: nowrap;
    min-height: 120px;
}

/* Updated styles for elements in the championship info row */
.championship-info-row .championship-dates,
.championship-info-row .chief-judge-info,
.championship-info-row .championship-subtitle {
    font-size: 1.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    text-align: center;
    margin: 0;
    flex: 0 1 auto;
    min-width: 200px;
}

/* Dates, Chief Judge, and Subtitle sections use column layout for label above value */
.championship-info-row .championship-dates,
.championship-info-row .chief-judge-info,
.championship-info-row .championship-subtitle {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Specific adjustments for dates section */
.championship-info-row .championship-dates .dates-label {
    margin-right: 0;
    font-weight: 500;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.8);
}

.championship-info-row .championship-dates .start-date,
.championship-info-row .championship-dates .end-date {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    /* Allow dates to expand naturally */
}

/* Custom dates container to limit to 3 rows max */
.championship-info-row .championship-dates {
    max-height: 150px;
    overflow: hidden;
}

/* Specific adjustments for chief judge section */
.championship-info-row .chief-judge-info .chief-judge-label {
    margin-right: 0;
    font-weight: 500;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.8);
}

.championship-info-row .chief-judge-info .chief-judge-first-name,
.championship-info-row .chief-judge-info .chief-judge-last-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    /* Removed ellipsis constraints - let names take as much space as needed */
}

/* Specific adjustments for subtitle section */
.championship-info-row .championship-subtitle .age-group-label {
    font-weight: 500;
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.8);
}

.championship-info-row .championship-subtitle .category-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    /* Allow category names to expand as needed */
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.lang-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
    border-color: rgba(255, 255, 255, 0.9);
}

/* Main Content */
.championships-main {
    flex: 1;
    padding: 60px 60px;
    background: transparent;
    position: relative;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 80px 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e3e3e3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
}

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

.loading-state p {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 80px 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.error-state h3 {
    color: #e74c3c;
    margin: 0 0 15px 0;
    font-size: 1.5rem;
}

.error-state p {
    color: #666;
    margin: 0 0 30px 0;
    font-size: 1.1rem;
}

.retry-btn {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Championships Grid */
.championships-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Championship Card */
.championship-card {
    position: relative;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    background-clip: padding-box; /* Prevent background bleeding through border */
}

.championship-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 25px 60px rgba(90, 111, 239, 0.35),
        0 35px 100px rgba(139, 177, 252, 0.25),
        0 45px 140px rgba(198, 121, 233, 0.2),
        0 55px 180px rgba(225, 89, 197, 0.15);
}

/* Championship card header styling */
.card-header {
    position: relative;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
    z-index: 3; /* Above photo overlay (z-index: 1) */
    background: rgba(39, 39, 39, 0.8);
    backdrop-filter: blur(10px);
    background-clip: padding-box; /* Prevent background bleeding */
}

/* Active championship - rainbow background like header */
.championship-card.status-active {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.9) 0%, 
        rgba(118, 75, 162, 0.9) 50%, 
        rgba(255, 154, 158, 0.8) 100%);
    background-clip: padding-box; /* Prevent gradient bleeding through border */
    box-shadow: 
        0 10px 30px rgba(102, 126, 234, 0.3),
        0 20px 40px rgba(118, 75, 162, 0.2),
        0 30px 60px rgba(255, 154, 158, 0.1);
}

.championship-card.status-active .card-header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    background-clip: padding-box; /* Prevent header background bleeding */
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.championship-card.status-active:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 40px rgba(102, 126, 234, 0.4),
        0 25px 60px rgba(118, 75, 162, 0.35),
        0 35px 100px rgba(255, 154, 158, 0.25),
        0 45px 140px rgba(139, 177, 252, 0.2);
}

/* Inactive championship - gray and unclickable */
.championship-card.status-inactive {
    border: 2px solid rgba(158, 158, 158, 0.3);
    background: rgba(120, 120, 120, 0.1);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: 
        0 5px 15px rgba(158, 158, 158, 0.2);
}

.championship-card.status-inactive .card-header {
    background: linear-gradient(135deg, rgba(158, 158, 158, 0.8), rgba(189, 189, 189, 0.6));
    color: rgba(255, 255, 255, 0.8);
}

.championship-card.status-inactive:hover {
    transform: none;
    box-shadow: 
        0 5px 15px rgba(158, 158, 158, 0.2);
}

.championship-name {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    text-align: center;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Location info row */
.card-location {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
    background: rgba(64, 64, 64, 0.8);
}

.flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    background: var(--darker-gray);
}

.location-name {
    font-size: 1rem;
    font-weight: 500;
    color: #cccccc;
}

/* Photo section */
.card-photo {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
    padding: 16px;
    background: rgba(64, 64, 64, 0.8);
}

.card-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.championship-card:hover .card-bg-image {
    transform: scale(1.0);
}

.card-photo-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
    border-radius: 12px;
    z-index: 1; /* Ensure proper layering */
}

/* Card Hover Overlay */
.card-hover-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 3;
    background: rgba(102, 126, 234, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.championship-card:hover .card-hover-overlay {
    opacity: 1;
}

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

.hover-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.hover-text {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Footer - Simple style matching championship.html */
.championships-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px;
    text-align: center;
    background: none;
}

.championships-footer .logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.championships-footer .sberai-logo {
    height: 32px;
    opacity: 0.8;
}

/* Medium screens - reduce gaps but keep horizontal layout */
@media (max-width: 1200px) {
    .championship-info-row {
        gap: 60px;
    }
    
    .championship-info-row .championship-dates,
    .championship-info-row .chief-judge-info,
    .championship-info-row .championship-subtitle {
        min-width: 150px;
        font-size: 1.6rem;
    }
}

/* Large screens - more generous spacing */
@media (min-width: 1400px) {
    .championship-info-row {
        gap: 180px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    /* Championship info row responsive design */
    .championship-info-row {
        flex-direction: column;
        gap: 20px;
        margin-top: 15px;
        flex-wrap: wrap;
    }
    
    .championship-info-row .championship-dates,
    .championship-info-row .chief-judge-info,
    .championship-info-row .championship-subtitle {
        font-size: 1.3rem;
        text-align: center;
    }
    
    /* Mobile adjustments for labels in dates, chief judge, and subtitle sections */
    .championship-info-row .championship-dates .dates-label,
    .championship-info-row .chief-judge-info .chief-judge-label,
    .championship-info-row .championship-subtitle .age-group-label {
        font-size: 1.1rem;
    }
    
    /* Mobile adjustments for chief judge name elements */
    .championship-info-row .chief-judge-info .chief-judge-first-name,
    .championship-info-row .chief-judge-info .chief-judge-last-name {
        font-size: 1.2rem;
    }
    
    .championships-main-header {
        margin: 20px 0 0 0; /* Full width on mobile too */
        height: 240px; /* Slightly shorter on mobile */
        border-radius: 20px;
    }
    
    .championships-main-header .language-switcher {
        top: 15px !important;
        right: 15px !important;
    }
    
    .championships-main {
        padding: 40px 20px;
    }
    
    .championships-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .championship-card {
        height: 350px;
    }
    
    .championship-name {
        font-size: 1.4rem;
    }
    
    .top-language-bar {
        padding: 15px 20px;
    }
    
    .language-selector-top {
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }
    
    .language-selector-top .lang-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .championships-main-header {
        height: 200px; /* Compact on small mobile */
        margin: 15px 0 0 0; /* Full width on small mobile too */
        border-radius: 16px;
    }
    
    .championships-main-header .language-switcher {
        top: 12px !important;
        right: 12px !important;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .championships-main {
        padding: 30px 15px;
    }
    
    .championships-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .championship-card {
        height: 320px;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .championship-name {
        font-size: 1.2rem;
    }
    
    .card-location {
        padding: 12px 15px;
    }
    
    .location-name {
        font-size: 0.9rem;
    }
    
    .card-photo {
        padding: 12px;
    }
    
    .card-photo-overlay {
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    
    .card-hover-overlay {
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    
    .top-language-bar {
        padding: 10px 15px;
    }
    
    .language-selector-top .lang-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* Championship Performance Cards - New Layout */
.championship-performance-card {
    display: flex;
    gap: 24px;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 320px; /* Adjusted height for 45% video width */
}

/* Card background with comment gradient style */
.championship-performance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--blue), var(--pinkish), var(--orange));
    border-radius: 16px;
    z-index: 1;
}

.championship-performance-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0; /* Removed gradient spill */
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg, 
        var(--lighter-gray) 0%,
        var(--lighter-gray) 50%,
        rgba(38, 38, 38, 0.95) 60%,
        rgba(38, 38, 38, 0.85) 75%,
        rgba(38, 38, 38, 0.7) 90%,
        rgba(38, 38, 38, 0.4) 100% /* More muted end */
    );
    border-radius: 16px;
    z-index: 2;
}

.championship-performance-card:hover::after {
    background: linear-gradient(
        45deg, 
        rgba(38, 38, 38, 0.98) 0%,
        rgba(38, 38, 38, 0.98) 50%,
        rgba(38, 38, 38, 0.9) 60%,
        rgba(38, 38, 38, 0.8) 75%,
        rgba(38, 38, 38, 0.6) 90%,
        rgba(38, 38, 38, 0.3) 100% /* More muted hover end */
    );
}

.championship-performance-card:hover {
    transform: translateY(-12px); /* Even more pronounced spring effect */
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 25px 60px rgba(90, 111, 239, 0.35),
        0 35px 100px rgba(139, 177, 252, 0.25),
        0 45px 140px rgba(198, 121, 233, 0.2),
        0 55px 180px rgba(225, 89, 197, 0.15); /* Multi-layered glow like championship cards */
}

/* First Element: Video Section */
.card-video-section {
    position: relative;
    z-index: 3;
    flex: 0 0 50%; /* Video takes 45% of width for better balance */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-video-container {
    position: relative;
    width: 100%;
    height: 100%; /* Use full available height instead of fixed height */
    min-height: 300px; /* Minimum height for proper display */
    border-radius: 12px;
    overflow: hidden;
    background: var(--darker-gray);
}

.card-video-container .video-stack {
    width: 100%;
    height: 100%;
}

.card-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This should fill the container without black borders */
    object-position: center; /* Center the video content */
}

.card-video-container .play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.card-video-container:hover .play-overlay {
    opacity: 1;
}

.card-video-container .play-button {
    color: white;
    font-size: 48px;
    transition: transform 0.2s ease;
}

.card-video-container .play-button:hover {
    transform: scale(1.1);
}

/* Video Not Available Banner */
.video-not-available-banner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    gap: 15px;
}

.video-not-available-banner .banner-icon {
    font-size: 48px;
    opacity: 0.5;
    filter: grayscale(100%);
}

.video-not-available-banner .banner-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-not-available-banner .banner-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

.video-not-available-banner .banner-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

/* Responsive styles for banner */
@media (max-width: 768px) {
    .video-not-available-banner {
        padding: 20px;
        gap: 10px;
    }
    
    .video-not-available-banner .banner-icon {
        font-size: 40px;
    }
    
    .video-not-available-banner .banner-title {
        font-size: 16px;
    }
    
    .video-not-available-banner .banner-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .video-not-available-banner {
        padding: 15px;
        gap: 8px;
    }
    
    .video-not-available-banner .banner-icon {
        font-size: 32px;
    }
    
    .video-not-available-banner .banner-title {
        font-size: 14px;
    }
    
    .video-not-available-banner .banner-description {
        font-size: 12px;
    }
}

/* Performance page specific banner styling */
.video-container .video-not-available-banner.performance-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    margin: 0;
    /* Override the semi-transparent background with a more visible one */
    background: linear-gradient(135deg, rgba(60, 60, 60, 0.95) 0%, rgba(40, 40, 40, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Ensure video-container maintains its aspect ratio even with banner */
.video-container:has(.video-not-available-banner.performance-banner) {
    aspect-ratio: 16/9;
}

@media (max-width: 768px) {
    .video-container .video-not-available-banner.performance-banner {
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .video-container .video-not-available-banner.performance-banner {
        border-radius: 8px;
    }
}

/* Detailed pages specific banner styling */
.action-video-container .video-not-available-banner.detailed-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    margin: 0;
    background: linear-gradient(135deg, rgba(60, 60, 60, 0.95) 0%, rgba(40, 40, 40, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Stills/highlights not available placeholder */
.stills-not-available-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    text-align: center;
    gap: 12px;
}

.stills-not-available-placeholder .placeholder-icon {
    font-size: 36px;
    opacity: 0.4;
    filter: grayscale(100%);
}

.stills-not-available-placeholder .placeholder-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .stills-not-available-placeholder {
        min-height: 120px;
        padding: 20px;
    }
    
    .stills-not-available-placeholder .placeholder-icon {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .stills-not-available-placeholder {
        min-height: 100px;
        padding: 15px;
        gap: 8px;
    }
    
    .stills-not-available-placeholder .placeholder-icon {
        font-size: 24px;
    }
    
    .stills-not-available-placeholder .placeholder-text {
        font-size: 13px;
    }
}



/* Second Element: Info Section */
.card-info-section {
    position: relative;
    z-index: 3;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 12px 24px 0 20px; /* Added top padding and right padding to prevent overflow */
}

/* Element 1: Top row with gymnast details + placement */
.top-info-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px; /* Space before score breakdown */
}

/* Sub-element 1.1: Gymnast details column */
.gymnast-details-column {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Increased vertical space between photo+name and country+academy rows */
    flex: 1; /* Take remaining space */
}

.gymnast-photo-container {
    flex: 0 0 112px; /* Increased by 50% on top of previous 25% (from 75px to 112px) */
    position: relative;
}

.gymnast-photo-container::before {
    content: '';
    position: absolute;
    top: -30px; /* Increased glow area */
    left: -30px;
    right: -30px;
    bottom: -30px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(240, 240, 240, 0.4) 25%, rgba(220, 220, 220, 0.2) 50%, transparent 80%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(12px); /* Increased blur for more pronounced glow */
}

.gymnast-photo-container img,
.gymnast-photo-container .lazy-photo {
    width: 112px; /* Increased by 50% on top of previous 25% (from 75px to 112px) */
    height: 112px; /* Increased by 50% on top of previous 25% (from 75px to 112px) */
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3); /* Slightly thicker border */
    position: relative;
    z-index: 2;
}

/* Row 1.1.1: Photo + Name + Item (horizontal) */
.photo-name-item-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Row 1.1.2: Flag + Country + Academy Logo + Academy Name (horizontal) */
.flag-country-academy-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 10px;
    margin-top: 10px;
}

/* Starting number column styling - styled like score columns */
.starting-number-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    min-width: 32px;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border-bottom: 2px solid rgba(90, 111, 239, 0.8);
}

.starting-number-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    margin-bottom: 2px;
}

.starting-number-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    min-width: 24px;
    text-align: center;
}

.gymnast-name {
    font-size: 2.6rem; /* Increased by 50% on top of previous 25% (from 1.75rem to 2.6rem) */
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.2; /* Tighter line height for larger text */
}

.object-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.object-icon .apparatus-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}



.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

.academy-icon,
.lazy-academy-logo {
    width: 24px;
    height: 18px;
    object-fit: contain;
}

.country-name, .academy-name {
    color: #cccccc;
    font-size: 1.19rem; /* 30% smaller than 1.7rem */
    font-weight: 400;
    line-height: 1.3;
}

/* Performance Description Row in Championship Cards */
.championship-performance-card .description-row {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
}

.championship-performance-card .performance-description {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.4;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-left: 8px;
}

/* Score Breakdown Section - New dedicated area */
.score-breakdown-section {
    flex: 1; /* Take remaining vertical space */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Pin DB row closer to bottom */
    padding-right: 4px; /* Prevent overflow on right edge */
}

.score-breakdown-row {
    display: flex;
    gap: 6px; /* More compact for tighter packing */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 12px; /* More vertical padding, less horizontal */
}

.score-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px; /* Slightly more gap for better readability */
    padding: 8px 2px; /* Very compact horizontal padding */
}

.score-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

/* Disabled score styling */
.score-column.score-disabled {
    opacity: 0.4;
    position: relative;
}

.score-column.score-disabled::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    pointer-events: none;
}

.score-column.score-disabled .score-label,
.score-column.score-disabled .score-value {
    color: #666;
}

/* Placement Section (now inline in top row) */
.card-score-section {
    position: relative;
    z-index: 3;
    flex: 0 0 140px; /* Slightly smaller for inline placement */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px; /* Reduced gap for more compact */
    padding: 16px; /* Reduced padding */
    margin-right: 8px; /* Prevent overflow on right edge */
    background: linear-gradient(135deg, rgba(225, 89, 197, 0.3), rgba(225, 89, 197, 0.15)); /* Much more muted pink */
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(225, 89, 197, 0.1); /* Reduced shadow opacity */
}

.total-score {
    font-size: 1.8rem; /* Reduced for compact inline display */
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.placement-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px; /* Reduced gap for more compact */
}

.placement-number {
    font-size: 1.4rem; /* Reduced for compact inline display */
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.podium-visualization {
    position: relative;
    width: 50px; /* Slightly smaller for compact display */
    height: 32px; /* Proportionally smaller height */
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.podium-step {
    width: 100%;
    border-radius: 4px 4px 0 0;
    position: relative;
    background: linear-gradient(180deg, #666, #333);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.podium-step.podium-first {
    height: 32px; /* Proportionally smaller */
    background: linear-gradient(180deg, #FFD700, #FFA500);
}

.podium-step.podium-second {
    height: 26px; /* Proportionally smaller */
    background: linear-gradient(180deg, #C0C0C0, #A0A0A0);
}

.podium-step.podium-third {
    height: 20px; /* Proportionally smaller */
    background: linear-gradient(180deg, #CD7F32, #8B4513);
}

.podium-step.podium-other {
    height: 14px; /* Proportionally smaller */
    background: linear-gradient(180deg, #666, #333);
}

/* Loading States for Championship Cards */
.card-loading {
    opacity: 0.95;
}

.video-loading-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        rgba(38, 38, 38, 0.8) 0%,
        rgba(50, 50, 50, 0.8) 50%,
        rgba(38, 38, 38, 0.8) 100%
    );
    background-size: 200% 200%;
    animation: shimmer 2s ease-in-out infinite;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.loading-text {
    color: rgba(255, 255, 255, 0.4) !important;
    position: relative;
    overflow: hidden;
}

.loading-text::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: loading-sweep 1.5s ease-in-out infinite;
}

@keyframes loading-sweep {
    to { left: 100%; }
}

.loading-score {
    color: rgba(255, 255, 255, 0.3) !important;
    position: relative;
}

.loading-score::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    min-height: 3em;
    border-radius: 8px;
}

.loading-skeleton .loading-placeholder {
    opacity: 0.5;
    font-style: italic;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Smooth transitions when loading completes */
.country-name,
.academy-name,
.score-value,
.total-score {
    transition: color 0.3s ease, opacity 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .championship-performance-card {
        flex-direction: column;
        gap: 16px;
        min-height: 400px; /* Adjusted for 45% video width */
    }
    
    .card-video-section {
        flex: none;
    }
    
    .card-info-section {
        padding: 10px 20px 0 16px; /* Adjusted tablet padding */
    }
    
    .card-video-container {
        height: 260px; /* Adjusted for 45% width video */
        min-height: 260px; /* Ensure minimum height on tablets */
    }
    
    .top-info-row {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 16px;
    }
    
    .gymnast-details-column {
        flex: none;
        gap: 18px; /* Slightly reduced but still generous spacing for tablets */
    }
    
    .flag-country-academy-row {
        justify-content: flex-start;
    }
    
    .card-score-section {
        flex: none;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        max-width: 300px;
        align-self: center;
    }
    
    .placement-info {
        flex-direction: row;
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .championship-performance-card {
        padding: 16px;
        margin-bottom: 16px;
        min-height: 360px; /* Adjusted for new layout and 45% video */
    }
    
    .card-info-section {
        padding: 8px 16px 0 12px; /* Adjusted mobile padding */
    }
    
    .card-video-container {
        height: 230px; /* Adjusted for mobile with 45% video */
        min-height: 230px; /* Ensure proper mobile height */
    }
    
    .info-header-row {
        margin-bottom: 12px;
    }
    
    .gymnast-details-column {
        gap: 16px; /* Preserved mobile spacing */
        align-items: center;
        text-align: center;
    }
    
    .photo-name-item-row {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .flag-country-academy-row {
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .card-score-section {
        padding: 10px 12px;
        max-width: 250px;
    }
    
    .score-breakdown-row {
        flex-wrap: wrap;
        gap: 4px;
        padding: 16px 8px; /* Adjusted padding for mobile */
    }
    
    .score-column {
        flex: 1 1 calc(50% - 2px);
        min-width: 65px; /* More compact for mobile */
    }
    
    .gymnast-name {
        font-size: 2.2rem; /* Proportionally scaled for mobile from 2.6rem */
        line-height: 1.2;
    }
    
    .gymnast-photo-container {
        flex: 0 0 95px; /* Scaled down from 112px for mobile but still much larger */
    }
    
    .gymnast-photo-container::before {
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        filter: blur(10px); /* Slightly less blur on mobile */
    }
    
    .gymnast-photo-container img,
    .gymnast-photo-container .lazy-photo {
        width: 95px;
        height: 95px;
    }
    
    .country-name, .academy-name {
        font-size: 0.98rem; /* 30% smaller than proportionally scaled 1.4rem */
        line-height: 1.3;
    }
    
    .total-score {
        font-size: 1.6rem; /* Slightly smaller for compact mobile layout */
    }
    
    .placement-number {
        font-size: 1.2rem; /* Slightly smaller for mobile */
    }
}

/* =============================================================================
   VIEW-SPECIFIC PHOTO STYLES
   ============================================================================= */

/* Performance View - Proper photo sizing for header */
.performance-view .gymnast-photo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 40px;
}

.performance-view .photo-illumination {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 40%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(8px);
}

.performance-view .photo-gradient-hoop {
    position: absolute;
    width: 100px;
    height: 100px;
    background: conic-gradient(from 0deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #fd79a8, #e17055, #ff6b6b);
    border-radius: 50%;
    z-index: 2;
    filter: blur(2px);
}

.performance-view .photo-gradient-hoop::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--dark-gray);
    border-radius: 50%;
}

.performance-view .gymnast-photo {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 3;
    background: var(--darker-gray);
}

.performance-view .gymnast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Detailed View - Same as performance view for consistency */
.detailed-view .gymnast-photo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 40px;
}

.detailed-view .photo-illumination {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 40%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(8px);
}

.detailed-view .photo-gradient-hoop {
    position: absolute;
    width: 100px;
    height: 100px;
    background: conic-gradient(from 0deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7, #fd79a8, #e17055, #ff6b6b);
    border-radius: 50%;
    z-index: 2;
    filter: blur(2px);
}

.detailed-view .photo-gradient-hoop::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: var(--dark-gray);
    border-radius: 50%;
}

.detailed-view .gymnast-photo {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 3;
    background: var(--darker-gray);
}

.detailed-view .gymnast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Championship View - Keep existing custom sizing but make it specific */
.championship-view .gymnast-photo-container {
    flex: 0 0 112px !important; /* Larger size for championship view */
    position: relative;
}

.championship-view .gymnast-photo-container::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(240, 240, 240, 0.4) 25%, rgba(220, 220, 220, 0.2) 50%, transparent 80%);
    border-radius: 50%;
    z-index: 1;
    filter: blur(12px);
}

.championship-view .gymnast-photo-container img,
.championship-view .gymnast-photo-container .lazy-photo {
    width: 112px !important; /* Larger for championship view */
    height: 112px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
}

/* Mobile responsiveness for view-specific styles */
@media (max-width: 768px) {
    .performance-view .photo-illumination,
    .detailed-view .photo-illumination {
        width: 100px;
        height: 100px;
    }
    
    .performance-view .photo-gradient-hoop,
    .detailed-view .photo-gradient-hoop {
        width: 80px;
        height: 80px;
    }
    
    .performance-view .gymnast-photo,
    .detailed-view .gymnast-photo {
        width: 70px;
        height: 70px;
    }
    
    .championship-view .gymnast-photo-container {
        flex: 0 0 95px !important;
    }
    
    .championship-view .gymnast-photo-container::before {
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        filter: blur(10px);
    }
    
    .championship-view .gymnast-photo-container img,
    .championship-view .gymnast-photo-container .lazy-photo {
        width: 95px !important;
        height: 95px !important;
    }
}

/* Scroll to Top Button */
.scroll-to-top-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple), var(--pinkish));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.scroll-to-top-button.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-button:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.4),
        0 16px 48px rgba(90, 111, 239, 0.3),
        0 20px 64px rgba(198, 121, 233, 0.2);
    background: linear-gradient(135deg, 
        rgba(90, 111, 239, 0.9), 
        rgba(198, 121, 233, 0.9), 
        rgba(225, 89, 197, 0.9));
}

.scroll-to-top-button:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-top-button svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.scroll-to-top-button:hover svg {
    transform: translateY(-2px);
}

/* Responsive adjustments for scroll-to-top button */
@media (max-width: 768px) {
    .scroll-to-top-button {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    .scroll-to-top-button svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .scroll-to-top-button {
        bottom: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
    }
    
    .scroll-to-top-button svg {
        width: 18px;
        height: 18px;
    }
}

/* Special Collection Placeholders for A Actions (129, 130) */

.special-collection-placeholder .still-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    text-align: center;
    gap: 8px;
    height: 100%;
}

.special-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
}

.person-icon-container {
    position: relative;
    margin-bottom: 8px;
}

.person-icon {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.4);
    position: relative;
    filter: grayscale(100%);
}

.x-icon {
    position: absolute;
    top: -2px;
    right: -8px;
    width: 10px;
    height: 10px;
    color: rgba(255, 255, 255, 0.4);
    filter: grayscale(100%);
}

.special-collection-placeholder .placeholder-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: normal;
    line-height: 1.2;
    text-align: center;
} 
