/* --- RESET --- */
:root { --bg: #050505; --card: #121212; --neon: #00ff41; --neon-dim: rgba(0,255,65,0.4); --red: #E50914; --text: #fff; --header-h: 77px; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; margin: 0; }

/* HEADER */
header { background: rgba(0,0,0,0.9); backdrop-filter: blur(10px); padding: 15px 40px; display: flex; justify-content: space-between; border-bottom: 1px solid #222; position: sticky; top: 0; z-index: 1000; height: 45px; box-sizing: content-box; }
.logo-area h1 { margin: 0; font-family: 'Rajdhani', sans-serif; letter-spacing: -1px; }
.highlight { color: var(--neon); text-shadow: 0 0 10px var(--neon); }
.logo-sub { font-size: 0.6rem; letter-spacing: 3px; color: #666; display: block; }
.header-right { display: flex; gap: 20px; align-items: center; }
.refresh-btn { background: transparent; border: 1px solid var(--neon); color: var(--neon); padding: 8px 15px; font-weight: 700; cursor: pointer; border-radius: 4px; transition: 0.2s; white-space: nowrap; }
.refresh-btn:hover:not(:disabled) { background: var(--neon); color: #000; box-shadow: 0 0 15px var(--neon); }
.refresh-btn:disabled { border-color: #444; color: #666; cursor: not-allowed; }
.admin-link { color: #666; text-decoration: none; font-weight: 700; font-size: 0.8rem; }

/* CONTROL BAR (STICKY) */
.control-bar { display: flex; gap: 15px; padding: 15px 40px; background: #090909; border-bottom: 1px solid #1a1a1a; flex-wrap: wrap; align-items: center; position: sticky; top: var(--header-h); z-index: 900; transition: top 0.3s; box-shadow: 0 5px 20px rgba(0,0,0,0.5); }
.search-box { flex: 1; min-width: 200px; position: relative; display: flex; align-items: center; }
.search-box svg { position: absolute; left: 12px; width: 18px; color: #666; }
.search-box input { width: 100%; padding: 10px 12px 10px 40px; background: #1a1a1a; border: 1px solid #333; color: #fff; border-radius: 6px; }
.search-box input:focus { border-color: var(--neon); outline: none; }
select { padding: 10px; background: #1a1a1a; border: 1px solid #333; color: #fff; border-radius: 6px; cursor: pointer; }

/* MOVIE COUNTER */
.movie-counter-badge {
    background: #151515; border: 1px solid #333; padding: 8px 15px; border-radius: 4px; 
    font-family: 'Rajdhani', sans-serif; font-weight: 700; color: #888; white-space: nowrap;
}
.movie-counter-badge span { color: var(--neon); margin-right: 5px; }

/* PAGINATION */
.pagination-container { display: flex; gap: 5px; align-items: center; }
.page-btn { background: #1a1a1a; border: 1px solid #333; color: #fff; width: 32px; height: 32px; border-radius: 4px; cursor: pointer; font-family: 'Rajdhani', sans-serif; font-weight: 700; display: flex; justify-content: center; align-items: center; transition: 0.2s; }
.page-btn:hover { border-color: var(--neon); color: var(--neon); }
.page-btn.active { background: var(--neon); color: #000; border-color: var(--neon); }
.page-btn:disabled { opacity: 0.3; cursor: default; }

/* GRID */
.container { max-width: 1400px; margin: 0 auto; padding: 30px; }
.section-title { font-family: 'Rajdhani', sans-serif; color: #666; border-left: 3px solid var(--neon); padding-left: 15px; font-size: 1.5rem; }
.movie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 25px; }

.movie-card { cursor: pointer; transition: transform 0.2s; }
.movie-card:hover { transform: translateY(-5px); }

.card-image-container { width: 100%; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; position: relative; background: #111; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.card-image-container img { width: 100%; height: 100%; object-fit: cover; }

/* BADGES */
.card-tags-overlay { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.home-tag { font-size: 0.55rem; font-weight: 800; padding: 3px 6px; border-radius: 3px; text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.tag-default { background: rgba(0,0,0,0.8); color: #fff; }
.tag-1080 { background: rgba(0, 110, 255, 0.9); }
.tag-4k { background: var(--neon); color: #000; box-shadow: 0 0 10px var(--neon); }
.tag-lang { background: var(--red); color: #fff; }

.card-content h3 { margin-top: 10px; font-size: 0.85rem; color: #ddd; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; height: 4.5em; }

/* MODAL FIX */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 2000; justify-content: center; align-items: center; padding: 20px; }
.modal-content { background: #0a0a0a; width: 100%; max-width: 1000px; height: 85vh; border-radius: 12px; display: flex; overflow: hidden; border: 1px solid #333; position: relative; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 30px; color: #fff; cursor: pointer; z-index: 10; }

.detail-layout { display: flex; width: 100%; height: 100%; }
.poster-col { width: 40%; background: #000; display: flex; justify-content: center; align-items: center; position: relative; }
/* UPDATED: Contain ensures no cropping */
.detail-poster { width: 100%; height: 100%; object-fit: contain; } 
.info-col { width: 60%; padding: 40px; overflow-y: auto; }
.info-col h2 { margin-top: 0; font-family: 'Rajdhani', sans-serif; font-size: 1.8rem; margin-bottom: 30px; color: #fff; }

/* HOLOGRAPHIC CARD */
.download-container { display: flex; flex-direction: column; gap: 12px; }
.tech-card { display: flex; background: linear-gradient(90deg, #111 0%, #151515 100%); border: 1px solid #222; border-left: 4px solid var(--neon); border-radius: 6px; text-decoration: none; color: #fff; transition: 0.2s; align-items: center; }
.tech-card:hover { transform: translateX(5px); background: #1a1a1a; box-shadow: 0 0 15px rgba(0,255,65,0.1); border-color: #444; }
.tech-left { padding: 15px; display: flex; flex-direction: column; align-items: center; gap: 5px; background: rgba(0,0,0,0.3); min-width: 80px; border-right: 1px solid #222; }
.res-glow { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.2rem; color: var(--neon); text-shadow: 0 0 10px rgba(0,255,65,0.2); }
.meta-tag { font-size: 0.6rem; font-weight: 700; color: #666; text-transform: uppercase; }
.tech-mid { flex: 1; padding: 15px; }
.tech-details-text { font-family: 'Inter', sans-serif; font-size: 0.8rem; color: #aaa; line-height: 1.4; }
.tech-right { padding: 20px; color: #444; }
.tech-card:hover .tech-right { color: var(--neon); }
.tech-right svg { width: 24px; }

/* HERO BANNER */
.hero-banner-container { width: 100%; overflow: hidden; border-bottom: 1px solid #222; background: #000; line-height: 0; }
.hero-banner-img { width: 100%; height: auto; display: block; object-fit: cover; max-height: 500px; }

/* ADMIN & OTHERS */
.admin-nav-bar { background: rgba(0,0,0,0.9); padding: 15px 40px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; }
.nav-logo { height: 45px; width: auto; display: block; }

/* ADMIN TABLES */
.movie-table { width: 100%; border-collapse: collapse; background: #0e0e0e; border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
.movie-table th, .movie-table td { padding: 12px; text-align: left; border-bottom: 1px solid #222; color: #ccc; font-size: 0.9rem; vertical-align: middle; }
.movie-table th { background: #1a1a1a; color: var(--neon); font-family: 'Rajdhani', sans-serif; }
.movie-table tr:hover { background: #151515; }
.thumb-img { width: 60px; height: auto; aspect-ratio: 2/3; object-fit: cover; border-radius: 3px; display: block; }
.title-truncate { display: block; max-width: 350px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* LOGIN SCREEN */
.login-screen { height: 100vh; display: flex; justify-content: center; align-items: center; background: radial-gradient(circle at center, #111 0%, #000 100%); }
.login-box { background: #0a0a0a; border: 1px solid #333; padding: 40px; width: 100%; max-width: 400px; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.8); text-align: center; position: relative; overflow: hidden; }
.login-box::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--neon); box-shadow: 0 0 10px var(--neon); }
.login-logo { width: 100%; max-width: 350px; height: auto; margin-bottom: 25px; display: block; margin-left: auto; margin-right: auto; }
.input-group input { width: 100%; padding: 12px; background: #050505; border: 1px solid #333; color: #fff; margin-bottom: 20px; box-sizing: border-box; }
.action-btn { width: 100%; padding: 12px; background: var(--neon-dim); color: var(--neon); border: 1px solid var(--neon); font-weight: 700; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; }
.action-btn:hover { background: var(--neon); color: #000; box-shadow: 0 0 15px var(--neon); }

/* TAB MENU */
.tab-menu { display: flex; gap: 20px; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 10px; }
.tab-btn { background: none; border: none; color: #666; font-family: 'Rajdhani', sans-serif; font-size: 1.2rem; cursor: pointer; padding: 10px; transition: 0.3s; }
.tab-btn.active { color: var(--neon); border-bottom: 2px solid var(--neon); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.5s; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-logo { height: 35px; }
    .hero-banner-img { min-height: 150px; object-fit: contain; }
    .control-bar { padding: 15px; gap: 10px; }
    .search-box { min-width: 100%; order: 1; }
    .filter-box, .pagination-container { order: 2; flex: 1; }
    .movie-counter-badge { order: 3; width: 100%; text-align: center; }
    
    .detail-layout { flex-direction: column; }
    .poster-col { width: 100%; height: 300px; }
    .info-col { width: 100%; padding: 15px; } 
    .modal-content { height: 90vh; }
    .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    .tech-card { display: flex; align-items: center; padding: 0; min-height: 50px; width: 100%; box-sizing: border-box; }
    .tech-left { width: 55px; min-width: 55px; flex-shrink: 0; padding: 8px 2px; }
    .res-glow { font-size: 0.9rem; }
    .meta-tag { font-size: 0.5rem; }
    .tech-mid { padding: 6px 8px; flex: 1; min-width: 0; }
    .tech-details-text { font-size: 0.75rem; line-height: 1.2; word-break: break-all; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .tech-right { width: 40px; min-width: 40px; flex-shrink: 0; padding: 0; display: flex; justify-content: center; align-items: center; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.loading, .error { text-align: center; color: #555; padding: 20px; font-family: 'Rajdhani', sans-serif; }