/* ============================================
   ARISEFLIX - Netflix-inspired CSS
   ============================================ */

:root {
    --bg: #141414;
    --bg-card: #181818;
    --bg-hover: #252525;
    --surface: #1a1a1a;
    --red: #E50914;
    --red-hover: #f6121d;
    --white: #fff;
    --gray-100: #e5e5e5;
    --gray-200: #b3b3b3;
    --gray-300: #808080;
    --gray-400: #333;
    --font: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --nav-height: 68px;
    --transition: .2s ease;
    --shadow: 0 4px 30px rgba(0,0,0,.7);
    --radius: 6px;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

/* ============ NAVBAR ============ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4%;
    z-index: 100;
    transition: background .4s;
    background: linear-gradient(180deg, rgba(0,0,0,.7) 10%, transparent);
}

.navbar.scrolled {
    background: rgba(20,20,20,.97);
    backdrop-filter: blur(10px);
}

.nav-left { display: flex; align-items: center; gap: 2rem; }
.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--red);
    letter-spacing: 2px;
    text-decoration: none;
}
.logo { text-decoration: none; }

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.25rem;
}
.nav-links a {
    color: var(--gray-200);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 400;
    transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); font-weight: 500; }

.nav-right { display: flex; align-items: center; gap: 1.25rem; }

/* Search */
.search-box {
    display: flex;
    align-items: center;
    position: relative;
}
.search-toggle {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
}
.search-input {
    width: 0;
    opacity: 0;
    padding: 7px 12px;
    background: rgba(0,0,0,.85);
    border: 1px solid var(--gray-300);
    color: var(--white);
    font-size: .9rem;
    font-family: var(--font);
    outline: none;
    transition: width .3s, opacity .3s, padding .3s;
    border-radius: var(--radius);
}
.search-box.open .search-input {
    width: 260px;
    opacity: 1;
    padding: 7px 12px;
}

/* User menu */
.user-menu { position: relative; }
.user-avatar {
    width: 36px; height: 36px;
    background: var(--red);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
}
.user-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    background: rgba(20,20,20,.97);
    border: 1px solid var(--gray-400);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    min-width: 180px;
    display: none;
    box-shadow: var(--shadow);
}
.user-dropdown.show { display: block; }
.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--gray-100);
    font-size: .85rem;
    padding-bottom: .5rem;
}
.user-dropdown hr { border-color: var(--gray-400); margin: .25rem 0; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--gray-200);
    text-decoration: none;
    font-size: .85rem;
    padding: .4rem 0;
    transition: color var(--transition);
}
.user-dropdown a:hover { color: var(--white); }

/* ============ LOGIN ============ */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-overlay.hidden { display: none; }

.login-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #000 0%, #1a0000 50%, #0d0d0d 100%);
}
.login-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(229,9,20,.15), transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(229,9,20,.08), transparent 50%);
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 1rem;
}
.login-card {
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    padding: 3rem 3.5rem;
}
.login-logo {
    color: var(--red);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 2rem;
}
.login-card h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.75rem;
}

.form-group {
    position: relative;
    margin-bottom: 1rem;
}
.form-group input {
    width: 100%;
    padding: 1.1rem 1rem .5rem;
    background: var(--gray-400);
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
    transition: border-color var(--transition);
}
.form-group input:focus { border-color: var(--gray-200); }
.form-group label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--gray-300);
    font-size: .95rem;
    pointer-events: none;
    transition: .2s;
}
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
    top: .55rem;
    transform: none;
    font-size: .7rem;
    color: var(--gray-200);
}

.btn-login {
    width: 100%;
    padding: .9rem;
    background: var(--red);
    border: none;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    margin-top: .75rem;
    transition: background var(--transition);
}
.btn-login:hover { background: var(--red-hover); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }

.login-error {
    color: #e87c03;
    font-size: .85rem;
    margin-top: .75rem;
    min-height: 1.5rem;
}
.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}
.login-footer p { color: var(--gray-300); font-size: .8rem; }

/* ============ HERO / BILLBOARD ============ */
.hero {
    position: relative;
    width: 100%;
    height: 85vh;
    min-height: 500px;
    max-height: 900px;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    transition: opacity 1s;
}
.hero-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, var(--bg) 0%, transparent 50%),
        linear-gradient(to right, rgba(0,0,0,.8) 0%, transparent 60%),
        linear-gradient(to bottom, rgba(0,0,0,.4) 0%, transparent 20%);
}

.hero-content {
    position: absolute;
    bottom: 20%;
    left: 4%;
    max-width: 550px;
    z-index: 2;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(229,9,20,.2);
    border: 1px solid rgba(229,9,20,.5);
    color: var(--red);
    font-size: .75rem;
    font-weight: 600;
    padding: .3rem .75rem;
    border-radius: 20px;
    margin-bottom: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 2px 2px 10px rgba(0,0,0,.8);
    margin-bottom: .5rem;
}
.hero-desc {
    color: var(--gray-200);
    font-size: .95rem;
    line-height: 1.5;
    margin-bottom: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
    color: var(--gray-200);
    margin-bottom: 1.25rem;
}
.hero-meta .year { color: var(--gray-100); font-weight: 500; }
.hero-meta .rating {
    border: 1px solid var(--gray-300);
    padding: .1rem .5rem;
    border-radius: 3px;
    font-size: .75rem;
}
.hero-meta .category {
    color: var(--red);
    font-weight: 500;
}

.hero-actions { display: flex; gap: .75rem; }
.btn-play, .btn-info {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-play {
    background: var(--white);
    color: #111;
}
.btn-play:hover { background: rgba(255,255,255,.8); }
.btn-info {
    background: rgba(109,109,110,.7);
    color: var(--white);
}
.btn-info:hover { background: rgba(109,109,110,.5); }

/* ============ CONTENT ROWS ============ */
.content-rows {
    position: relative;
    margin-top: -8rem;
    padding-bottom: 3rem;
    z-index: 10;
}

.content-row {
    margin-bottom: 2.5rem;
    padding: 0 4%;
}
.row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .6rem;
}
.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gray-100);
}
.row-see-all {
    color: var(--gray-200);
    font-size: .8rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .3rem;
    opacity: 0;
    transition: opacity var(--transition);
}
.content-row:hover .row-see-all { opacity: 1; }

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

/* Content Card - Netflix style */
.card {
    flex: 0 0 auto;
    width: 250px;
    border-radius: var(--radius);
    overflow: visible;
    cursor: pointer;
    transition: transform .3s ease, box-shadow .3s ease;
    position: relative;
    background: var(--bg-card);
}
.card:hover {
    transform: scale(1.4);
    box-shadow: 0 8px 40px rgba(0,0,0,.85);
    z-index: 20;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-poster-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    transition: border-radius .3s;
}
.card:hover .card-poster-wrap {
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-poster {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: var(--gray-400);
}
.card-poster.portrait {
    aspect-ratio: 2/3;
}
.card-hover-info {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: .6rem .75rem .75rem;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,.7);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
    z-index: 21;
}
.card:hover .card-hover-info {
    opacity: 1;
    visibility: visible;
}
.card-actions {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-bottom: .4rem;
}
.card-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.5);
    background: rgba(42,42,42,.6);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    cursor: pointer;
    transition: all .15s;
}
.card-action-btn:hover {
    border-color: var(--white);
    background: rgba(255,255,255,.1);
}
.card-action-btn.play-btn {
    background: var(--white);
    color: #111;
    border-color: var(--white);
}
.card-action-btn.play-btn:hover {
    background: rgba(255,255,255,.8);
}
.card-action-btn.expand-btn {
    margin-left: auto;
}
.card-title {
    font-size: .78rem;
    font-weight: 600;
    color: var(--gray-100);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-meta {
    font-size: .68rem;
    color: var(--gray-300);
    margin-top: .15rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.card-meta .match {
    color: #46d369;
    font-weight: 600;
}
.card-meta .age-badge {
    border: 1px solid var(--gray-300);
    padding: 0 .3rem;
    border-radius: 2px;
    font-size: .6rem;
    line-height: 1.4;
}
.card-genres {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-top: .2rem;
    font-size: .65rem;
    color: var(--gray-200);
}
.card-genres .dot {
    width: 3px;
    height: 3px;
    background: var(--gray-300);
    border-radius: 50%;
    flex-shrink: 0;
}
.card-badge {
    background: var(--red);
    color: white;
    font-size: .6rem;
    font-weight: 700;
    padding: .15rem .4rem;
    border-radius: 3px;
    position: absolute;
    top: 8px;
    left: 8px;
    text-transform: uppercase;
    z-index: 2;
}
.card-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,.2);
    z-index: 2;
}
.card-progress-bar {
    height: 100%;
    background: var(--red);
    border-radius: 0 2px 2px 0;
}

/* Channel card (landscape) */
.card.channel-card { width: 300px; }

/* Top 10 Row */
.top10-slider .card {
    width: 250px;
    display: flex;
    align-items: flex-end;
    overflow: visible;
    background: transparent;
}
.top10-slider .card:hover {
    transform: scale(1.05);
    z-index: 5;
}
.top10-slider .card:hover .card-hover-info { display: none; }
.top10-number {
    font-size: 8rem;
    font-weight: 900;
    line-height: .8;
    color: transparent;
    -webkit-text-stroke: 3px var(--gray-200);
    font-family: 'Inter', sans-serif;
    margin-right: -1.5rem;
    z-index: 1;
    user-select: none;
    flex-shrink: 0;
}
.top10-poster {
    width: 130px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* ============ SEARCH RESULTS ============ */
.search-results {
    padding: calc(var(--nav-height) + 2rem) 4% 3rem;
}
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.content-grid .card {
    width: 100%;
}

/* ============ DETAIL MODAL ============ */
.detail-modal {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
    overflow-y: auto;
}
.detail-modal.show { display: flex; }

.detail-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(5px);
}
.detail-content {
    position: relative;
    width: 95%;
    max-width: 900px;
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 60px rgba(0,0,0,.8);
    margin-bottom: 2rem;
}
.detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: var(--bg);
    border: none;
    color: var(--white);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--transition);
}
.detail-close:hover { background: var(--gray-400); }

.detail-hero {
    position: relative;
    height: 400px;
}
.detail-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.detail-hero-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, var(--surface) 0%, transparent 60%),
        linear-gradient(to right, rgba(0,0,0,.6) 0%, transparent 50%);
}
.detail-hero-info {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    z-index: 2;
}
.detail-hero-info h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.detail-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .85rem;
    color: var(--gray-200);
    margin-bottom: 1rem;
}
.detail-actions { display: flex; gap: .75rem; }

.detail-body { padding: 1.5rem 2rem 2rem; }
.detail-description {
    color: var(--gray-200);
    font-size: .9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.5rem;
}
.detail-tag {
    background: var(--gray-400);
    color: var(--gray-200);
    padding: .25rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
}

/* Episodes */
.episodes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.episodes-header h3 { font-size: 1.2rem; font-weight: 600; }
.season-selector {
    position: relative;
}
.season-dropdown {
    padding: .5rem 2rem .5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--gray-400);
    border-radius: var(--radius);
    color: var(--white);
    font-size: .9rem;
    font-family: var(--font);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
}
.season-dropdown:hover { border-color: var(--gray-300); }
.season-dropdown:focus { outline: none; border-color: var(--white); }

.episodes-list { display: flex; flex-direction: column; gap: .5rem; }
.episode-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem;
    background: rgba(255,255,255,.04);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}
.episode-item:hover { background: rgba(255,255,255,.1); }
.episode-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-300);
    min-width: 2rem;
    text-align: center;
}
.episode-thumb {
    width: 130px;
    height: 73px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--gray-400);
    flex-shrink: 0;
}
.episode-info { flex: 1; }
.episode-title {
    font-size: .85rem;
    font-weight: 500;
    color: var(--gray-100);
}
.episode-duration {
    font-size: .75rem;
    color: var(--gray-300);
}

/* ============ PLAYER ============ */
.player-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #000;
    display: flex;
    flex-direction: column;
}
.player-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(to bottom, rgba(0,0,0,.8), transparent);
    z-index: 10;
    opacity: 0;
    transition: opacity .3s;
}
.player-overlay:hover .player-header { opacity: 1; }
.player-back {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}
.player-title {
    font-size: 1.1rem;
    font-weight: 500;
}
.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============ LOADER ============ */
.global-loader {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--gray-400);
    border-top: 3px solid var(--red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* No poster fallback */
.no-poster {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 2.5rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .card { width: 200px; }
    .card:hover { transform: scale(1.1); }
    .card.channel-card { width: 250px; }
    .hero-title { font-size: 2.2rem; }
    .hero-content { max-width: 400px; }
    .top10-number { font-size: 6rem; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { height: 65vh; }
    .hero-title { font-size: 1.75rem; }
    .hero-content { max-width: 90%; bottom: 15%; }
    .content-row { padding: 0 3%; }
    .card { width: 160px; }
    .card:hover { transform: scale(1.05); }
    .card:hover .card-hover-info { display: none; }
    .card.channel-card { width: 200px; }
    .login-card { padding: 2rem 1.5rem; }
    .login-logo { font-size: 1.75rem; }
    .detail-hero { height: 250px; }
    .detail-hero-info h1 { font-size: 1.3rem; }
    .detail-body { padding: 1rem; }
    .content-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .section-title { font-size: 1.1rem; }
    .top10-number { font-size: 5rem; }
    .top10-poster { width: 100px; }
}

@media (max-width: 480px) {
    .card { width: 130px; }
    .hero-title { font-size: 1.4rem; }
    .btn-play, .btn-info { padding: .5rem 1rem; font-size: .85rem; }
    .top10-number { font-size: 4rem; }
    .top10-poster { width: 85px; }
}
