﻿@import "https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css";
@import "https://cdn.jsdelivr.net/npm/@creativebulma/bulma-tooltip@1.2.0/dist/bulma-tooltip.min.css";
@media screen and (min-width: 1024px) {
    .container {
        max-width: 860px;
    }
}

.authors>span {
    padding: 0 0.75rem;
}

@media only screen and (max-width: 480px) {
    a.button.is-rounded.is-link.is-light:not(:last-child) {
        margin-bottom: 0.75em;
    }
}

.gallery-grid {
    position: relative;
    width: 100%;
    font-size: 0;
    transform: translateZ(0);
    will-change: height;
}

.gallery-item {
    display: inline-block;
    vertical-align: top;
    box-sizing: border-box;
    margin: 2px;
    padding: 0;
    line-height: 0;
    position: relative;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: translateZ(0);
}

.video-time-display {
    text-align: center;
    font-size: 14px;
    padding: 5px 0;
    background-color: transparent;
    color: white;
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    z-index: 2;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Bordered note */
.bordered-note {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px 15px;
    background-color: #f9f9f9;
    margin: 15px 0;
}

/* Note section styling */
.content.has-text-justified-desktop p em {
    font-style: normal;
    display: block;
    padding: 12px 18px;
    margin: 20px 0;
    background: linear-gradient(to right, #f8f9fa 0%, #ffffff 100%);
    border-left: 3px solid #4a90e2;
    border-radius: 4px;
    color: #555;
    font-size: 0.95em;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Ablation study styling */
.ablation-label {
    padding: 10px 0;
    margin: 20px 0 15px 0;
    position: relative;
    padding-left: 30px;
}

.ablation-label::before {
    content: ">";
    position: absolute;
    left: 0;
    color: #667eea;
    font-size: 1.5em;
    font-weight: bold;
    line-height: 1;
}

.ablation-label strong {
    color: #2c3e50;
    font-size: 1.1em;
    letter-spacing: 0.3px;
}

/* Comparison table styles */
.comparison-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}

.comparison-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comparison-cell {
    flex: 1;
    padding: 5px 10px;
    box-sizing: border-box;
    text-align: center;
}

.header-row .comparison-cell {
    padding-bottom: 10px;
}

.header-row p {
    margin: 0;
    font-size: 0.9em;
}

.comparison-cell img,
.comparison-cell video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Fix time display positioning in comparison cells */
.comparison-cell {
    position: relative;
}

.video-wrapper {
    position: relative;
    width: 100%;
    display: inline-block;
}

/* Make all time displays consistent */
.comparison-cell .video-time-display {
    bottom: 5px;
    font-size: 14px;
    padding: 5px 0;
    background-color: transparent;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    /* Ensure consistent positioning */
    position: absolute;
    left: 0;
    right: 0;
    margin: 0 auto;
}

@media screen and (max-width: 768px) {
    .comparison-row {
        flex-direction: column;
    }
    
    .comparison-cell {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .header-row .comparison-cell {
        margin-bottom: 5px;
    }
    
    /* Add header before each cell in mobile view */
    .content-row .comparison-cell:nth-child(1)::before {
        content: "Input image";
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .content-row .comparison-cell:nth-child(2)::before {
        content: "SkyReels V2 (Wan14B) + DiffusionForcing";
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    .content-row .comparison-cell:nth-child(3)::before {
        content: "Proposed (forward sampling + history discretization)";
        display: block;
        font-weight: bold;
        margin-bottom: 5px;
    }
    
    /* Hide the header row on mobile */
    .header-row {
        display: none;
    }
}

/* Prompts toggle styles */
.prompts-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.prompts-toggle {
    margin-bottom: 10px;
}

.prompts-toggle p {
    margin: 0;
    font-weight: 500;
    transition: color 0.2s ease;
}

.prompts-toggle p:hover {
    color: #2366d1 !important;
}

.prompts-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    animation: fadeIn 0.3s ease-in-out;
}

.prompts-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    text-align: justify;
}

.prompts-content p:last-child {
    margin-bottom: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

* {
    box-sizing: border-box;
}

video {
    transform: translateZ(0);
    object-fit: cover;
    preload: metadata;
}

img {
    transform: translateZ(0);
    image-rendering: -webkit-optimize-contrast;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

html {
    scroll-behavior: smooth;
}

body {
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

body.loaded {
    opacity: 1;
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

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

.loader-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

.loader-subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin-bottom: 30px;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

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

.gallery-item {
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item:not(.loaded):not(.error) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.gallery-item:not(.loaded):not(.error) img,
.gallery-item:not(.loaded):not(.error) video {
    min-height: 150px;
    opacity: 0;
}

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

.gallery-item:not(.loaded):not(.error)::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 60%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    z-index: 1;
}

.gallery-item:not(.loaded):not(.error)::after {
    content: "Loading...";
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
    z-index: 2;
}

.gallery-item.video-started {
    background: transparent !important;
    animation: none;
}

.gallery-item.video-started::before,
.gallery-item.video-started::after {
    display: none;
}

.gallery-item.video-started video {
    opacity: 1;
    min-height: auto;
}

.gallery-item.loaded {
    background: transparent !important;
    animation: fadeInContent 0.8s ease-in-out;
}

.gallery-item.loaded::before,
.gallery-item.loaded::after {
    display: none;
}

.gallery-item.loaded img,
.gallery-item.loaded video {
    opacity: 1;
    min-height: auto;
}

.gallery-item.error {
    background-color: #ffe6e6;
    border: 1px solid #ffcccc;
}

.gallery-item.error::before {
    content: "Failed to load";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #cc0000;
    font-size: 12px;
    z-index: 1;
}

@keyframes fadeInContent {
    from {
        opacity: 0.7;
    }
    to {
        opacity: 1;
    }
}

.loading-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(0,0,0,0.7));
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
}
