:root {
    --bg-dark: #0b0e14;
    --bg-card: #151921;
    --bg-modal: #121620;
    --bg-header: rgba(11, 14, 20, 0.88);
    --accent: #a855f7;
    --accent-hover: #9333ea;
    --accent-glow: rgba(168, 85, 247, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --radius-card: 12px;
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.5;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.25rem;
    cursor: pointer;
}

.logo-badge {
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.logo-text .accent {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 6px 12px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 4px 8px;
    font-family: inherit;
    font-size: 0.9rem;
}

.search-box button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}

.btn-sync {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-sync:hover {
    background: var(--accent);
    color: #fff;
}

/* Hero Section */
.hero {
    position: relative;
    height: 70vh;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    padding: 0 24px 60px;
    margin-top: 60px;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    filter: brightness(0.65);
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(11, 14, 20, 0.2) 0%, var(--bg-dark) 100%);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.hero-badge {
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 12px 0;
    line-height: 1.15;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.hero-meta .rating {
    color: #f59e0b;
    font-weight: 700;
}

.quality-badge {
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.hero-overview {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 12px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Sections & Grids */
.section {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 24px;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.media-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.media-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px var(--accent-glow);
    border-color: rgba(168, 85, 247, 0.4);
}

.media-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

.media-info {
    padding: 12px;
}

.media-title {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

/* Details Modal & Season/Episode Picker */
.details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.details-modal-content {
    background: var(--bg-modal);
    width: 100%;
    max-width: 1050px;
    max-height: 90vh;
    border-radius: 16px;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.details-hero {
    position: relative;
    min-height: 380px;
    padding: 40px;
    display: flex;
    align-items: flex-end;
}

.details-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4);
}

.details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, var(--bg-modal) 100%);
}

.details-body {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 30px;
    align-items: flex-end;
}

.details-poster {
    width: 180px;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.details-info {
    flex: 1;
}

.details-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.details-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.details-meta .rating {
    color: #f59e0b;
    font-weight: 700;
}

.genres-badges {
    color: var(--text-secondary);
}

.details-overview {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 20px;
    max-width: 650px;
}

.details-actions {
    display: flex;
    gap: 12px;
}

.details-section {
    padding: 24px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sub-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Cast Reparto Slider */
.cast-grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.cast-card {
    min-width: 110px;
    text-align: center;
}

.cast-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.cast-name {
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cast-character {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Season & Episodes Picker */
.seasons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.season-dropdown {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    font-weight: 600;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.episode-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.episode-card:hover {
    border-color: var(--accent);
    background: rgba(168, 85, 247, 0.1);
    transform: translateY(-3px);
}

.episode-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.episode-info {
    padding: 10px;
}

.episode-num {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
}

.episode-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode-overview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal Player */
.player-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-modal.hidden, .details-modal.hidden {
    display: none !important;
}

.player-modal-content {
    background: var(--bg-card);
    width: 92%;
    max-width: 1100px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.player-subtitle {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

.player-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.4);
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid var(--accent);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: var(--accent);
}

.server-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.server-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.server-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    font-weight: 700;
}

.player-frame-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-click-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 14, 20, 0.75);
    backdrop-filter: blur(4px);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.player-click-shield span {
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 10px 25px var(--accent-glow);
    transition: transform 0.2s ease;
}

.player-click-shield:hover span {
    transform: scale(1.05);
    background: var(--accent-hover);
}

.player-frame-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.player-footer {
    padding: 12px 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.hidden {
    display: none !important;
}

.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
