/* CSS Reset & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --accent-primary: #6366f1;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-fast: 0.15s ease;
    --transition-medium: 0.3s ease;

    /* Type badge colors */
    --type-workprint: #f59e0b;
    --type-tv: #3b82f6;
    --type-extended: #10b981;
    --type-directors: #8b5cf6;
    --type-screener: #ef4444;
    --type-uncut: #ec4899;
    --type-other: #6b7280;
    --warning-color: #fbbf24;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
}

/* Animated Gradient Background */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
    animation: gradientShift 15s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% {
        opacity: 0.8;
        transform: scale(1);
    }

    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    padding: 60px 0 40px;
    text-align: center;
}

.title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.title-icon {
    font-size: 0.85em;
    -webkit-text-fill-color: initial;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 40px;
}

.subtitle span {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    pointer-events: none;
}

#search {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition-medium);
}

#search::placeholder {
    color: var(--text-secondary);
}

#search:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.filter-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.sort-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sort-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sort-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

.sort-btn span {
    font-size: 0.85em;
}

/* Type Filter Dropdown */
.type-filter {
    position: relative;
}

.filter-select {
    padding: 10px 36px 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: var(--transition-fast);
}

.filter-select:hover {
    background-color: var(--bg-card-hover);
}

.filter-select:focus {
    border-color: var(--accent-primary);
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 24px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Movie List */
.movie-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 40px;
}

.movie-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-medium);
    animation: fadeInUp 0.4s ease backwards;
}

.movie-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
    box-shadow: var(--shadow-glow);
}

.movie-item.striked {
    opacity: 0.6;
}

.movie-item.striked:hover {
    opacity: 0.85;
}

/* Row 1: Year + Title */
.movie-row-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.movie-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}

.warning-icon {
    cursor: help;
    font-size: 1rem;
    opacity: 0.9;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Row 2: Badges + Links */
.movie-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.movie-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Type Badges */
.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.type-badge.type-workprint {
    background: rgba(245, 158, 11, 0.15);
    color: var(--type-workprint);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.type-badge.type-tv {
    background: rgba(59, 130, 246, 0.15);
    color: var(--type-tv);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.type-badge.type-extended {
    background: rgba(16, 185, 129, 0.15);
    color: var(--type-extended);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.type-badge.type-directors {
    background: rgba(139, 92, 246, 0.15);
    color: var(--type-directors);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.type-badge.type-screener {
    background: rgba(239, 68, 68, 0.15);
    color: var(--type-screener);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.type-badge.type-uncut {
    background: rgba(236, 72, 153, 0.15);
    color: var(--type-uncut);
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.type-badge.type-other {
    background: rgba(107, 114, 128, 0.15);
    color: var(--type-other);
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.original-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.movie-year {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--accent-gradient);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
}

.movie-year.no-year {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Movie Links */
.movie-links {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    margin-left: auto;
}

.movie-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.movie-link.info {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.movie-link.info:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.movie-link.imdb {
    background: rgba(245, 197, 24, 0.15);
    color: #f5c518;
    border: 1px solid rgba(245, 197, 24, 0.3);
}

.movie-link.imdb:hover {
    background: #f5c518;
    color: #000;
    border-color: #f5c518;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 197, 24, 0.3);
}

.movie-link.tmdb {
    background: rgba(1, 180, 228, 0.15);
    color: #01b4e4;
    border: 1px solid rgba(1, 180, 228, 0.3);
}

.movie-link.tmdb:hover {
    background: #01b4e4;
    color: #fff;
    border-color: #01b4e4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 180, 228, 0.3);
}

.movie-link.google {
    background: rgba(234, 67, 53, 0.15);
    color: #ea4335;
    border: 1px solid rgba(234, 67, 53, 0.3);
}

.movie-link.google:hover {
    background: #ea4335;
    color: #fff;
    border-color: #ea4335;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    padding-right: 40px;
}

.modal-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.modal-year {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--accent-gradient);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
}

.modal-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-sm);
    color: var(--warning-color);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-item:nth-child(1) {
    animation-delay: 0.01s;
}

.movie-item:nth-child(2) {
    animation-delay: 0.02s;
}

.movie-item:nth-child(3) {
    animation-delay: 0.03s;
}

.movie-item:nth-child(4) {
    animation-delay: 0.04s;
}

.movie-item:nth-child(5) {
    animation-delay: 0.05s;
}

.movie-item:nth-child(6) {
    animation-delay: 0.06s;
}

.movie-item:nth-child(7) {
    animation-delay: 0.07s;
}

.movie-item:nth-child(8) {
    animation-delay: 0.08s;
}

.movie-item:nth-child(9) {
    animation-delay: 0.09s;
}

.movie-item:nth-child(10) {
    animation-delay: 0.1s;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Resources Bar */
.resources-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 0;
    margin-bottom: 20px;
}

.resources-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.resources-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.resources-links a {
    color: var(--accent-primary);
    text-decoration: none;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.resources-links a:hover {
    background: var(--accent-primary);
    color: white;
}

/* Responsive */
@media (max-width: 600px) {
    .header {
        padding: 40px 0 30px;
    }

    .title {
        flex-direction: column;
        gap: 8px;
    }

    .filter-controls {
        flex-direction: column;
        gap: 12px;
    }

    .stats-bar {
        gap: 24px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .movie-item {
        padding: 12px 14px;
        gap: 8px;
    }

    .movie-row-top {
        gap: 8px;
        width: 100%;
    }

    .movie-title {
        font-size: 0.9rem;
    }

    .movie-year {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    .movie-row-bottom {
        gap: 8px;
        width: 100%;
        flex-wrap: nowrap;
    }

    .movie-badges {
        flex: 0 0 auto;
    }

    .movie-links {
        flex: 1;
        justify-content: flex-end;
        gap: 4px;
        margin-left: auto;
    }

    .movie-link {
        padding: 5px 8px;
        font-size: 0.65rem;
    }

    .type-badge {
        padding: 2px 6px;
        font-size: 0.6rem;
    }

    .original-badge {
        padding: 2px 5px;
        font-size: 0.55rem;
    }

    .modal-content {
        padding: 24px;
    }

    .modal-title {
        font-size: 1.25rem;
    }
}