* { box-sizing: border-box; }
:root { --bg: #0a0a0a; --card: #161616; --accent: #ffc107; --text: #f0f0f0; --dim: #999; --shadow: 0 10px 30px rgba(0,0,0,0.8); }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 0; }

/* LOGIN PREMIUM */
.login-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%); }
.login-box { background: var(--card); padding: 40px; border-radius: 30px; width: 100%; max-width: 380px; box-shadow: var(--shadow); border: 1px solid #222; }
.login-logo { width: 100%; max-width: 280px; height: auto; margin: 0 auto 30px auto; display:block; }
input { width: 100%; padding: 14px; margin-bottom: 20px; border-radius: 12px; border: 1px solid #333; background: #222; color: #fff; font-size: 15px; text-align: center; }
.btn-action { width: 100%; padding: 14px; background: var(--accent); color: #fff; font-weight: 800; border: none; border-radius: 12px; font-size: 15px; cursor: pointer; transition: 0.2s; text-transform: uppercase; letter-spacing: 1px; }
.legal { margin-top: 25px; font-size: 10px; color: #555; text-align: center; line-height: 1.4; border-top: 1px solid #222; padding-top: 15px; }

.container { padding: 15px; max-width: 1400px; margin: 0 auto; }
.top-nav { text-align: center; margin-bottom: 25px; display: flex; flex-direction: column; align-items: center; gap: 15px; position: relative; z-index: 100; }
.top-nav img { width: 100%; max-width: 320px; height: auto; margin-bottom: 5px; }
.nav-btn { background: rgba(0,0,0,0.5); border: 2px solid var(--accent); color: var(--accent); padding: 10px 25px; border-radius: 30px; font-weight: 800; cursor: pointer; text-decoration: none; font-size: 14px; }

/* HERO SECTION - PLAKAT Z BOKU */
.hero { position: relative; width: 100%; padding: 40px 4%; margin-top: -150px; padding-top: 180px; border-bottom: 1px solid #222; display: flex; align-items: center; justify-content: center; gap: 40px; background: radial-gradient(circle at top right, #1a1a1a 0%, #000 100%); }
.hero-poster { width: 100%; max-width: 280px; border-radius: 12px; box-shadow: 0 15px 40px rgba(0,0,0,0.9); border: 1px solid #333; flex-shrink: 0; }
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.hero-tag { font-size: 11px; font-weight: 800; color: var(--accent); letter-spacing: 2px; margin-bottom: 10px; text-transform: uppercase; }
.hero-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; line-height: 1.1; margin: 0 0 10px 0; color: #fff; text-shadow: 2px 2px 5px rgba(0,0,0,0.5); }
.hero-meta { display: flex; gap: 15px; font-size: 13px; color: #aaa; margin-bottom: 15px; font-weight: 600; }
.hero-desc { font-size: 1rem; line-height: 1.6; color: #ccc; margin-bottom: 25px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.hero-btns { display: flex; gap: 15px; flex-wrap: wrap; }
.btn-hero { padding: 12px 25px; border-radius: 8px; font-weight: 800; font-size: 13px; border: none; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.2s; text-decoration: none; }
.btn-hero.primary { background: var(--accent); color: #000; }
.btn-hero.secondary { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); }

@media (max-width: 768px) {
    .hero { flex-direction: column; text-align: center; gap: 20px; padding-top: 130px; }
    .hero-poster { max-width: 180px; }
    .hero-meta { justify-content: center; }
    .hero-btns { justify-content: center; }
}

#addPanel { display: none; background: var(--card); padding: 25px; border-radius: 20px; max-width: 600px; margin: 0 auto 30px auto; border: 1px solid #333; position: relative; z-index: 100;}
.type-switch { display: flex; gap: 10px; margin-bottom: 15px; }
.type-btn { flex: 1; padding: 15px; background: #222; border: 2px solid #333; color: #777; font-weight: 800; border-radius: 12px; cursor: pointer; text-align: center; }
.type-btn.active { background: rgba(255, 193, 7, 0.1); border-color: var(--accent); color: var(--accent); }
.ep-row { display: flex; gap: 8px; margin-bottom: 5px; }
.add-ep-btn { background: #333; color: #fff; border: none; padding: 5px 15px; border-radius: 5px; cursor: pointer; font-size: 12px; margin-bottom: 10px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 20px; max-width: 1400px; margin: 0 auto; position: relative; z-index: 10;}
@media (min-width: 768px) { .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; } }

.card { background: var(--card); border-radius: 15px; overflow: hidden; position: relative; border: 1px solid #222; display: flex; flex-direction: column; cursor: pointer; transition: 0.2s; }
.card:hover { border-color: #444; }
.cover { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.type-icon { position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.8); width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.2); z-index: 5; }

.icon-top-btn { position: absolute; top: 10px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; z-index: 10; font-size: 14px; border: none; cursor: pointer; color: #fff; font-weight: bold; }
.del-btn { right: 10px; background: rgba(255, 68, 68, 0.9); }
.edit-btn { right: 48px; background: rgba(255, 193, 7, 0.9); color:#000; }
.pin-btn { right: 86px; background: rgba(0, 150, 255, 0.9); }

.info { padding: 12px; flex-grow: 1; display: flex; flex-direction: column; }
.movie-title { margin: 0 0 5px 0; font-size: 0.9rem; font-weight: 800; color: #fff; }
.meta { font-size: 11px; color: var(--dim); display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 600; }

/* SZCZEGÓŁY MODAL */
#detailsModal .modal-content { max-width: 700px; padding: 25px; display: flex; gap: 20px; flex-direction: column; }
@media(min-width: 600px) { #detailsModal .modal-content { flex-direction: row; } }
.detail-cover { width: 100%; max-width: 200px; border-radius: 8px; align-self: center; box-shadow: 0 5px 20px rgba(0,0,0,0.5); }
.detail-info { flex: 1; }
.detail-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 10px; color: #fff; line-height: 1.2;}
.detail-meta { font-size: 12px; color: #888; margin-bottom: 15px; font-weight: 600; display: flex; gap: 10px; }
.detail-desc { font-size: 0.9rem; line-height: 1.6; color: #ccc; margin-bottom: 25px; max-height: 200px; overflow-y: auto; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-detail { padding: 10px 15px; border-radius: 8px; border: none; font-weight: 800; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 12px; text-decoration:none; color: #fff; background: #333; }
.btn-detail.primary { background: var(--accent); color: #000; }

/* MODALE */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.95); display: none; align-items: center; justify-content: center; z-index: 2000; padding: 10px; }
.modal-content { background: #1c1c1c; padding: 20px; border-radius: 20px; width: 100%; max-width: 500px; border: 1px solid #333; max-height: 80vh; overflow-y: auto; display: flex; flex-direction: column; position: relative; }
.ep-list-btn { width: 100%; padding: 12px; margin: 5px 0; background: #222; border: 1px solid #333; color: #fff; text-align: left; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; }

#playerModal .modal-content { background: #000; padding: 0; width: 100%; max-width: 1000px; max-height: 100vh; border: 1px solid #333; overflow: hidden; border-radius: 0; }
@media (min-width: 768px) { #playerModal .modal-content { border-radius: 20px; max-height: 90vh; } }
.player-header { padding: 10px 15px; background: #111; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #222; flex-shrink: 0; }
.player-title { font-size: 13px; color: var(--accent); font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.video-box { width: 100%; flex-grow: 1; display: flex; align-items: center; background: #000; position: relative; aspect-ratio: 16/9; }
.video-box iframe, .video-box video { width: 100%; height: 100%; max-height: calc(100vh - 50px); object-fit: contain; border: none; }
.player-watermark { position: absolute; top: 10px; right: 10px; width: 60px; opacity: 0.4; pointer-events: none; z-index: 50; }
.close-btn { background: transparent; border: 1px solid #333; color: #fff; padding: 5px 12px; border-radius: 5px; cursor: pointer; font-size: 11px; }
.close-block { margin-top: 15px; background: #333; color: #fff; border: none; padding: 12px; width: 100%; border-radius: 10px; font-weight: 800; cursor: pointer; }