/* Patterkin Video Archive Styles */

/* Dark Mode CSS Variables */
:root {
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --accent-primary: #007bff;
    --accent-secondary: #ff6b6b;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-dark: rgba(0, 0, 0, 0.3);
    --video-bg: #000000;
    --input-bg: #ffffff;
    --input-border: #e1e5e9;
    --card-bg: #ffffff;
    --modal-bg: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.8);
}

/* Dark mode colors */
[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --border-color: #3a3a3a;
    --border-light: #2a2a2a;
    --accent-primary: #4dabf7;
    --accent-secondary: #ff6b6b;
    --shadow-light: rgba(0, 0, 0, 0.6);
    --shadow-medium: rgba(0, 0, 0, 0.8);
    --shadow-dark: rgba(0, 0, 0, 0.95);
    --video-bg: #000000;
    --input-bg: #1e1e1e;
    --input-border: #3a3a3a;
    --card-bg: #1e1e1e;
    --modal-bg: #1e1e1e;
    --overlay-bg: rgba(0, 0, 0, 0.9);
}

/* Theme transition for smooth switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Authentication Modal Styles */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.auth-modal.is-visible {
    display: flex;
}

.auth-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

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

.auth-header {
    text-align: center;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #eee;
}

.auth-header h1 {
    color: var(--text-primary);
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
}

.auth-header p {
    color: #666;
    font-size: 16px;
}

.auth-form {
    padding: 30px;
}

.auth-form h2 {
    color: var(--text-primary);
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.auth-button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.auth-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-switch {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.auth-loading {
    text-align: center;
    padding: 40px 30px;
}

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

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

.auth-loading p {
    color: #666;
    font-size: 16px;
}

.auth-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 20px 30px;
    font-size: 14px;
    text-align: center;
}

/* Header Controls */
.header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-menu span {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.hamburger-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.hamburger-button:hover {
    background: #f8f9fa;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #333;
    transition: all 0.3s ease;
}

.hamburger-button.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-button.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-button.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.logout-button {
    background: none;
    border: none;
    color: #6c757d;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.logout-button:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-primary);
    transition: all 0.3s ease;
    margin-left: 10px;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(180deg);
    position: absolute;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

header {
    background: var(--bg-primary);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px var(--shadow-light);
    margin-bottom: 0;
}

header h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 600;
}

header h1 a:hover {
    color: var(--accent-primary);
    transition: color 0.3s ease;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.tape-selector {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tape-selector label {
    color: #cccccc;
    font-size: 1rem;
    font-weight: 500;
}

.tape-selector select {
    background-color: #333;
    color: #ffffff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 1rem;
    min-width: 200px;
}

.tape-selector select:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

.tape-selector select option {
    background-color: #333;
    color: #ffffff;
}

/* Responsive 4:3 Video Container */
.video-container {
    position: relative;
    width: 100%;
    max-width: 720px; /* Match typical video width */
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    /* Optimize for faster rendering */
    transform: translateZ(0);
    will-change: transform;
    /* Ensure container fits content exactly */
    display: inline-block;
}

/* Video.js player styling with responsive 4:3 aspect ratio */
.video-js {
    width: 100%;
    height: auto;
    background: #000;
    /* Let Video.js handle its own sizing based on aspect ratio */
    display: block;
    /* Ensure no extra height */
    min-height: 0;
    max-height: none;
    /* Force 4:3 aspect ratio */
    aspect-ratio: 4/3;
}

/* Override Video.js fluid sizing to maintain 4:3 */
.video-js.vjs-fluid {
    padding-top: 75% !important; /* 4:3 aspect ratio */
    height: 0 !important;
}

.video-js.vjs-fluid .vjs-tech {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Ensure video content fits properly in the container */
.video-js .vjs-tech {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
}

.video-js video {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
}

/* Fullscreen specific styling for 4:3 videos */
.video-js.vjs-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: #000 !important;
}

.video-js.vjs-fullscreen .vjs-tech {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
}

.video-js.vjs-fullscreen video {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
}

/* Tablet optimizations */
@media (max-width: 1024px) and (min-width: 769px) {
    .video-container {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .video-container {
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        width: 100vw;
        max-width: none;
        border-radius: 0;
    }
    
    .video-js .vjs-tech {
        object-fit: contain !important;
        width: 100% !important;
        height: auto !important;
    }
}

/* Large desktop optimizations */
@media (min-width: 1200px) {
    .video-container {
        max-width: 800px;
        margin: 0 auto;
    }
}

.video-js .vjs-big-play-button {
    background-color: rgba(255, 107, 107, 0.8);
    border: none;
    border-radius: 50%;
    font-size: 2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-js .vjs-big-play-button:hover {
    background-color: rgba(255, 107, 107, 1);
    transform: scale(1.1);
}

.video-js .vjs-big-play-button:focus {
    outline: 3px solid #ff6b6b !important;
    outline-offset: 2px !important;
    background-color: rgba(255, 107, 107, 1);
}


.video-info {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 12px var(--shadow-light);
}

.video-info h2 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 600;
}

.metadata {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.metadata p {
    background: var(--bg-secondary);
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 3px solid var(--accent-primary);
    color: var(--text-primary);
}

.metadata strong {
    color: var(--accent-primary);
}

/* Current Scene Info Styles */
.current-scene-info {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px var(--shadow-light);
    border-left: 4px solid var(--accent-primary);
    transition: all 0.3s ease;
}

.current-scene-loading,
.current-scene-empty {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.current-scene-header {
    margin-bottom: 15px;
}

.current-scene-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.current-scene-time {
    color: var(--accent-primary);
    font-weight: bold;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    min-width: 70px;
}

.current-scene-title {
    flex: 1;
    margin: 0;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.3;
}

.current-scene-watch-indicator {
    margin-left: auto;
}

.current-scene-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.current-scene-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.current-scene-reactions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.current-scene-reactions .reaction-wrapper {
    background: var(--bg-secondary);
    border-radius: 999px;
    padding: 8px 16px;
    box-shadow: 0 2px 6px var(--shadow-light);
}

.scenes h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

#scenes-list {
    list-style: none;
}

#scenes-list li {
    background: var(--bg-secondary);
    margin-bottom: 8px;
    padding: 12px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
    color: var(--text-primary);
}

#scenes-list li:hover {
    background: var(--bg-tertiary);
    border-left-color: var(--accent-primary);
}

.scene-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.scene-time {
    color: var(--accent-primary);
    font-weight: bold;
    margin-right: 10px;
    min-width: 60px;
}

.scene-title {
    font-weight: 500;
    flex: 1;
}

.watch-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: background-color 0.2s, color 0.2s;
}

.watch-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.watch-indicator[data-status="unwatched"] {
    color: #d32f2f;
    background: rgba(211, 47, 47, 0.12);
}

.watch-indicator[data-status="partial"] {
    color: #f57c00;
    background: rgba(245, 124, 0, 0.12);
}

.watch-indicator[data-status="watched"] {
    color: #2e7d32;
    background: rgba(46, 125, 50, 0.15);
}

[data-theme="dark"] .watch-indicator[data-status="unwatched"] {
    background: rgba(211, 47, 47, 0.12);
    color: #d32f2f;
}

[data-theme="dark"] .watch-indicator[data-status="partial"] {
    background: rgba(245, 124, 0, 0.12);
    color: #f57c00;
}

[data-theme="dark"] .watch-indicator[data-status="watched"] {
    background: rgba(46, 125, 50, 0.15);
    color: #2e7d32;
}

.scene-header .scene-watch-indicator {
    margin-left: 12px;
    padding: 2px 6px;
    font-size: 0.7rem;
}

.scene-header .scene-watch-indicator .watch-indicator-label {
    font-weight: 500;
}

#tape-watch-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 12px;
}

#tape-watch-status .watch-indicator-dot {
    width: 12px;
    height: 12px;
}

#tape-watch-status .watch-indicator-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.watch-indicator-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.scene-header .scene-watch-indicator[data-status="watched"] {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
}

[data-theme="dark"] .scene-header .scene-watch-indicator[data-status="watched"] {
    background: rgba(46, 125, 50, 0.12);
    color: #2e7d32;
}

#scenes-list li[data-watch-status="watched"] {
    border-left-color: #2e7d32;
    background: rgba(46, 125, 50, 0.08);
}

[data-theme="dark"] #scenes-list li[data-watch-status="watched"] {
    background: rgba(46, 125, 50, 0.08);
    border-left-color: #2e7d32;
}

.video-card .video-watch-indicator {
    position: relative;
    bottom: auto;
    left: auto;
    z-index: auto;
    pointer-events: auto;
    margin: 0;
}

.video-card .video-watch-indicator .watch-indicator-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.video-card[data-watch-status="watched"] {
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.2);
}

.scene-card[data-watch-status="watched"] {
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.18);
}

[data-theme="dark"] .scene-card[data-watch-status="watched"] {
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.18);
}

.scene-card-watch-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 6;
    pointer-events: none;
}

.scene-card-watch-overlay .scene-card-watch-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(211, 47, 47, 0.9);
    box-shadow: 0 0 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
    display: inline-block;
}

.scene-card-watch-indicator[data-status="watched"] {
    background: rgba(46, 125, 50, 0.9);
}

[data-theme="dark"] .scene-card-watch-indicator[data-status="unwatched"] {
    background: rgba(211, 47, 47, 0.9);
}

[data-theme="dark"] .scene-card-watch-indicator[data-status="watched"] {
    background: rgba(46, 125, 50, 0.9);
}

.scene-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.scene-date {
    color: #4CAF50;
    font-size: 0.85rem;
    background: rgba(76, 175, 80, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.scene-location {
    color: #2196F3;
    font-size: 0.85rem;
    background: rgba(33, 150, 243, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.scene-people {
    color: #FF9800;
    font-size: 0.85rem;
    background: rgba(255, 152, 0, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Dark mode adjustments for scene meta tags */
[data-theme="dark"] .scene-date {
    background: rgba(76, 175, 80, 0.2);
}

[data-theme="dark"] .scene-location {
    background: rgba(33, 150, 243, 0.2);
}

[data-theme="dark"] .scene-people {
    background: rgba(255, 152, 0, 0.2);
}

.scene-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.scene-loading {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
    border-radius: 4px;
    border-left: 3px solid #ffc107;
    margin-top: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
    /* Authentication responsive styles */
    .auth-modal {
        padding: 10px;
    }
    
    .auth-container {
        max-width: 100%;
        margin: 0;
        border-radius: 8px;
    }
    
    .auth-header {
        padding: 20px 20px 15px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .auth-form {
        padding: 20px;
    }
    
    .auth-form h2 {
        font-size: 20px;
    }
    
    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .auth-button {
        padding: 16px;
        font-size: 16px;
    }
    
    .header-controls {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }
    
    .tape-selector {
        width: 100%;
    }
    
    .tape-selector select {
        width: 100%;
        font-size: 16px;
        padding: 12px;
    }
    
    .user-menu {
        justify-content: flex-end;
        flex-wrap: nowrap;
        flex-shrink: 0;
        gap: 8px;
    }
    
    .container {
        padding: 10px;
    }
}

/* Smart TV and large screen styles */
@media (min-width: 1920px) {
    .auth-container {
        max-width: 500px;
    }
    
    .auth-header h1 {
        font-size: 32px;
    }
    
    .auth-form h2 {
        font-size: 28px;
    }
    
    .form-group input {
        padding: 16px 20px;
        font-size: 18px;
    }
    
    .auth-button {
        padding: 18px;
        font-size: 18px;
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .tape-selector select {
        font-size: 18px;
        padding: 16px;
    }
    
    .user-menu span {
        font-size: 16px;
    }
    
    .logout-button {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .metadata {
        grid-template-columns: 1fr;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error states */
.error {
    color: var(--accent-secondary);
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--accent-secondary);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Sprite Preview Styles */
.sprite-preview {
    position: fixed;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    border: 0;
    outline: none;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transform: translateX(-50%) translateY(-180px);
}

.sprite-image {
    width: 160px;
    height: 120px;
    background-size: 1600px 840px; /* Full sprite sheet size */
    background-repeat: no-repeat;
    border-radius: 4px;
    overflow: hidden;
}

.sprite-time {
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    margin-top: 4px;
    background: rgba(255, 107, 107, 0.8);
    padding: 2px 6px;
    border-radius: 3px;
}

/* Video.js progress bar hover enhancement */
.video-js .vjs-progress-control:hover {
    cursor: pointer;
}

.video-js .vjs-progress-control .vjs-progress-holder {
    cursor: pointer;
}

/* Search Highlight Styles */
.search-highlight {
    background-color: #ffeb3b;
    color: #333;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(255, 235, 59, 0.3);
}

/* Transcript Styles */
.transcript {
    margin-top: 25px;
}

.transcript h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
}

.transcript-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

#transcript-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 14px;
}

#transcript-search:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

#toggle-transcript {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

#toggle-transcript:hover {
    background: #0056b3;
}

.transcript-panel {
    background: #f8f9fa;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
}

.transcript-panel::-webkit-scrollbar {
    width: 8px;
}

.transcript-panel::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.transcript-panel::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.transcript-panel::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.transcript-segment {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #333;
}

.transcript-segment:hover {
    background: #e9ecef;
}

.transcript-segment:last-child {
    border-bottom: none;
}

.transcript-segment.highlighted {
    background: rgba(0, 123, 255, 0.1);
    border-left: 3px solid #007bff;
}

.transcript-time {
    color: #007bff;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.transcript-text {
    color: #333;
    line-height: 1.4;
    font-size: 14px;
}

.transcript-text .highlight {
    background: rgba(0, 123, 255, 0.2);
    padding: 1px 2px;
    border-radius: 2px;
}

/* Video.js subtitle styling - clean text overlay */
.video-js .vjs-text-track-display {
    font-size: 20px;
    line-height: 1.3;
    text-align: center;
    bottom: 80px;
}

.video-js .vjs-text-track-cue {
    background: none !important;
    color: #fff !important;
    padding: 0 !important;
    border: none !important;
    font-weight: 600 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9) !important;
    max-width: 90% !important;
    margin: 0 auto !important;
}

.video-js .vjs-text-track-cue div {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    border: none !important;
}

/* Chat System Styles */
.chat-section {
    margin-top: 30px;
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.chat-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.chat-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 16px;
    color: #666;
    transition: all 0.2s ease;
}

.chat-tab:hover {
    color: #333;
    background-color: #f8f9fa;
}

.chat-tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 600;
}

.chat-panel {
    display: none;
}

.chat-panel.active {
    display: block;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 20px 10px 20px;
    border-bottom: 1px solid #eee;
}

.chat-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
}

.chat-controls {
    display: flex;
    gap: 10px;
}

.chat-button {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s ease;
}

.chat-button:hover {
    background: #e9ecef;
    color: #333;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background: var(--bg-secondary);
    margin-bottom: 15px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px var(--shadow-light);
    position: relative;
}

.chat-message-sending {
    opacity: 0.7;
}

.chat-sending-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-top: 8px;
    padding-left: 4px;
}

.chat-sending-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: chat-sending-pulse 1.4s ease-in-out infinite;
}

.chat-sending-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-sending-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chat-sending-pulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.chat-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 10px;
}

.chat-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.chat-timestamp {
    color: var(--text-secondary);
    font-size: 12px;
    margin-left: auto;
}

.chat-message-content {
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.chat-video-link {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.chat-video-link:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.chat-video-link-icon {
    margin-right: 6px;
    color: var(--accent-primary);
}


.chat-reactions {
    margin-top: 8px;
}

.chat-reaction {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.chat-reaction:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.chat-reaction.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.chat-reaction-count {
    font-size: 11px;
    font-weight: 600;
}

.reaction-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
}

.reaction-list {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.reaction-add-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 300;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.reaction-add-btn:hover,
.reaction-add-btn:focus {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.reaction-picker {
    position: absolute;
    bottom: 42px;
    left: 0;
    display: none;
    flex-direction: row;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    z-index: 20;
}

.reaction-picker.open {
    display: flex;
}

.reaction-picker-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.reaction-picker-option:hover,
.reaction-picker-option:focus {
    background: rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.reaction-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.video-reactions-section,
.video-reactions-section h3 {
    display: none;
}

.video-reactions {
    display: inline-flex;
    gap: 12px;
    align-items: center;
}

.scene-reactions {
    margin-top: 12px;
    position: relative;
}

.reaction-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    margin-bottom: 4px;
    max-width: 200px;
    word-wrap: break-word;
    white-space: normal;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.reaction-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
}

/* Desktop: show on hover */
@media (hover: hover) and (pointer: fine) {
    .chat-reaction:hover .reaction-tooltip,
    .chat-reaction:focus .reaction-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile: show on tap (using touch events) */
@media (hover: none) and (pointer: coarse) {
    .chat-reaction.tooltip-active .reaction-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

.chat-input-container {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.chat-input-wrapper input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    background: var(--input-bg);
    color: var(--text-primary);
}

.chat-input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.chat-send-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.chat-send-button:hover {
    background: #0056b3;
}

.chat-send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.chat-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #f5c6cb;
}

/* Video Link Styles */
.video-link-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px;
    border-radius: 8px;
    margin: 8px 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-link-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.video-link-icon {
    font-size: 20px;
}

.video-link-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
}

.video-link-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

/* Main Page Layout Styles */
.main-container {
    min-height: 100vh;
    background: var(--bg-secondary);
}

.main-header {
    background: var(--bg-primary);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.main-header h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 600;
}

.brand-title {
    display: flex;
    align-items: center;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 32px;
}

.primary-nav .nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    position: relative;
    transition: color 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.primary-nav .nav-icon {
    display: none;
    font-size: 20px;
    line-height: 1;
}

.primary-nav .nav-text {
    display: inline;
}

.primary-nav .nav-link:hover,
.primary-nav .nav-link:focus {
    color: var(--accent-primary);
    outline: none;
}

.primary-nav .nav-link.active {
    color: var(--accent-primary);
}

.primary-nav .nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 999px;
}

.main-content {
    display: flex;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* Video Page Layout */
.video-page-content {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 20px;
    min-height: calc(100vh - 80px);
    padding: 20px;
}

.video-section {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
    /* Center the video container */
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Timeline Layout */
.timeline-layout {
    padding: 30px;
    background: var(--bg-secondary);
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-header h2 {
    margin: 0;
    font-size: 26px;
    color: var(--text-primary);
}

.timeline-subtitle {
    margin: 8px 0 0 0;
    color: var(--text-secondary);
    font-size: 15px;
}

.timeline-loading,
.timeline-empty {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 6px var(--shadow-light);
}

.timeline-loading {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
}

.timeline-empty {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
}

.timeline-stream {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

.timeline-month {
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 18px 22px;
    box-shadow: 0 4px 12px var(--shadow-light);
    border-left: 4px solid var(--accent-primary);
}

.timeline-month--empty {
    opacity: 0.65;
    border-left-color: var(--border-color);
}

.timeline-month-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.timeline-month-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-age-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
}

.timeline-birthday-badge {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 193, 7, 0.18);
    color: #b8860b;
    font-weight: 600;
}

.timeline-scenes {
    margin-top: 16px;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.timeline-scene-thumb {
    width: 100%;
    height: 0;
    padding-top: 56%;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    margin-bottom: 14px;
    transition: background-position 0.2s ease, background-size 0.2s ease;
}

.timeline-scene-thumb--empty {
    padding-top: 0;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(120, 120, 120, 0.12), rgba(80, 80, 80, 0.12));
    color: var(--text-tertiary);
    font-size: 13px;
    font-style: italic;
}

.timeline-scene-card {
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 16px 18px;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.timeline-scene-header {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.timeline-scene-title {
    margin: 8px 0 6px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.timeline-scene-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timeline-scene-description {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.timeline-scene-location {
    font-size: 13px;
    color: var(--accent-primary);
    margin-bottom: 10px;
}

.timeline-scene-location::before {
    content: '📍 ';
}

.timeline-scene-actions {
    display: flex;
    justify-content: flex-end;
}

.timeline-scene-link {
    font-size: 14px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.timeline-scene-link:hover,
.timeline-scene-link:focus {
    text-decoration: underline;
}

.timeline-month-empty-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-tertiary);
    font-style: italic;
}

.timeline-year-marker {
    align-self: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    padding: 6px 20px;
    margin: 12px 0;
    border-radius: 999px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    box-shadow: 0 8px 20px var(--shadow-light);
}

.timeline-milestone {
    align-self: center;
    max-width: 520px;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 24px 28px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.timeline-milestone::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(255,255,255,0.18), transparent 65%);
    pointer-events: none;
}

.timeline-milestone h3 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: var(--accent-primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.timeline-milestone p {
    margin: 0;
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.timeline-milestone--birth {
    border-color: rgba(76, 175, 80, 0.45);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.12), var(--bg-primary));
}

.timeline-milestone--teen {
    border-color: rgba(33, 150, 243, 0.45);
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.12), var(--bg-primary));
}

.timeline-milestone--adult {
    border-color: rgba(255, 193, 7, 0.45);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.16), var(--bg-primary));
}

.video-details {
    grid-column: 1;
    grid-row: 3;
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
    align-items: start;
}

@media (min-width: 1024px) {
    .video-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

.video-details .video-info {
    max-width: none;
    margin: 0;
}


.video-chat-panel {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-light);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-section {
    grid-column: 2;
    grid-row: 1 / 4;
    display: flex;
    flex-direction: column;
}

/* Video Gallery Section */
.video-gallery-section {
    flex: 1;
    padding: 30px;
    background: var(--bg-secondary);
    overflow-y: auto;
    margin-right: 300px; /* Account for fixed chat sidebar */
}

.gallery-header {
    margin-bottom: 30px;
    padding: 0;
}

.gallery-header h2 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
}

.gallery-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.gallery-controls input,
.gallery-controls select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    background: var(--input-bg);
    color: var(--text-primary);
}

.gallery-controls input:focus,
.gallery-controls select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.gallery-controls input {
    flex: 1;
    max-width: 300px;
}

/* Video Cards Grid */
.video-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

/* Scene Cards */
.scene-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer !important;
    position: relative;
    height: 420px; /* Match video card height for consistent grid layout */
    display: flex;
    flex-direction: column;
}

.scene-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.scene-card-image {
    position: relative;
    width: 100%;
    height: 360px; /* Match video card image height for consistent layout */
    overflow: hidden;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.scene-card:hover .scene-card-image img {
    transform: scale(1.05);
}

.scene-card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.scene-card-title {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.scene-card-tape-info {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.scene-card-description {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.scene-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.scene-card-meta span {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.scene-card-time-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    z-index: 5;
}

.scene-card-tape-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    z-index: 5;
}

/* Cycling animations */
.video-card-title {
    transition: opacity 0.8s ease-in-out;
}

.video-card-poster {
    transition: background-position 0.3s ease-in-out;
}

.video-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer !important;
    position: relative;
    height: 420px; /* Increased card height */
    display: flex;
    flex-direction: column;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

.video-card-image {
    position: relative;
    width: 100%;
    height: 360px; /* Increased to fill most of the 420px card */
    overflow: hidden;
    background: #f8f9fa; /* Light background for when image is loading */
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill full width/height, cropping is OK */
    transition: transform 0.3s ease;
}

.video-card:hover .video-card-image img {
    transform: scale(1.05);
}

.video-card-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;
    z-index: 10;
}

.video-card:hover .video-card-overlay {
    opacity: 1 !important;
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #007bff;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.video-card:hover .play-button {
    background: rgba(255,255,255,1);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.video-card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.video-card-title {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    height: 1.3em; /* Fixed height to prevent layout shifts */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.video-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.video-card-year {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.video-card-duration {
    color: #4CAF50;
    font-size: 0.85rem;
    background: rgba(76, 175, 80, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.video-card-people {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.video-card-location {
    color: #2196F3;
    font-size: 0.85rem;
    background: rgba(33, 150, 243, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.video-card-location:before {
    content: "📍 ";
}

/* Dark mode adjustments for video card meta tags */
[data-theme="dark"] .video-card-location {
    background: rgba(33, 150, 243, 0.2);
}

[data-theme="dark"] .video-card-duration {
    background: rgba(76, 175, 80, 0.2);
}

.video-card-full-tape-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 5;
}

/* Chat Sidebar (Desktop) */
.chat-sidebar {
    position: fixed;
    top: 80px; /* Below header */
    right: 0;
    width: 300px;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    z-index: 100;
    padding: 16px;
    box-sizing: border-box;
}

.chat-sidebar .chat-header {
    padding: 0 0 15px 0;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.chat-sidebar .chat-messages {
    flex: 1;
    height: auto;
    max-height: none;
    overflow-y: auto;
    min-height: 0; /* Important for flex scrolling */
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}

.chat-sidebar .chat-input-container {
    padding: 0;
    margin-top: 15px;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.chat-sidebar .chat-input-wrapper {
    width: 100%;
    box-sizing: border-box;
    gap: 8px; /* Reduce gap to save space */
}

.chat-sidebar .chat-input-wrapper input {
    min-width: 0; /* Allow input to shrink */
    flex: 1;
}

.chat-sidebar .chat-send-button {
    flex-shrink: 0; /* Prevent button from shrinking */
    white-space: nowrap;
    padding: 10px 16px; /* Slightly reduce horizontal padding */
}

/* Mobile Chat Button */
.mobile-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.mobile-chat-button:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Mobile Chat Overlay */
.mobile-chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden; /* Prevent overlay from scrolling */
}

.mobile-chat-overlay.active {
    display: flex;
    opacity: 1;
}

/* Prevent body scroll when mobile chat is open */
body.mobile-chat-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.mobile-chat-container {
    background: var(--bg-primary);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow: hidden; /* Prevent container from scrolling */
    touch-action: pan-y; /* Allow vertical scrolling within container */
}

.mobile-chat-overlay.active .mobile-chat-container {
    transform: translateY(0);
}

.mobile-chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.mobile-chat-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
}

.close-chat-button {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-chat-button:hover {
    background: #e9ecef;
}

.mobile-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-secondary);
    min-height: 0; /* Important for flex scrolling */
    max-height: 100%;
    touch-action: pan-y; /* Allow vertical panning (scrolling) */
    overscroll-behavior: contain; /* Prevent scroll chaining */
}

.mobile-chat-input {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    gap: 10px;
}

.mobile-chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
}

.mobile-chat-input input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

/* Loading States */
.gallery-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.gallery-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Scroll Loading Indicator */
#scroll-loading-indicator {
    grid-column: 1 / -1;
    margin: 20px 0;
}

#scroll-loading-indicator .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* End of Content Message */
#end-of-content-message {
    grid-column: 1 / -1;
    margin: 20px 0;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .chat-sidebar {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        height: 300px;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
    
    .video-gallery-section {
        padding: 20px;
        margin-right: 0; /* Remove margin on tablet/mobile */
    }
    
    .video-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 12px 15px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .main-header h1 {
        font-size: 20px;
        white-space: nowrap;
    }
    
    .brand-title {
        flex-shrink: 0;
    }
    
    .primary-nav {
        margin: 0 8px;
        flex-shrink: 1;
        min-width: 0;
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .primary-nav .nav-link {
        font-size: 14px;
        white-space: nowrap;
        padding: 6px;
        border-radius: 6px;
        transition: background-color 0.2s ease;
    }
    
    .primary-nav .nav-link:hover {
        background-color: var(--bg-secondary);
    }
    
    .primary-nav .nav-icon {
        display: inline-block;
        font-size: 22px;
    }
    
    .primary-nav .nav-text {
        display: none;
    }
    
    .primary-nav .nav-link.active::after {
        display: none;
    }
    
    .primary-nav .nav-link.active {
        background-color: var(--bg-secondary);
    }
    
    .header-controls {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .theme-toggle {
        margin-left: 0;
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .user-menu {
        justify-content: flex-end;
        flex-wrap: nowrap;
        flex-shrink: 0;
        gap: 8px;
    }
    
    .user-menu span {
        font-size: 13px;
        white-space: nowrap;
    }
    
    .hamburger-button {
        padding: 6px;
    }
    
    .hamburger-line {
        width: 18px;
    }
    
    .video-gallery-section {
        padding: 20px;
        margin-right: 0; /* Remove margin on mobile */
    }

    .timeline-layout {
        padding: 20px;
    }

    .timeline-scenes {
        grid-template-columns: 1fr;
    }
    
    .gallery-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .gallery-controls input,
    .gallery-controls select {
        width: 100%;
        max-width: none;
    }
    
    .video-cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .video-card {
        height: 380px; /* Increased for mobile */
    }
    
    .video-card-image {
        height: 320px; /* Increased for mobile to fill most of the card */
    }
    
    .chat-sidebar {
        display: none;
    }
    
    .mobile-chat-button {
        display: block;
    }
    
    .mobile-chat-messages {
        padding: 15px;
    }
    
    .mobile-chat-input {
        padding: 15px;
    }
    
    /* Video page mobile layout */
    .video-page-content {
        display: block;
        padding: 15px;
    }
    
    .video-section {
        margin-bottom: 20px;
        max-width: none;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        border-radius: 0;
    }
    
    /* Current Scene Info Mobile Styles */
    .current-scene-info {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .current-scene-header {
        position: relative;
        padding-right: 40px; /* Make room for share button */
    }
    
    .current-scene-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .current-scene-time {
        font-size: 0.85rem;
        min-width: auto;
        order: 1;
    }
    
    .current-scene-title {
        font-size: 1.15rem;
        width: 100%;
        order: 2;
        line-height: 1.4;
        margin-bottom: 0;
    }
    
    .current-scene-title-row > .current-scene-watch-indicator {
        margin-left: 0;
        margin-top: 4px;
        order: 3;
        align-self: flex-start;
    }
    
    .current-scene-title-row > .scene-share {
        position: absolute;
        top: 0;
        right: 0;
        margin: 0;
    }
    
    .current-scene-meta {
        gap: 6px;
        margin-top: 10px;
        font-size: 0.85rem;
    }
    
    .current-scene-meta .scene-date,
    .current-scene-meta .scene-location,
    .current-scene-meta .scene-people {
        font-size: 0.8rem;
        padding: 3px 8px;
    }
    
    .current-scene-description {
        font-size: 0.9rem;
        padding-top: 12px;
        margin-bottom: 12px;
        line-height: 1.5;
    }
    
    .current-scene-reactions {
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .current-scene-reactions .reaction-wrapper {
        padding: 6px 12px;
    }
    
    .current-scene-reactions .chat-reaction {
        font-size: 12px;
        padding: 3px 6px;
        min-height: 24px;
    }
    
    .current-scene-reactions .chat-reaction-emoji {
        font-size: 14px;
    }
    
    .current-scene-reactions .reaction-add-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .video-js {
        width: 100vw;
        height: 0;
        padding-bottom: 75vw; /* 4:3 aspect ratio for Video8 recordings */
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        position: relative;
    }
    
    .chat-section {
        margin-top: 20px;
    }
}

/* Chat responsive styles */
@media (max-width: 768px) {
    .chat-messages {
        height: 250px;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
    }
    
    .chat-send-button {
        width: 100%;
    }
    
    .chat-tabs {
        flex-direction: column;
    }
    
    .chat-tab {
        text-align: left;
        border-bottom: none;
        border-right: 2px solid transparent;
    }
    
    .chat-tab.active {
        border-bottom-color: transparent;
        border-right-color: #007bff;
    }
}

/* Transcript Styles */
.transcript {
    margin-top: 25px;
}

.transcript h3 {
    color: var(--accent-secondary);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.transcript-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

#transcript-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
}

#transcript-search:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

#toggle-transcript {
    padding: 8px 16px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

#toggle-transcript:hover {
    background: #ff5252;
}

.transcript-panel {
    background: var(--bg-tertiary);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.transcript-panel::-webkit-scrollbar {
    width: 8px;
}

.transcript-panel::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.transcript-panel::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 4px;
}

.transcript-panel::-webkit-scrollbar-thumb:hover {
    background: #ff5252;
}

.transcript-segment {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.transcript-segment:hover {
    background: var(--bg-tertiary);
}

.transcript-segment:last-child {
    border-bottom: none;
}

.transcript-segment.highlighted {
    background: rgba(255, 107, 107, 0.2);
    border-left: 3px solid var(--accent-secondary);
}

.transcript-time {
    color: var(--accent-secondary);
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
}

.transcript-text {
    color: var(--text-primary);
    line-height: 1.4;
    font-size: 14px;
}

.transcript-text .highlight {
    background: rgba(255, 107, 107, 0.3);
    padding: 1px 2px;
    border-radius: 2px;
}

/* Video.js subtitle styling - clean text overlay */
.video-js .vjs-text-track-display {
    font-size: 20px;
    line-height: 1.3;
    text-align: center;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.video-js .vjs-text-track-cue {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 4px;
    margin: 4px 0;
}

/* Video.js Share Button Styles */
.vjs-share-button {
    cursor: pointer;
    font-family: VideoJS;
    font-weight: normal;
    font-style: normal;
    position: relative;
}

.vjs-share-button:before {
    content: "🔗"; /* Share icon */
    font-size: 1.2em;
    line-height: 1.67;
}

.vjs-share-button:hover:before {
    text-shadow: 0 0 1em #fff;
}

.vjs-share-button:focus {
    outline: 2px solid #00a0d2;
    outline-offset: 2px;
}

.vjs-share-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #2B333F;
    border-radius: 0;
    padding: 0;
    min-width: 160px;
    z-index: 10000;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.vjs-share-dropdown-content {
    display: flex;
    flex-direction: column;
}

.vjs-share-option {
    background: none;
    border: none;
    color: white;
    padding: 8px 16px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
    width: 100%;
    border-radius: 0;
}

.vjs-share-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.vjs-share-option:focus {
    outline: 2px solid #00a0d2;
    outline-offset: -2px;
    background: rgba(255, 255, 255, 0.1);
}

.vjs-share-option-icon {
    font-size: 16px;
}

/* Scene Share Button Styles */
.scene-share-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.scene-share-btn:hover {
    opacity: 1;
    background: #5a6268;
}

.scene-share {
    position: relative;
    margin-left: 12px;
    display: inline-flex;
    align-items: center;
}

.scene-share-dropdown {
    position: absolute;
    top: 50%;
    right: calc(100% + 8px);
    left: auto;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 140px;
    margin-top: 2px;
    animation: slideDown 0.2s ease-out;
    white-space: nowrap;
}

.scene-share-option {
    width: 100%;
    background: none;
    border: none;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s ease;
}

.scene-share-option:hover {
    background: #f8f9fa;
}

/* Video Card Share Button Styles */
.video-card-share-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.video-card:hover .video-card-share-btn {
    opacity: 1;
}

.video-card-share-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-card-share-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 140px;
    margin-top: 2px;
    animation: slideDown 0.2s ease-out;
}

.video-card-share-option {
    width: 100%;
    background: none;
    border: none;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s ease;
}

.video-card-share-option:hover {
    background: #f8f9fa;
}
.video-card-share-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 7;
}

.video-card-watch-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 6;
    pointer-events: none;
}

.video-card-watch-overlay .watch-indicator {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
}

[data-theme="dark"] .video-card-watch-overlay .watch-indicator {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
}
.video-card-share-controls .video-card-share-btn {
    top: 0;
    right: 0;
}
.video-card-share-controls .video-card-share-dropdown {
    top: auto;
    bottom: 100%;
    margin-bottom: 8px;
}

/* Card Reactions - Horizontal Layout at Bottom */
.video-card-reactions,
.scene-card-reactions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 36px;
}

.video-card-reactions .reaction-wrapper,
.scene-card-reactions .reaction-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
}

.video-card-reactions .reaction-list,
.scene-card-reactions .reaction-list {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.video-card-reactions .chat-reaction,
.scene-card-reactions .chat-reaction {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    min-height: 28px;
    font-size: 13px;
}

.video-card-reactions .chat-reaction-emoji,
.scene-card-reactions .chat-reaction-emoji {
    font-size: 16px;
    line-height: 1;
}

.video-card-reactions .chat-reaction-count,
.scene-card-reactions .chat-reaction-count {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.video-card-reactions .reaction-add-btn,
.scene-card-reactions .reaction-add-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
    margin-left: 4px;
}

.video-card-reactions .reaction-add-btn.disabled,
.scene-card-reactions .reaction-add-btn.disabled,
.video-card-reactions .reaction-add-btn:disabled,
.scene-card-reactions .reaction-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.video-card-reactions .reactions-disabled,
.scene-card-reactions .reactions-disabled {
    opacity: 0.6;
}

.video-card-reactions .reactions-disabled .chat-reaction,
.scene-card-reactions .reactions-disabled .chat-reaction {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.video-card-reactions .reaction-picker,
.scene-card-reactions .reaction-picker {
    flex-direction: row;
    bottom: 38px;
    left: 0;
    right: auto;
    transform: none;
    position: absolute;
    white-space: nowrap;
}

.video-card-reactions .reaction-tooltip,
.scene-card-reactions .reaction-tooltip {
    bottom: 100%;
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(-8px);
    top: auto;
    margin-bottom: 4px;
    margin-right: 0;
}

.video-card-reactions .reaction-tooltip::after,
.scene-card-reactions .reaction-tooltip::after {
    top: 100%;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-top-color: rgba(0, 0, 0, 0.85);
    border-right-color: transparent;
    border-left-color: transparent;
    border-bottom-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .video-card-reactions .chat-reaction:hover .reaction-tooltip,
    .video-card-reactions .chat-reaction:focus .reaction-tooltip,
    .scene-card-reactions .chat-reaction:hover .reaction-tooltip,
    .scene-card-reactions .chat-reaction:focus .reaction-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}
