
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #060606;
  color: #fff;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.4;
  -webkit-font-feature-settings: "liga";
}


body.light {
  background: #f6f7fb;
  color: #111;
}


.container { width: 92%; max-width: 1100px; margin: 0 auto; padding: 20px 0; }


.header {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: sticky;
  top: 0;
  background: linear-gradient(180deg,#070707 0%, rgba(7,7,7,0.9) 70%);
  z-index: 30;
}
body.light .header {
  background: linear-gradient(180deg,#ffffff,#fafafa);
  border-bottom-color: rgba(0,0,0,0.06);
}
.header-inner { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo { color: #e50914; font-size: 1.6rem; letter-spacing: 1px; font-weight: 700; }


.controls { display: flex; gap: 10px; align-items: center; }
.controls input[type="search"] {
  min-width: 260px;
  max-width: 520px;
  width: 38vw;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: #fff;
  outline: none;
  font-size: 15px;
}
body.light .controls input[type="search"] {
  border-color: rgba(0,0,0,0.06);
  background: #fff;
  color: #111;
}
.controls input::placeholder { color: rgba(255,255,255,0.45); }
body.light .controls input::placeholder { color: rgba(0,0,0,0.35); }

.controls button {
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#searchBtn {
  background: #e50914;
  color: #fff;
  box-shadow: 0 6px 18px rgba(229,9,20,0.18);
  transition: transform .16s ease, box-shadow .16s;
}
#searchBtn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(229,9,20,0.22); }
#favoritesBtn {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 8px;
  align-items: center;
}
body.light #favoritesBtn { border-color: rgba(0,0,0,0.06); color: #111; }


.status { margin-top: 22px; color: #bbb; font-size: 14px; min-height: 20px; }


.movies-list { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 10px; padding-bottom: 30px; }


.movie-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.03);
}
body.light .movie-item { background: #fff; border: 1px solid rgba(0,0,0,0.06); }
.movie-thumb { width: 70px; height: 100px; flex: 0 0 70px; overflow: hidden; border-radius: 6px; background: #222; }
.movie-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.movie-meta { flex: 1; min-width: 0; }
.movie-meta h3 { font-size: 16px; margin-bottom: 6px; font-weight: 600; }
.movie-meta p { color: #bdbdbd; font-size: 14px; margin-bottom: 6px; }
.movie-actions { display: flex; gap: 8px; align-items: center; }


.badge { display: inline-block; padding: 6px 8px; border-radius: 999px; background: rgba(255,255,255,0.03); font-size: 13px; color: #ddd; }
.btn { padding: 8px 10px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; }
.btn-primary { background: #e50914; color: #fff; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.04); }
body.light .btn-ghost { color: #111; }


.more-wrap { display: flex; justify-content: center; margin: 18px 0 60px; }
.btn-secondary { background: transparent; border: 1px solid rgba(255,255,255,0.06); color: #fff; padding: 10px 18px; border-radius: 8px; cursor: pointer; }
body.light .btn-secondary { border-color: rgba(0,0,0,0.06); color: #111; }


.empty { text-align: center; padding: 40px 10px; color: #999; }


.fav-count {
  display: inline-block;
  background: #e50914;
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 6px;
}


.gamify { margin: 18px 0 40px; display: flex; gap: 12px; align-items: center; }
.gamify .level { padding: 8px 12px; border-radius: 999px; background: rgba(229,9,20,0.12); color: #e50914; font-weight: 700; }


.modal { display: none; position: fixed; inset: 0; z-index: 60; }
.modal[aria-hidden="false"] { display: flex; align-items: center; justify-content: center; padding: 2vh 12px; }


.modal-backdrop { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,0.75), rgba(0,0,0,0.6)); }


.modal-panel {
  position: relative;
  width: 100%;
  max-width: 1000px;
  max-height: calc(100vh - 6vh); 
  margin: 0 auto;
  background: linear-gradient(180deg,#0e0e0e,#0b0b0b);
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.7);
  padding: 18px;
  z-index: 65;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow: auto; 
}
body.light .modal-panel { background: #fff; color: #111; }


.modal-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
  flex-wrap: nowrap;
}


@media (max-width: 840px) {
  .modal-panel { padding: 14px; }
  .modal-content { flex-direction: column; align-items: center; }
  .modal-pic { width: 180px; height: 260px; flex: 0 0 180px; }
}


#favChart {
  width: 100% !important;   
  max-width: 860px;         
  height: auto !important;  
  display: block;
  margin: 0 auto;
}


.modal-body { word-wrap: break-word; }


.modal-close {
  position: sticky;
  top: 12px;
  right: 12px;
  z-index: 70;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}
body.light .modal-close { color: #111; }


.modal-pic { width: 220px; height: 320px; border-radius: 8px; overflow: hidden; background: #222; flex: 0 0 220px; }
.modal-body { flex: 1; padding-left: 6px; }
.modal-body h2 { margin-bottom: 6px; }
.modal-body p { color: #ccc; margin-bottom: 8px; }


.modal-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }


@media (max-width: 800px) {
  .modal-panel { margin: 8vh 14px; flex-direction: column; align-items: center; }
  .modal-pic { width: 180px; height: 260px; flex: 0 0 180px; }
  .controls input { width: 60vw; }
}
@media (max-width: 480px) {
  .controls input { width: 68vw; }
  .movie-thumb { width: 64px; height: 92px; }
}


.hidden { display: none !important; }