/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Montserrat:wght@400;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css');

/* Astrolabe gradient colors */
:root {
    --astro-start: #7A28CB;
    --astro-end: #00D2FF;
    --astro-mid: #3D7DE7;
}

/* Set global styles */
body {
    font-family: 'Roboto', "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #333;
    display: flex;
    font-size: 16px;
    line-height: 1.6;
}

/* Sidebar styles */
.sidebar {
    width: 200px;
    background: linear-gradient(180deg, #f5f1eb 0%, #e8e4de 100%);
    color: #333;
    padding: 20px;
    position: fixed;
    height: 100vh;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-right: 1px solid #ddd;
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

/* Content area styles */
.content {
    margin-left: 220px;
    padding: 40px;
    flex: 1;
    width: calc(100% - 220px);
    box-sizing: border-box;
    transition: margin-left 0.3s ease, width 0.3s ease;
    max-width: 1400px;
    margin-right: auto;
}

/* Hide sidebar on mobile devices */
@media screen and (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
}

/* Sidebar title styles */
.sidebar-title {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--astro-start), var(--astro-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

/* Sidebar logo */
.sidebar-logo {
    height: 1em;
    width: 1.1em;
    vertical-align: -0.15em;
    margin-right: 4px;
}

/* List styles */
.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.sidebar ul li {
    margin: 10px 0;
}

.sidebar ul li a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s, transform 0.3s;
}

.sidebar ul li a:hover {
    background-color: rgba(122, 40, 203, 0.1);
    color: var(--astro-start);
    transform: translateX(5px);
}

.sidebar ul li a i {
    margin-right: 10px;
    font-size: 1.1em;
}

/* Paper info section */
.paper-info {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.paper-info h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #222;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.3;
}

.gradient-title {
    background: linear-gradient(90deg, var(--astro-start), var(--astro-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.title-logo {
    height: 0.8em;
    width: 0.9em;
    vertical-align: -0.1em;
    margin-right: 8px;
}

.authors {
    margin: 30px 0;
    text-align: center;
}

.author-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 0;
    line-height: 2;
    margin-bottom: 10px;
}

.author {
    color: #333;
    font-weight: 500;
    font-size: 1.05em;
}

.author a {
    color: var(--astro-mid);
    text-decoration: none;
    transition: color 0.3s;
}

.author a:hover {
    color: var(--astro-start);
    text-decoration: underline;
}

.author-sep {
    color: #888;
    margin: 0 8px;
    font-size: 1.05em;
}

.author-row sup {
    font-size: 0.7em;
    color: var(--astro-mid);
    font-weight: 600;
    vertical-align: super;
    margin: 0 2px;
}

.affiliation-row {
    color: #555;
    font-size: 1em;
    margin-top: 8px;
    letter-spacing: 0.01em;
}

.affiliation-row sup {
    font-size: 0.75em;
    color: var(--astro-mid);
    font-weight: 600;
    margin-right: 2px;
}

.links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.links p {
    margin: 0;
}

.links a {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--astro-start), var(--astro-mid));
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 12px rgba(122, 40, 203, 0.3);
}

.links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(122, 40, 203, 0.4);
}

/* Teaser section */
.teaser-section {
    margin: 40px 0;
    text-align: center;
}

.teaser-image {
    width: 100%;
    max-width: 1200px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.teaser-caption {
    font-size: 1em;
    color: #555;
    line-height: 1.8;
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
    padding: 0 20px;
}

/* TL;DR section */
.tldr-section {
    background: linear-gradient(135deg, #f8f4ff 0%, #f0f7ff 100%);
    padding: 20px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin: 20px 0;
    text-align: left;
    border-left: 4px solid var(--astro-start);
}

.tldr-section h2 {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--astro-start);
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
}

.tldr-section h2::before {
    content: '💡';
    margin-right: 8px;
    font-size: 1em;
}

.tldr-section p {
    font-size: 0.95em;
    line-height: 1.6;
    color: #444;
    margin-bottom: 8px;
}

.tldr-section strong {
    color: var(--astro-start);
    font-weight: 600;
}

.tldr-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.tldr-list li {
    position: relative;
    padding: 6px 0 6px 24px;
    font-size: 0.92em;
    line-height: 1.5;
    color: #444;
    border-bottom: 1px solid rgba(122, 40, 203, 0.08);
}

.tldr-list li:last-child {
    border-bottom: none;
}

.tldr-list li::before {
    content: '→';
    position: absolute;
    left: 6px;
    top: 6px;
    color: var(--astro-start);
    font-weight: bold;
    font-size: 1em;
}

.tldr-list li strong {
    color: #222;
}

/* Abstract section */
.abstract-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin: 40px 0;
    text-align: left;
}

.abstract-section h2 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 25px;
    color: #222;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
}

.abstract-section p {
    font-size: 1.05em;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
}

.abstract-section strong {
    color: var(--astro-start);
    font-weight: 600;
}

/* Method section */
.method-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin: 40px 0;
}

.method-section h2 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 30px;
    color: #222;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
}

.method-section h3 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 30px 0 20px 0;
    color: #333;
}

.method-image {
    width: 100%;
    max-width: 1200px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin: 20px auto;
    display: block;
}

.method-caption {
    font-size: 0.95em;
    color: #666;
    line-height: 1.7;
    margin: 15px 0 30px 0;
    text-align: center;
}

.method-components {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.component-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--astro-start);
    transition: transform 0.3s, box-shadow 0.3s;
}

.component-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(122, 40, 203, 0.15);
}

.component-card h4 {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--astro-start);
}

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

.component-card p {
    font-size: 0.95em;
    line-height: 1.7;
    color: #555;
}

/* Gallery sections */
.gallery-section {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin: 40px 0;
}

.gallery-section h2 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #222;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
}

.gallery-section h3 {
    font-size: 1.1em;
    font-weight: 400;
    color: #666;
    text-align: center;
    margin-bottom: 25px;
}

/* Speed controls */
.speed-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.speed-label {
    font-weight: 600;
    color: #555;
}

.speed-btn {
    padding: 8px 16px;
    border: 2px solid var(--astro-mid);
    background: white;
    color: var(--astro-mid);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.speed-btn:hover {
    background: var(--astro-mid);
    color: white;
}

.speed-btn.active {
    background: var(--astro-start);
    border-color: var(--astro-start);
    color: white;
}

/* Gallery grid */
.gallery-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-video {
    width: 100%;
    height: auto;
    display: block;
}

.prompt-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px;
    font-size: 0.9em;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .prompt-overlay {
    opacity: 1;
}

.resolution {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(122, 40, 203, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

/* Ablation section */
.ablation-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.ablation-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.ablation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.ablation-card h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--astro-start);
    text-align: center;
}

.ablation-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.ablation-card p {
    font-size: 0.95em;
    line-height: 1.7;
    color: #555;
}

/* Contact section */
.contact-us {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin: 40px 0;
    text-align: center;
}

.contact-us h2 {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 20px;
    color: #222;
    font-family: 'Montserrat', sans-serif;
}

.citation-container {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.citation-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
    max-width: 800px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.citation-box pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Mobile warning */
#mobile-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--astro-start), var(--astro-mid));
    color: white;
    padding: 20px;
    text-align: center;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#mobile-warning button {
    margin-top: 15px;
    padding: 10px 25px;
    background: white;
    color: var(--astro-start);
    border: none;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

#mobile-warning button:hover {
    transform: scale(1.05);
}

@media screen and (max-width: 768px) {
    #mobile-warning {
        display: block;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Interactive grid (for dynamic content) */
.interactive-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Fullwidth video item - one video per row */
.fullwidth-video-item {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #000;
}

.fullwidth-video {
    width: 100%;
    height: auto;
    display: block;
}

/* Compare grid headers */
.compare-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 10px;
}

/* 4-column compare grid headers */
.compare-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 10px;
    margin-top: 30px;
}

/* Compare videos container */
.compare-videos-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Single comparison row (4 videos) */
.comparison-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.comparison-row .video-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.comparison-row .video-item video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Responsive 4-column grid */
@media screen and (max-width: 1200px) {
    .compare-grid-4,
    .comparison-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .compare-grid-4 .col-header:nth-child(n+3) {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .compare-grid-4,
    .comparison-row {
        grid-template-columns: 1fr;
    }

    .compare-grid-4 .col-header {
        display: none;
    }
}

.col-header {
    text-align: center;
    font-weight: 700;
    font-size: 0.95em;
    color: var(--astro-start);
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    white-space: nowrap;
}

/* Video placeholder & lazy-load styling */
.comparison-row .video-item video,
.gallery-item video {
    background: #111;               /* dark bg while video loads */
    aspect-ratio: 16 / 9;           /* reserve space before load */
    object-fit: cover;
}

/* Subtle loading indicator for videos that haven't loaded yet */
.video-item video:not([src]) {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* Sentinel element (invisible spacer for progressive row loading) */
.comparison-sentinel {
    height: 1px;
    visibility: hidden;
}

/* Comparison labels - displayed above merged videos */
.comparison-labels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 15px;
    padding: 0;
}

.comparison-labels .label-wrapper {
    position: relative;
    overflow: hidden;
}

.comparison-labels .label-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    z-index: 0;
}

.comparison-labels .label-wrapper .label {
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
    font-weight: 600;
    font-size: 0.95em;
    color: #555;
    padding: 14px 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(248,249,250,0.95) 100%);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.02em;
}

.comparison-labels .label-wrapper:hover .label {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Ours column - highlighted style */
.comparison-labels .label-wrapper.ours {
    position: relative;
}


.comparison-labels .label-wrapper.ours::before {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.comparison-labels .label-wrapper.ours .label {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 50%, #27ae60 100%);
    background-size: 200% 200%;
    color: white;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    animation: gradientShift 3s ease infinite;
}

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

.comparison-labels .label-wrapper.ours .label::after {
    content: '★';
    margin-left: 6px;
    font-size: 0.85em;
}

/* Comparison row prompt overlay - appears on hover */
.comparison-row {
    position: relative;
}

.comparison-prompt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(122, 40, 203, 0.92), rgba(0, 210, 255, 0.88));
    color: white;
    padding: 10px 14px;
    font-size: 0.85em;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    max-height: 80px;
    overflow-y: auto;
}

.comparison-prompt-overlay i {
    margin-right: 6px;
    opacity: 0.8;
    font-size: 0.8em;
}

.comparison-row:hover .comparison-prompt-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar styling for prompt overlay */
.comparison-prompt-overlay::-webkit-scrollbar {
    width: 6px;
}

.comparison-prompt-overlay::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.comparison-prompt-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

.comparison-prompt-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}
