/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    color: #2d3748;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container and layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background-color: #ffffff;
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #1a202c;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
}

p {
    margin-bottom: 1rem;
    text-align: justify;
    hyphens: auto;
}

/* Links */
a {
    color: #3182ce;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #2c5282;
    text-decoration: underline;
}

/* Header section */
.paper-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.paper-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .paper-title {
        font-size: 2rem;
    }
}

.author-info {
    margin-top: 1.5rem;
}

.authors {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.author {
    margin-right: 1rem;
}

.affiliations {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.affiliation {
    margin-right: 1rem;
}

.contact {
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.paper-btn {
    background-color: #1e40af;
    color: white;
    border-color: #000000;
    border-width: 2px;
}

.paper-btn:hover {
    background-color: #1d4ed8;
    border-color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
}

.code-btn {
    background-color: #1e40af;
    color: white;
    border-color: #000000;
    border-width: 2px;
}

.code-btn:hover {
    background-color: #1d4ed8;
    border-color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
}

.btn-icon {
    font-size: 1.1rem;
}

.btn-text {
    font-weight: 500;
}

@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .action-btn {
        width: 200px;
        justify-content: center;
    }
}

/* Abstract section */
.abstract {
    background-color: #f7fafc;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #3182ce;
}

.abstract h2 {
    margin-top: 0;
    color: #2d3748;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

.abstract p {
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.7;
}

/* Content sections */
.content-section {
    margin-bottom: 2.5rem;
}

/* Lists */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Media figures */
.media-figure {
    margin: 2rem 0;
    text-align: center;
}

.media-figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
}

.media-figure img:hover {
    transform: scale(1.02);
}

.teaser-image {
    max-width: 800px;
    border: 2px solid #e2e8f0;
    background-color: #f8f9fa;
    pointer-events: none; /* Disable any interaction */
    user-select: none; /* Prevent text selection */
    cursor: default; /* Show default cursor, not pointer */
    touch-action: none; /* Disable touch interactions */
    -webkit-user-drag: none; /* Disable dragging on webkit browsers */
}

.large-image {
    max-width: 100%;
    height: auto;
    border: 2px solid #e2e8f0;
    background-color: #f8f9fa;
    pointer-events: none; /* Disable any interaction */
    user-select: none; /* Prevent text selection */
    cursor: default; /* Show default cursor, not pointer */
    touch-action: none; /* Disable touch interactions */
    -webkit-user-drag: none; /* Disable dragging on webkit browsers */
}

.demo-video {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

figcaption {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #4a5568;
    text-align: left;
    line-height: 1.5;
    font-style: italic;
}

/* Tables */
.table-container {
    margin: 2rem 0;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    font-size: 0.9rem;
}

.results-table caption {
    padding: 1rem;
    background-color: #f7fafc;
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.results-table th,
.results-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.results-table th {
    background-color: #edf2f7;
    font-weight: 600;
    color: #2d3748;
}

.results-table tbody tr:hover {
    background-color: #f7fafc;
}

.results-table .highlight {
    background-color: #e6fffa;
}

.results-table .highlight:hover {
    background-color: #b2f5ea;
}

/* References section */
.references {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.references h2 {
    margin-top: 0;
}

.references ol {
    list-style-type: decimal;
}

.references li {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Footer */
.paper-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #4a5568;
    font-size: 0.9rem;
}

.paper-footer p {
    margin-bottom: 0.5rem;
}

.updated {
    font-style: italic;
    color: #718096;
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 1.875rem;
    }
    
    h2 {
        font-size: 1.375rem;
    }
    
    .abstract {
        padding: 1.5rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .results-table {
        font-size: 0.8rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.5rem;
    }
}

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

/* Selection styles */
::selection {
    background-color: #bee3f8;
    color: #1a202c;
}

/* Focus styles for accessibility */
a:focus,
video:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

/* Video Controls */
.video-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.video-btn {
    background-color: #3182ce;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.video-btn:hover {
    background-color: #2c5282;
}

.progress-container {
    flex: 1;
    margin: 0 1rem;
}

.progress-bar {
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background-color: #3182ce;
    transition: width 0.1s ease;
}

.time-display {
    font-size: 0.85rem;
    color: #4a5568;
    font-family: monospace;
    min-width: 100px;
}

.speed-control {
    padding: 0.25rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background-color: white;
    font-size: 0.85rem;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: #e2e8f0;
    outline: none;
    border-radius: 2px;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #3182ce;
    cursor: pointer;
    border-radius: 50%;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #3182ce;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

/* Image Viewer Styles */
.image-viewer-wrapper {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f7fafc;
}

.image-viewer-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
    cursor: grab;
    position: relative;
    background: linear-gradient(45deg, #f7fafc 25%, transparent 25%),
                linear-gradient(-45deg, #f7fafc 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, #f7fafc 75%),
                linear-gradient(-45deg, transparent 75%, #f7fafc 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.image-viewer-container:active {
    cursor: grabbing;
}

.scrollable-image {
    max-width: none;
    max-height: none;
    width: auto;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.image-controls {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    justify-content: center;
}

.image-controls .video-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
}

/* Fullscreen Image Overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: zoom-out;
}

.fullscreen-image {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
}

.fullscreen-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.fullscreen-close:hover {
    background-color: rgba(255, 255, 255, 1);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3182ce, #63b3ed);
    z-index: 1000;
    transition: width 0.1s ease;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .video-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .video-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .progress-container {
        order: -1;
        width: 100%;
        margin: 0 0 0.5rem 0;
    }
    
    .time-display {
        font-size: 0.75rem;
        min-width: 80px;
    }
    
    .volume-slider {
        width: 60px;
    }
    
    .image-viewer-container {
        height: 300px;
    }
    
    .image-controls {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.75rem;
    }
    
    .fullscreen-close {
        top: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .scrollable-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Keyboard Navigation */
.video-btn:focus,
.speed-control:focus,
.volume-slider:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

/* Loading States */
.demo-video:not([src]) {
    background: linear-gradient(45deg, #f7fafc, #e2e8f0);
    background-size: 20px 20px;
    animation: loading 1s linear infinite;
}

@keyframes loading {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

/* Smooth Transitions */
.media-figure,
.image-viewer-wrapper,
.video-controls {
    transition: box-shadow 0.2s ease;
}

.media-figure:hover,
.image-viewer-wrapper:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Simple Dropdown Panel Styles */
.simple-dropdown-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.simple-dropdown-panel h3 {
    color: white;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.5rem;
}

.simple-selectors {
    margin-bottom: 2rem;
}

.main-media-dropdown {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-media-dropdown:hover {
    background-color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.main-media-dropdown optgroup {
    font-weight: bold;
    color: #2d3748;
    background-color: #f7fafc;
}

.main-media-dropdown option {
    padding: 0.5rem;
    color: #4a5568;
    background-color: white;
}

/* Simple Media Display */
.simple-media-display {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.simple-placeholder {
    text-align: center;
    color: #4a5568;
    padding: 2rem;
}

.simple-placeholder .placeholder-content h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.simple-placeholder .placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* Selected Media Container */
.selected-media-container {
    width: 100%;
    padding: 1.5rem;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.media-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.media-header h4 {
    color: #2d3748;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.media-info {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.info-tag {
    background-color: #4299e1;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.simple-media-description {
    background-color: #f7fafc;
    color: #2d3748;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #4299e1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.simple-media-figure {
    margin: 1.5rem 0;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: white;
    overflow: hidden;
}

.simple-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.simple-actions .video-btn {
    background-color: #4a5568;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.simple-actions .video-btn:hover {
    background-color: #2d3748;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Media Library Section */
.media-library-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid #3182ce;
    margin: 3rem 0;
}

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

.feature-item {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #4299e1;
    font-size: 0.9rem;
}

/* Library Added Media Indicator */
.library-added {
    position: relative;
    border: 2px solid #48bb78 !important;
    background-color: #f0fff4 !important;
}

.library-added::before {
    content: "📋 From Library";
    position: absolute;
    top: -12px;
    left: 20px;
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Fullscreen Video */
.fullscreen-video {
    max-width: 95vw;
    max-height: 95vh;
    border-radius: 8px;
}

/* Mobile Responsive for Simple Dropdown */
@media (max-width: 768px) {
    .simple-dropdown-panel {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .media-info {
        flex-direction: column;
        align-items: center;
    }
    
    .simple-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .simple-actions .video-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .library-features {
        grid-template-columns: 1fr;
    }
    
    .selected-media-container {
        padding: 1rem;
    }
}

/* Print styles */
@media print {
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        margin: 0;
        padding: 0;
    }
}

/* Media Library Styles */
.media-library-grid {
    margin: 2rem 0;
}

.library-category {
    margin-bottom: 3rem;
}

.library-category h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    font-size: 1.3rem;
}

.media-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.media-thumbnail {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: #ffffff;
    border: 2px solid #e2e8f0;
}

.media-thumbnail:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: #3182ce;
}

.media-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-thumbnail:hover img {
    transform: scale(1.05);
}

.thumbnail-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.media-thumbnail:hover .thumbnail-overlay {
    transform: translateY(0);
}

.thumbnail-title {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.thumbnail-type {
    display: inline-block;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.media-thumbnail:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(59, 130, 246, 0.9);
}

/* Media Viewer Modal Styles */
.media-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    color: #2d3748;
}

.modal-close {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.media-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    cursor: grab;
    transition: transform 0.2s ease;
}

.modal-image.dragging {
    cursor: grabbing;
}

.modal-video {
    width: 100%;
    height: auto;
    max-height: 70vh;
}

.media-description {
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
}

.media-description h4 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
}

.media-description p {
    margin: 0;
    color: #4a5568;
    line-height: 1.6;
}

.media-controls {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    justify-content: center;
}

.control-button {
    background: #3182ce;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-button:hover {
    background: #2c5aa0;
    transform: translateY(-1px);
}

.control-button.secondary {
    background: #718096;
}

.control-button.secondary:hover {
    background: #4a5568;
}

.zoom-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.zoom-level {
    font-size: 0.9rem;
    color: #4a5568;
    min-width: 60px;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .media-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .modal-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 1vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .media-description {
        padding: 1rem;
    }
    
    .media-controls {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
}
    
    .media-figure img,
    .demo-video {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
    
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    /* Hide URLs for action buttons */
    .action-btn::after {
        content: none;
    }

/* Results Section Styles */
.evaluation-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.eval-category {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #3182ce;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.eval-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.eval-category h3 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1.2rem;
}

.eval-category p {
    margin: 0;
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.5;
}

.results-category {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
}

.results-category:first-child {
    border-top: none;
}

.results-category h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* Manipulation Videos */
.manipulation-videos {
    margin: 2rem 0;
}

.video-pair {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin: 1.5rem 0;
}

.manipulation-demo video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Performance Metrics */
.performance-metrics {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.metric-item {
    text-align: center;
    padding: 1rem;
}

.metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #3182ce;
    margin-bottom: 0.5rem;
}

.metric-label {
    display: block;
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

/* Gallery Styles */
.panorama-gallery, .video-generation-gallery {
    margin: 2rem 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.gallery-grid {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gallery-placeholder {
    text-align: center;
    color: #4a5568;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

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

.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
}

.gallery-btn {
    background: #3182ce;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.gallery-btn:hover {
    background: #2c5aa0;
}

.gallery-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.gallery-counter {
    font-weight: 500;
    color: #4a5568;
}

/* Gallery Items */
.gallery-item {
    width: 100%;
    height: 400px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.video-grid .gallery-item {
    height: 300px;
}

/* Metrics Display */
.panorama-metrics, .video-metrics {
    margin: 2rem 0;
}

.metric-group {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #22c55e;
}

.metric-group h4 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-name {
    font-weight: 500;
    color: #4a5568;
}

.metric-row .metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: #22c55e;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .evaluation-overview {
        grid-template-columns: 1fr;
    }
    
    .video-pair {
        grid-template-columns: 1fr;
    }
    
    .performance-metrics {
        flex-direction: column;
        gap: 1rem;
    }
    
    .gallery-controls {
        padding: 1rem;
    }
}