:root {
    --primary-color: #e50914;
    --secondary-color: #141414;
    --card-bg: #1f1f1f;
    --text-color: #ffffff;
    --text-muted: #b3b3b3;
    --transition: all 0.3s ease;
    --shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--secondary-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    padding: 15px 4%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    background-color: #000;
    padding: 10px 4%;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

.logo {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.search-container {
    display: flex;
    background: rgba(0,0,0,0.5);
    border: 1px solid #444;
    border-radius: 4px;
    padding: 5px 10px;
    flex: 1;
    max-width: 300px;
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 5px;
    width: 100%;
    outline: none;
}

.search-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
}

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

.type-selector {
    display: flex;
    background: #333;
    border-radius: 20px;
    padding: 2px;
}

.type-btn {
    padding: 5px 15px;
    border-radius: 18px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.type-btn.active {
    background: var(--primary-color);
}

.year-select {
    background: #333;
    color: white;
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}

/* Hero Section */
.hero {
    height: 80vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 0 4%;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to top, var(--secondary-color), transparent);
}

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

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: var(--text-muted);
}

.hero-play-btn {
    background-color: white;
    color: black;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.hero-play-btn:hover {
    background-color: rgba(255,255,255,0.8);
    transform: scale(1.05);
}

/* Movie Grid */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 4%;
}

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

.movie-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow);
}

.movie-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.movie-info {
    padding: 15px;
}

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

.movie-meta-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.movie-rating {
    color: #46d369;
    font-weight: bold;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow-y: auto;
}

.modal-content {
    background-color: #181818;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.player-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

video {
    width: 100%;
    height: 100%;
}

.movie-details {
    padding: 30px;
}

/* Funcionalidades Premium */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 5;
}

.favorite-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: var(--primary-color);
}

.continue-watching-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
}

.player-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.action-btn {
    background: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    transition: var(--transition);
}

.action-btn:hover {
    background: #444;
}

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

.recommendations-section {
    margin-top: 40px;
    border-top: 1px solid #333;
    padding-top: 20px;
}

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

.mini-card {
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.mini-card:hover {
    transform: scale(1.05);
}

.mini-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.mini-info {
    padding: 8px;
    font-size: 0.8rem;
}

/* Toast Notification */
#toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 3000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

#toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.2rem; }
    .navbar-container { flex-direction: column; gap: 10px; }
    .nav-controls { width: 100%; justify-content: center; }
    .search-container { max-width: 100%; width: 100%; }
    .movies-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
