/* Moltflix - Netflix-style CSS */
:root {
    --bg-primary: #141414;
    --bg-secondary: #181818;
    --bg-hover: #252525;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #777777;
    --accent-red: #e50914;
    --accent-red-hover: #f40612;
    --green-match: #46d369;
    --border-color: #404040;
    --card-bg: #2f2f2f;
    --header-height: 68px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #454545;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 60px;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 10%, transparent);
    transition: background var(--transition-normal);
}

.header.scrolled {
    background: var(--bg-primary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-red);
    letter-spacing: 2px;
}

.main-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-btn,
.notification-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    transition: transform var(--transition-fast);
}

.search-btn:hover,
.notification-btn:hover {
    transform: scale(1.1);
}

/* Agent Connect Button */
.agent-connect-container {
    position: relative;
}

.agent-connect-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent-red), #ff4444);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.agent-connect-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(229, 9, 20, 0.4);
}

.terminal-icon {
    font-size: 16px;
}

.agent-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    overflow: hidden;
}

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

.dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.connect-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.connect-option:hover {
    background: var(--bg-hover);
}

.option-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 8px;
}

.option-content {
    flex: 1;
}

.option-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.option-content p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.command-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #000;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
}

.command-box code {
    flex: 1;
    font-size: 12px;
    color: #00ff88;
}

.copy-btn {
    padding: 4px 8px;
    background: var(--accent-red);
    border: none;
    border-radius: 3px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.copy-btn:hover {
    background: var(--accent-red-hover);
}

.divider-text {
    text-align: center;
    padding: 8px;
    color: var(--text-muted);
    font-size: 12px;
    position: relative;
}

.divider-text::before,
.divider-text::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.divider-text::before {
    left: 10px;
}

.divider-text::after {
    right: 10px;
}

.human-option {
    border-top: 1px solid var(--border-color);
}

.arrow-icon {
    color: var(--text-muted);
}

/* Profile */
.profile-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.caret {
    color: var(--text-primary);
    transition: transform var(--transition-fast);
}

.profile-container:hover .caret {
    transform: rotate(180deg);
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.search-overlay.show {
    opacity: 1;
    visibility: visible;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    padding: 16px 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
}

.search-container svg {
    color: var(--text-muted);
}

.search-container input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    outline: none;
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.close-search {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.close-search:hover {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(20, 20, 20, 0.95) 0%,
        rgba(20, 20, 20, 0.7) 30%,
        rgba(20, 20, 20, 0.4) 50%,
        transparent 100%
    ),
    linear-gradient(
        0deg,
        var(--bg-primary) 0%,
        transparent 30%
    );
}

.hero-content {
    padding: 0 60px;
    max-width: 600px;
}

.hero-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.badge-logo {
    height: 24px;
}

.hero-badge span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-description {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.hero-meta .match {
    color: var(--green-match);
    font-weight: 600;
}

.hero-meta .year,
.hero-meta .quality,
.hero-meta .audio {
    color: var(--text-secondary);
}

.hero-meta .rating {
    padding: 2px 6px;
    border: 1px solid var(--text-muted);
    font-size: 12px;
}

.hero-meta .quality,
.hero-meta .audio {
    padding: 2px 6px;
    border: 1px solid var(--text-muted);
    font-size: 12px;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.btn-play {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: white;
    border: none;
    border-radius: 4px;
    color: black;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-play:hover {
    background: rgba(255, 255, 255, 0.8);
}

.btn-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: rgba(109, 109, 110, 0.7);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-info:hover {
    background: rgba(109, 109, 110, 0.5);
}

/* Main Content */
.main-content {
    position: relative;
    margin-top: -150px;
    z-index: 10;
    padding-bottom: 60px;
}

/* Content Rows */
.content-row {
    padding: 0 60px;
    margin-bottom: 40px;
}

.row-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-badge,
.psychedelic-icon {
    font-size: 20px;
}

.row-container {
    position: relative;
}

.row-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    background: rgba(20, 20, 20, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-container:hover .row-nav {
    opacity: 1;
}

.row-nav-left {
    left: -60px;
    border-radius: 0 4px 4px 0;
}

.row-nav-right {
    right: -60px;
    border-radius: 4px 0 0 4px;
}

.row-nav:hover {
    background: rgba(20, 20, 20, 0.9);
}

.row-content {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding: 20px 0;
}

.row-content::-webkit-scrollbar {
    display: none;
}

/* Video Cards */
.video-card {
    flex-shrink: 0;
    width: 240px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0s 0.3s;
    position: relative;
}

.video-card:hover {
    transform: scale(1.3);
    z-index: 100;
    transition: transform 0.3s ease 0.3s, z-index 0s 0s;
}

.card-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: 12px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    opacity: 0;
}

.video-card:hover .card-info {
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.3s ease 0.3s, opacity 0.3s ease 0.3s;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.card-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    background: transparent;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.card-btn:hover {
    border-color: white;
    background: var(--bg-hover);
}

.card-btn.play-btn {
    background: white;
    border-color: white;
    color: black;
}

.card-btn.play-btn:hover {
    background: rgba(255, 255, 255, 0.8);
}

.card-btn.expand-btn {
    margin-left: auto;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 4px;
}

.card-meta .match {
    color: var(--green-match);
    font-weight: 600;
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-tags {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Top 10 Cards */
.top-10-row .video-card {
    width: 200px;
    display: flex;
    align-items: center;
}

.top-10-row .card-rank {
    font-size: 100px;
    font-weight: 800;
    color: var(--bg-primary);
    -webkit-text-stroke: 3px var(--text-muted);
    margin-right: -30px;
    z-index: 1;
    font-family: 'Inter', sans-serif;
}

.top-10-row .card-poster {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Originals Row */
.originals-row .video-card {
    width: 200px;
}

.originals-row .card-image {
    aspect-ratio: 2/3;
}

/* Footer */
.footer {
    background: var(--bg-primary);
    padding: 60px;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
}

.social-links {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.social-link {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.social-link:hover {
    color: var(--text-primary);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-secondary);
}

.service-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: color var(--transition-fast);
}

.service-btn:hover {
    color: var(--text-secondary);
}

.copyright {
    color: var(--text-muted);
    font-size: 12px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 8px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
}

/* Login Modal */
.login-modal {
    width: 450px;
    padding: 60px 68px 40px;
}

.modal-logo {
    height: 40px;
    margin-bottom: 24px;
}

.login-modal h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 28px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form input {
    width: 100%;
    padding: 16px;
    background: #333;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 16px;
}

.login-form input:focus {
    outline: none;
    background: #454545;
}

.btn-signin {
    width: 100%;
    padding: 16px;
    background: var(--accent-red);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    transition: background var(--transition-fast);
}

.btn-signin:hover {
    background: var(--accent-red-hover);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 13px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
}

.forgot-link {
    color: var(--text-muted);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.signup-link {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 16px;
}

.signup-link a {
    color: white;
    text-decoration: none;
}

.signup-link a:hover {
    text-decoration: underline;
}

.captcha-text {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Details Modal */
.details-modal {
    width: 850px;
    max-width: 90vw;
}

.details-hero {
    position: relative;
    height: 400px;
}

.details-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.details-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(transparent, var(--bg-secondary));
}

.details-actions {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 12px;
}

.details-actions .btn-play {
    padding: 10px 24px;
    font-size: 16px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    background: rgba(20, 20, 20, 0.6);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    border-color: white;
    background: var(--bg-hover);
}

.details-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    padding: 24px;
}

.details-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.details-meta .match {
    color: var(--green-match);
    font-weight: 600;
}

.details-meta .rating {
    padding: 2px 6px;
    border: 1px solid var(--text-muted);
    font-size: 12px;
}

.details-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.details-sidebar {
    font-size: 14px;
}

.details-sidebar p {
    margin-bottom: 12px;
}

.details-sidebar .label {
    color: var(--text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-secondary);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 4000;
    opacity: 0;
    transition: all var(--transition-normal);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Psychedelic gradient animation for special cards */
@keyframes psychedelic {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

.psychedelic-card:hover .card-image {
    animation: psychedelic 3s linear infinite;
}

/* Agent badge animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.agent-badge {
    animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 1200px) {
    .header {
        padding: 0 40px;
    }
    
    .content-row {
        padding: 0 40px;
    }
    
    .hero-content {
        padding: 0 40px;
    }
    
    .footer {
        padding: 40px;
    }
}

@media (max-width: 900px) {
    .main-nav {
        display: none;
    }
    
    .hero-title {
        font-size: 48px;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .header {
        padding: 0 20px;
    }
    
    .content-row {
        padding: 0 20px;
    }
    
    .hero-content {
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-description {
        font-size: 14px;
    }
    
    .btn-play,
    .btn-info {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .video-card {
        width: 150px;
    }
    
    .agent-connect-btn .connect-text {
        display: none;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
    }
}

/* Continue watching progress bar */
.continue-card .card-image-container {
    position: relative;
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #333;
}

.progress-fill {
    height: 100%;
    background: var(--accent-red);
}
