@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@200;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Faster+One:wght@200;400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@200;400;700&display=swap');

* {
    font-family: 'Archivo', 'Faster One', 'Playfair Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Root Variables for Dark Mode */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #e5e5e5;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --nav-border: rgba(0, 0, 0, 0.06);
    --card-bg: rgba(255, 255, 255, 0.6);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0a0a0a;
        --bg-secondary: #1a1a1a;
        --text-primary: #ffffff;
        --text-secondary: #b3b3b3;
        --text-tertiary: #666666;
        --border-color: #333333;
        --nav-bg: rgba(10, 10, 10, 0.85);
        --nav-border: rgba(255, 255, 255, 0.1);
        --card-bg: rgba(10, 10, 10, 0.6);
    }
    
    body {
        background-color: var(--bg-primary);
        color: var(--text-primary);
    }
    
    .video-dialog-content {
        background: rgba(20, 20, 20, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dialog-title {
        color: var(--text-primary);
    }
    
    .dialog-description {
        color: var(--text-secondary);
    }
    
    .dialog-extended {
        background: rgba(255, 255, 255, 0.05);
        border-left-color: var(--text-primary);
        color: var(--text-secondary);
    }
    
    .dialog-close {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }
    
    .dialog-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .filter-tag {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--text-secondary);
    }
    
    .filter-tag.active {
        background: rgba(255, 255, 255, 0.95);
        color: #000;
        border-color: rgba(255, 255, 255, 0.95);
    }
    
    .filter-tag:hover:not(.active) {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Glass Navigation */
.glass-nav {
    backdrop-filter: blur(20px) saturate(180%);
    background: var(--nav-bg);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
    border-bottom-color: var(--nav-border);
}

/* Navigation link styles */
nav a {
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    opacity: 0.6;
}

/* Active nav link with glow effect */
nav a.active {
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6),
                 0 0 40px rgba(255, 255, 255, 0.4),
                 0 0 60px rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    nav a.active {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                     0 0 40px rgba(255, 255, 255, 0.6),
                     0 0 60px rgba(255, 255, 255, 0.4);
    }
}

/* Filter Tags */
.filter-tag {
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 0.775rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.filter-tag.active {
    background: rgba(0, 0, 0, 0.95);
    color: white;
    border-color: rgba(0, 0, 0, 0.95);
}

.filter-tag:hover:not(.active) {
    background: rgba(0, 0, 0, 0.1);
}

/* Director Filter Indicator */
.director-filter-indicator {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
    font-weight: 500;
}

.director-filter-indicator:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(147, 51, 234, 0.3));
    transform: scale(0.95);
}

@media (prefers-color-scheme: dark) {
    .director-filter-indicator {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(147, 51, 234, 0.15));
        color: #60a5fa;
        border-color: rgba(59, 130, 246, 0.3);
    }
}

/* Sort Dropdown */
.sort-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all 0.2s ease;
}

.sort-select:hover {
    border-color: #666;
}

.sort-select:focus {
    border-color: #000;
}

@media (prefers-color-scheme: dark) {
    .sort-select {
        background-color: var(--bg-secondary);
        border-color: var(--border-color);
        color: var(--text-primary);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    }
}

/* Director Filter Button */
.director-filter-button {
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    text-align: right;
}

.director-filter-button:hover {
    background: rgba(0, 0, 0, 0.95);
    color: white;
    border-color: rgba(0, 0, 0, 0.95);
}

@media (prefers-color-scheme: dark) {
    .director-filter-button {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--text-secondary);
    }
    
    .director-filter-button:hover {
        background: rgba(255, 255, 255, 0.95);
        color: #000;
        border-color: rgba(255, 255, 255, 0.95);
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Video Card - with animation */
.video-card {
    transition: transform 0.3s ease;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    overflow: hidden;
    border-radius: 7px;
    box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 16px, rgba(0, 0, 0, 0.1) 0px 8px 32px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-container:hover {
    transform: translateY(-4px);
    box-shadow: rgba(0, 0, 0, 0.3) 0px 8px 24px, rgba(0, 0, 0, 0.15) 0px 16px 48px;
}

.video-container video, .video-container img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

.video-container video {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container:hover video {
    opacity: 1;
}

.video-container:hover img {
    opacity: 0;
}

/* Overlay Top Container (title + share button) */
.overlay-top-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);
}

.overlay-title-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overlay-role-hint {
    font-family: 'Archivo', sans-serif;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    font-weight: 300;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    line-height: 1.2;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.overlay-title {
    font-family: 'Faster One', serif;
    color: white;
    font-size: 2.2rem;
    font-weight: 400;
    text-align: left;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4),
                 2px 2px 8px rgba(0, 0, 0, 0.8);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.09em;
    text-transform: uppercase;
    margin-top: -7px;
}

.overlay-subtitle {
    font-family: 'Faster One', serif;
    color: white;
    font-size: 1.1rem;
    font-weight: 400;
    text-align: left;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3),
                 1px 1px 6px rgba(0, 0, 0, 0.8);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    opacity: 0.9;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%;
}
}

/* Director Button in Overlay */
.overlay-director-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 7px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-10px);
}

.video-container:hover .overlay-director-button {
    opacity: 1;
    transform: translateY(0);
}

.overlay-director-button:hover {
    background: rgba(147, 51, 234, 0.4);
    border-color: rgba(147, 51, 234, 0.5);
    transform: translateY(0) scale(1.05);
}

/* Page Titles with Faster One */
h1 {
    font-family: 'Archivo', sans-serif;
    letter-spacing: 0.02em;
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    h1 {
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    }
}

.overlay-share-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 7px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-10px);
}

.video-container:hover .overlay-share-button {
    opacity: 1;
    transform: translateY(0);
}

.overlay-share-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(0) scale(1.05);
}

/* Dialog Header with Share Button */
.dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 12px;
}

.dialog-share-button {
    background: rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.dialog-share-button:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

@media (prefers-color-scheme: dark) {
    .dialog-share-button {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: var(--text-primary);
    }
    
    .dialog-share-button:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

.dialog-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 12px;
    color: #000;
    line-height: 1.3;
    margin: 0;
}

/* Description Overlay (bottom) - hides on hover */
.overlay-desc-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 10;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.overlay-desc-text {
    color: white;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
    margin: 0;
}

/* Video Dialog Modal - SwiftUI Sheet Style */
.video-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-dialog.active {
    opacity: 1;
    pointer-events: auto;
}

.video-dialog-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(40px);
    border-radius: 20px 20px 0 0;
    padding: 32px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: none;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    position: relative;
}

.video-dialog.active .video-dialog-content {
    transform: translateY(0);
}

/* Drag handle indicator */
.video-dialog-content::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.dialog-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    color: #333;
    font-weight: 300;
}

.dialog-close:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

.dialog-title {
    font-size: 1rem;
    font-weight: 400;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.6;
}

.dialog-extended {
    font-size: 0.95rem;
    font-weight: 300;
    color: #444;
    line-height: 1.7;
    padding: 20px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    border-left: 3px solid #000;
    margin-bottom: 20px;
}

.dialog-action-button {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.dialog-action-button:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.02);
}

/* Dialog Video Player */
.dialog-video-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #000;
}

.dialog-video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.dialog-video-native {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* Navigation link hover effect */
nav a {
    transition: opacity 0.2s ease;
}

nav a:hover {
    opacity: 0.6;
}

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