:root {
    --bg-primary: #141414;
    --bg-secondary: #1a1a1a;
    --bg-card: #222;
    --text-primary: #fff;
    --text-secondary: #b3b3b3;
    --accent: #e50914;
    --accent-hover: #f40612;
    --success: #46d369;
    --warning: #f5a623;
    --card-radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Netflix Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Header / Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
    padding: 20px 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s;
}

.navbar.scrolled {
    background: rgba(20, 20, 20, 0.98);
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -1px;
}

.logo span {
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 0;
    padding: 10px 15px;
    padding-left: 40px;
    border: 1px solid var(--text-primary);
    background: rgba(0,0,0,0.7);
    color: var(--text-primary);
    font-size: 1rem;
    border-radius: 4px;
    transition: width 0.4s ease;
    opacity: 0;
}

.search-box.active input {
    width: 280px;
    opacity: 1;
}

.search-box .search-icon {
    position: absolute;
    left: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 1;
}

/* Hero Section */
.hero {
    position: relative;
    height: 80vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    padding: 0 60px;
    margin-bottom: 20px;
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center top;
    z-index: -2;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(20,20,20,1) 0%, rgba(20,20,20,0.7) 30%, rgba(20,20,20,0) 60%),
                linear-gradient(to top, rgba(20,20,20,1) 0%, transparent 50%);
    z-index: -1;
}

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

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.hero-rating {
    color: var(--success);
    font-weight: 600;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: rgba(255,255,255,0.85);
}

.btn-secondary {
    background: rgba(109, 109, 110, 0.7);
    color: var(--text-primary);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-primary);
}

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

.btn-success {
    background: var(--success);
    color: var(--bg-primary);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Movies Row */
.movies-section {
    padding: 0 60px;
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .see-all {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.movies-section:hover .see-all {
    opacity: 1;
}

.movies-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    scrollbar-width: none;
}

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

/* Movie Card */
.movie-card {
    flex: 0 0 auto;
    width: 200px;
    cursor: pointer;
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.movie-card:hover {
    transform: scale(1.08);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.movie-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.movie-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.movie-card:hover .movie-card-overlay {
    opacity: 1;
}

.movie-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.movie-card-rating {
    color: var(--success);
}

/* Search Results Grid */
.search-results {
    padding: 100px 60px 40px;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* Movie Detail Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

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

.modal-backdrop {
    height: 400px;
    background-size: cover;
    background-position: center;
    position: relative;
}

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

.modal-info {
    padding: 30px;
    margin-top: -100px;
    position: relative;
}

.modal-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.modal-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.modal-rating {
    color: var(--success);
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-year, .modal-runtime {
    color: var(--text-secondary);
}

.modal-genres {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.genre-tag {
    background: rgba(255,255,255,0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.modal-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 30px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

/* Torrent Results */
.torrent-section {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 25px;
}

.torrent-section h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.torrent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.torrent-item {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.torrent-info {
    flex: 1;
    min-width: 0;
}

.torrent-title {
    font-size: 0.95rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.torrent-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.torrent-quality {
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.torrent-quality.q-4k { background: #7b2cbf; }
.torrent-quality.q-1080p { background: #2196F3; }
.torrent-quality.q-720p { background: #4CAF50; }

.torrent-seeds {
    color: var(--success);
}

.torrent-source {
    color: var(--warning);
}

.torrent-category {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    background: rgba(156, 39, 176, 0.2);
    color: #ce93d8;
}

.torrent-lang {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.torrent-lang.lang-es {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.torrent-lang.lang-en {
    background: rgba(76, 175, 80, 0.3);
    color: #4caf50;
    font-weight: 600;
}

.torrent-lang.lang-warn {
    background: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.torrent-lang.lang-bad {
    background: rgba(244, 67, 54, 0.3);
    color: #f44336;
}

/* Loading Spinner */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Downloads Section */
.downloads-section {
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-top: 20px;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.download-progress {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.download-progress-bar {
    height: 100%;
    background: var(--success);
    transition: width 0.3s;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--accent); }
.toast.info { border-left: 4px solid #2196F3; }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .navbar, .hero, .movies-section, .search-results {
        padding-left: 30px;
        padding-right: 30px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .navbar, .hero, .movies-section, .search-results {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero {
        height: 60vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .movie-card {
        width: 140px;
    }
    
    .movie-card img {
        height: 210px;
    }
    
    .modal-content {
        margin: 20px;
    }
    
    .modal-title {
        font-size: 1.8rem;
    }
}

/* Page transitions */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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

/* Downloads page */
.downloads-page {
    padding: 100px 60px 40px;
}

.download-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.download-card img {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.download-info {
    flex: 1;
}

.download-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.download-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.download-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.download-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #2ecc71);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.download-stats {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* No results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Genre Selector */
.genre-selector {
    padding: 40px 60px;
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.genre-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    background: linear-gradient(145deg, var(--bg-card), #2a2a2a);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border: 1px solid transparent;
}

.genre-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(145deg, #333, #444);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(229, 9, 20, 0.2);
}

.genre-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.genre-name {
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

/* Genre Section styles */
.genre-section {
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Responsive adjustments for genres */
@media (max-width: 768px) {
    .genre-selector {
        padding: 30px 20px;
    }
    
    .genre-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .genre-card {
        padding: 15px 10px;
    }
    
    .genre-icon {
        font-size: 2rem;
    }
    
    .genre-name {
        font-size: 0.8rem;
    }
}
