:root {
    --accent-pink: #ff3838;
    --accent-purple: #3867d6;  
    --bg-dark: #050505;
    --bg-sidebar: #0f0f0f;
    --bg-card: #141414;
    --text-white: #ffffff;
    --gradient-btn: linear-gradient(90deg, #ff3838 0%, #ff3838 100%);
    
    --header-height: 80px; 
    --bottom-nav-height: 70px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; -webkit-tap-highlight-color: transparent; outline: none; }

body { 
    background-color: var(--bg-dark); 
    color: var(--text-white); 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}

/* --- TELA DE LOGIN --- */
#login-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: black; z-index: 5000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background-image: linear-gradient(rgba(0,0,0,0.8), rgba(0,0,0,0.9)), url('https://images.unsplash.com/photo-1574375927938-d5a98e8efe30?q=80&w=1000&auto=format&fit=crop');
    background-size: cover; background-position: center;
}
.login-box {
    width: 90%; max-width: 400px;
    background: rgba(20, 20, 20, 0.95);
    padding: 40px 30px; border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.login-logo { font-size: 2rem; font-weight: 900; color: var(--accent-pink); margin-bottom: 30px; letter-spacing: 1px; }
.login-input {
    width: 100%; padding: 15px; margin-bottom: 15px;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px; color: white; font-size: 1rem; text-align: center;
}
.login-input:focus { border-color: var(--accent-purple); background: black; }
.login-btn {
    width: 100%; padding: 15px; margin-top: 10px;
    background: var(--gradient-btn); border: none;
    border-radius: 50px; color: white; font-weight: 800; font-size: 1rem;
    cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}
.login-server-info { margin-top: 20px; font-size: 0.8rem; color: #666; }

/* --- TOPBAR --- */
.topbar {
    height: var(--header-height); 
    display: flex;  
    align-items: flex-start;
    padding: 15px 20px; 
    background: linear-gradient(to bottom, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    position: fixed; top: 0; left: 0; width: 100%; z-index: 100;
    pointer-events: none; 
}
.topbar > * { pointer-events: auto; }

.logo { font-size: 1.1rem; font-weight: 900; color: var(--accent-pink); margin-top: 8px; margin-right: 15px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }

.icomenu1{
    text-align: center; 
}
.icomenu1 img{
    width:90%;
    margin-top:3px; 
}

.icomenu2{ 
    width: 12%;
    margin-left:55%;
    margin-right:3%;
    text-align: right;
}
.icomenu2 img{
   width:100%;
   margin-top:0px; 
}

.icomenu3{
    width: 0px;
    text-align: center;
    opacity: 0;
}
.icomenu3 img{
    width:60%;
    margin-top:0px; 
}

.icomenu4{
    width: 12%;
    text-align: right;
}
.icomenu4 img{
    width:100%;
    margin-top:0px; 
}

.search-box {
    display: flex;
    align-items: center; 
    background: rgba(20, 20, 20, 0.7); 
    backdrop-filter: blur(10px);
    border-radius: 50px; 
    padding: 8px 15px;
    flex: 1; 
    border: 1px solid rgba(255,255,255,0.1); 
    transition: 0.3s;
    max-width: 500px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    max-width: 0px;
    width: 0px;
    opacity: 0;
    overflow: hidden;
}
.search-box:focus-within { border-color: var(--accent-purple); background: #000; }
.search-input { outline: none !important; background: transparent; border: 0px !important; border-color:transparent !important; color: white; padding: 0 10px; outline: none; width: 100%; font-weight: 500; font-size: 0.9rem; }
.search-btn-icon { color: #ccc; }

/* --- BOTTOM NAV --- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: var(--bottom-nav-height);
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 1000;
    padding-bottom: 5px; 
}

.nav-btn {
    background: transparent; border: none; color: #666; 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; cursor: pointer; transition: 0.3s;
    flex: 1; height: 100%;
}
.nav-btn i { font-size: 1.4rem; margin-bottom: 2px; }
.nav-btn span { font-size: 0.7rem; font-weight: 600; }
.nav-btn.active { color: var(--accent-pink); }
.nav-btn.active i { transform: translateY(-3px); text-shadow: 0 0 15px var(--accent-pink); }

.back-btn-float { 
    position: fixed; bottom: 90px; right: 20px; 
    width: 50px; height: 50px; border-radius: 50%; 
    background: var(--accent-purple); color: white; border: none; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); z-index: 101; 
    display: none; align-items: center; justify-content: center; font-size: 1.2rem;
}
.back-btn-float.show { display: flex; }

/* --- LAYOUT --- */
.main-layout { display: flex; height: 100vh; width: 100%; padding-top: var(--header-height); padding-bottom: var(--bottom-nav-height); }

.cat-sidebar {
    width:0px;
    opacity: 0;
    background: var(--bg-sidebar); border-right: 1px solid #222; 
    overflow-y: auto; flex-shrink: 0; padding: 10px; 
    display: flex; flex-direction: column; align-items: center;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-sidebar) var(--bg-sidebar) !important;
}
@media (min-width: 768px) { .cat-sidebar { width: 250px; align-items: stretch; } }

.cat-title-header { font-size: 0.7rem; color: #555; font-weight: 700; margin-bottom: 10px; text-align: center; text-transform: uppercase; }
.cat-item { 
    padding: 12px 5px; margin-bottom: 5px; border-radius: 10px; cursor: pointer; color: #888; 
    font-size: 0.75rem; transition: 0.2s; font-weight: 500; text-align: center; border: 1px solid transparent; width: 100%;
    word-break: break-word;
}
@media (min-width: 768px) { .cat-item { text-align: left; padding-left: 15px; font-size: 0.9rem; } }
.cat-item:hover { background: #1f1f1f; color: white; }
.cat-item.active { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); border-color: var(--accent-purple); font-weight: 700; }

.logout-btn-sidebar {
    margin-top: auto; padding: 10px; width: 100%; text-align: center;
    color: #ff4444; font-size: 0.7rem; cursor: pointer; border-top: 1px solid #222;
}

.content-grid-area { flex: 1; overflow-y: auto; padding: 10px; background: var(--bg-dark); }
.section-title { opacity: 0 !important; font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; color: white; padding-left: 10px; }

.media-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); 
    gap: 10px; padding-bottom: 20px; 
}
@media (min-width: 600px) { .media-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; } }

.fav-filters { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; padding: 0 10px 10px 10px; }
.fav-filter-btn { padding: 6px 16px; background: #1f1f1f; border-radius: 20px; color: #aaa; cursor: pointer; font-weight: bold; font-size: 0.8rem; white-space: nowrap; }
.fav-filter-btn.active { background: var(--text-white); color: black; }

.card { 
    background: var(--bg-card); border-radius: 8px; overflow: hidden; position: relative; 
    cursor: pointer; aspect-ratio: 2/3; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.card:focus, .card:hover { transform: scale(1.05); z-index: 10; outline: 3px solid var(--accent-pink); }
.card img { width: 100%; height: 100%; object-fit: cover; background: #222; }

.type-badge { position: absolute; top: 5px; right: 5px; padding: 2px 6px; border-radius: 4px; font-size: 0.55rem; font-weight: 800; text-transform: uppercase; color: white; z-index: 5; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.badge-movie { background: var(--accent-purple); }
.badge-series { background: var(--accent-pink); }
.badge-live { background: #ef4444; }

.card-title {
    position: absolute; bottom: 0; width: 100%; padding: 40px 5px 5px 5px;
    background: linear-gradient(to top, rgba(0,0,0,1) 10%, transparent);
    font-size: 0.75rem; text-align: center; color: white; font-weight: 600; pointer-events: none;
}
.card-progress-container { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: rgba(255,255,255,0.3); z-index: 6; }
.card-progress-fill { height: 100%; background: var(--accent-pink); width: 0%; }

/* --- HOME HERO --- */
#home-view { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: var(--bg-dark); z-index: 50; overflow-y: auto; 
    padding-bottom: var(--bottom-nav-height);
}
.hero-banner { height: 60vh; width: 100%; position: relative; display: flex; align-items: flex-end; padding-bottom: 30px; }
.hero-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; mask-image: linear-gradient(to bottom, black 50%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%); z-index: 1; opacity: 0.8; }
.hero-content { position: relative; z-index: 3; padding: 0 20px; width: 100%; text-shadow: 0 2px 10px black; }
.hero-greeting { font-size: 0.9rem; color: var(--accent-pink); font-weight: 700; text-transform: uppercase; margin-bottom: 5px; }
.hero-title-large { font-size: 2.5rem; font-weight: 900; line-height: 1.1; margin-bottom: 15px; }
.hero-buttons { display: flex; gap: 10px; }
.btn-hero { padding: 10px 25px; border: none; border-radius: 50px; font-size: 0.9rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; background: white; color: black; }
.btn-hero.secondary { background: rgba(255, 255, 255, 0.2); color: white; backdrop-filter: blur(10px); }

.home-rows { padding: 10px 0; }
.home-section { padding: 0 20px; margin-bottom: 30px; }
.home-section-title { color: white; font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.horizontal-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-sidebar) var(--bg-sidebar) !important;
}
.card-home { min-width: 110px; width: 110px; aspect-ratio: 2/3; background: var(--bg-card); border-radius: 8px; overflow: hidden; position: relative; flex-shrink: 0; }
.card-home img { width: 100%; height: 100%; object-fit: cover; }

/* --- DETAILS OVERLAY --- */
#details-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 2000; display: none;
    flex-direction: column; overflow-y: auto;
}
.details-header { height: 40vh; width: 100%; background-size: cover; background-position: top; position: relative; flex-shrink: 0; }
.details-header::after { content:''; position: absolute; top:0; left:0; width:100%; height:100%; background: linear-gradient(to top, #000 5%, transparent 100%); }
.details-content-layer { 
    position: relative; margin-top: -60px; padding: 0 20px; 
    display: flex; flex-direction: column; gap: 20px; z-index: 10; padding-bottom: 80px; 
}
@media(min-width: 768px) { .details-content-layer { flex-direction: row; align-items: flex-end; margin-top: -100px; padding: 0 50px 50px 50px; } }

.details-poster { width: 140px; aspect-ratio: 2/3; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.8); object-fit: cover; background: #222; align-self: center; }
.details-info { flex: 1; text-align: center; }
@media(min-width: 768px) { .details-info { text-align: left; } }

.details-title { font-size: 1.8rem; font-weight: 900; margin-bottom: 10px; line-height: 1.1; }
.details-meta { display: flex; gap: 8px; justify-content: center; margin-bottom: 15px; font-size: 0.8rem; color: #ccc; flex-wrap: wrap; }
@media(min-width: 768px) { .details-meta { justify-content: flex-start; } }
.meta-tag { padding: 4px 8px; background: rgba(255,255,255,0.15); border-radius: 4px; font-weight: bold; }

.details-plot { font-size: 0.95rem; color: #ccc; margin-bottom: 20px; line-height: 1.5; max-height: 150px; overflow-y: auto; background: rgba(255,255,255,0.05); padding: 10px; border-radius: 8px; text-align: left; }

.cast-section { width: 100%; overflow: hidden; margin-bottom: 20px; }
.cast-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.cast-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid #333; }

/* --- SIMILARES AUMENTADOS --- */
.similar-section { width: 100%; margin-top: 10px; }
.similar-title { font-weight: 700; margin-bottom: 10px; color: #ddd; font-size: 1rem; text-align: left; }
.similar-list { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; }
.similar-card { 
    min-width: 140px; width: 140px;
    aspect-ratio: 2/3; 
    background: #1f1f1f; border-radius: 8px; 
    overflow: hidden; position: relative; flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.similar-card img { width: 100%; height: 100%; object-fit: cover; }
.similar-card-title { 
    position: absolute; bottom: 0; width: 100%; padding: 30px 2px 5px 2px;
    background: linear-gradient(to top, black, transparent); 
    font-size: 0.7rem; text-align: center; color: white; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.close-details-btn { position: absolute; top: 20px; right: 20px; z-index: 20; background: rgba(0,0,0,0.5); color: white; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; backdrop-filter: blur(5px); }

.episodes-area { background: #0a0a0a; border-radius: 12px; padding: 15px; margin-top: 20px; text-align: left; }
.season-tabs { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 15px; }
.season-tab { padding: 6px 15px; background: #222; border-radius: 20px; font-size: 0.85rem; color: #aaa; white-space: nowrap; }
.season-tab.active { background: white; color: black; }
.episode-item { display: flex; align-items: center; gap: 15px; background: #161616; padding: 10px; border-radius: 8px; margin-bottom: 8px; }

/* PLAYER */
#player-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 3000; display: none; justify-content: center; align-items: center; }
video { width: 100%; height: 100%; }
.player-actions { position: absolute; top: 20px; right: 20px; display: flex; gap: 15px; z-index: 3001; }
.player-btn { background: rgba(0,0,0,0.5); color: white; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; backdrop-filter: blur(5px); border: 1px solid rgba(255,255,255,0.2); }

.loader { position: fixed; top:50%; left:50%; transform: translate(-50%, -50%); display: none; color: var(--accent-purple); font-size: 3rem; z-index: 4000;}
:focus-visible { outline: 3px solid var(--accent-pink); }


#back-btn-container{
    display: none;
}

#fav-btn{
    opacity: 0;
}

#closePlayerr{

}

.nav-btn img{
    height:35px;
}