@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@500;700&display=swap");

:root {
  --discord-dark-bg: #23272a;
  --discord-dark-panel: #2f3136;
  --discord-dark-accent: #5865f2;
  --discord-dark-card: #36393f;
  --discord-dark-text: #fff;
  --discord-icon-bg: #5865f2;
  --discord-light-bg: #f9fafc;
  --discord-light-panel: #e3e6e8;
  --discord-light-accent: #5865f2;
  --discord-light-card: #f5f6fa;
  --discord-light-text: #23272a;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  background: var(--discord-dark-bg);
  color: var(--discord-dark-text);
  font-family: "Montserrat", "Lato", sans-serif;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

body.light-mode {
  background: var(--discord-light-bg);
  color: var(--discord-light-text);
}

.navbar {
  width: 100%;
  background: var(--discord-dark-panel);
  padding: 1.5rem 2rem;
  border-bottom: 2px solid var(--discord-dark-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

body.light-mode .navbar {
  background: var(--discord-light-panel);
  border-bottom: 2px solid var(--discord-light-accent);
}

.logo {
  color: var(--discord-dark-accent);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  font-family: Montserrat, sans-serif;
}

.toggle-wrapper {
  position: absolute;
  right: 5rem;
  top: 1.2rem;
  z-index: 1;
}

#mode-toggle {
  background: var(--discord-dark-accent);
  color: #fff;
  border: none;
  padding: 0.5em 0.8em;
  border-radius: 50px;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 2px 8px #23272a55;
  transition: background 0.2s, color 0.2s;
}

body.light-mode #mode-toggle {
  background: var(--discord-light-accent);
}

.main {
  width: 100%;
  min-height: 100vh;
  padding-top: 2rem;
  background: transparent;
  box-sizing: border-box;
}

.filter-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.filter-row select,
#sort-review {
  background: var(--discord-dark-card);
  color: var(--discord-dark-accent);
  border: none;
  font-size: 1rem;
  padding: 0.5em 1.2em;
  border-radius: 24px;
  outline: none;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

#sort-review {
  color: #fff;
  background: var(--discord-dark-accent);
  margin-left: 1em;
}
#sort-review:hover {
  background: #4752c4;
}

body.light-mode .filter-row select,
body.light-mode #sort-review {
  background: var(--discord-light-card);
  color: var(--discord-light-accent);
}
body.light-mode #sort-review {
  background: var(--discord-light-accent);
  color: #fff;
}

.search-row {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

#search {
  width: 400px;
  padding: 14px 18px;
  background: var(--discord-dark-card);
  color: var(--discord-dark-accent);
  font-size: 1.1rem;
  border: none;
  border-radius: 25px;
  outline: none;
  font-weight: 600;
  box-shadow: 0 2px 12px #23272a22;
  transition: background 0.2s, color 0.2s;
}

body.light-mode #search {
  background: var(--discord-light-card);
  color: var(--discord-light-accent);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.box {
  background: var(--discord-dark-card);
  color: var(--discord-dark-text);
  border-radius: 18px;
  width: 220px;
  box-shadow: 0 6px 24px #23272a77;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s;
  border: 1px solid #00000022;
  box-sizing: border-box;
}

body.light-mode .box {
  background: var(--discord-light-card);
  color: var(--discord-light-text);
  box-shadow: 0 6px 24px #e3e6e833;
}

.box img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.overlay {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 18px;
  background: rgba(54, 57, 63, 0.98);
  color: #fff;
  box-sizing: border-box;
  border-top: 2px solid var(--discord-dark-accent);
  max-height: 180px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s 0.1s;
  border-radius: 0 0 18px 18px;
}

body.light-mode .overlay {
  background: rgba(229, 231, 235, 0.97);
  color: var(--discord-light-text);
  border-top: 2px solid var(--discord-light-accent);
}

.box:hover .overlay {
  opacity: 1;
  pointer-events: auto;
}

.box:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 26px #5865f266;
  border: 1.5px solid var(--discord-dark-accent);
}
body.light-mode .box:hover {
  box-shadow: 0 10px 26px #5865f233;
  border: 1.5px solid var(--discord-light-accent);
}

.title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.title h2 {
  font-size: 1.2rem;
  margin: 0;
  color: var(--discord-dark-accent);
  font-weight: 700;
}

body.light-mode .title h2 {
  color: var(--discord-light-accent);
}

.title span {
  font-size: 1rem;
  background: var(--discord-dark-accent);
  color: #fff;
  padding: 0.22em 0.5em;
  border-radius: 12px;
  margin-left: 0.5em;
  font-weight: 700;
  letter-spacing: 1px;
}
body.light-mode .title span {
  background: var(--discord-light-accent);
}

.overlay h3 {
  margin: 0.75em 0 0.25em 0;
  font-size: 1em;
  font-weight: 600;
  color: var(--discord-dark-accent);
}
body.light-mode .overlay h3 {
  color: var(--discord-light-accent);
}

.overlay::-webkit-scrollbar {
  width: 8px;
}
.overlay::-webkit-scrollbar-thumb {
  background: var(--discord-dark-accent);
  border-radius: 4px;
}

/* DETAILS PAGE LAYOUT */
.details-container {
  max-width: 900px;
  margin: 2rem auto;
  background: var(--discord-dark-panel);
  color: var(--discord-dark-text);
  padding: 2rem 1.5rem;
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  box-shadow: 0 10px 28px #000a;
  box-sizing: border-box;
  align-items: flex-start;
}
body.light-mode .details-container {
  background: var(--discord-light-panel);
  color: var(--discord-light-text);
}
.poster-large {
  width: 300px;
  max-width: 100vw;
  border-radius: 14px;
  box-shadow: 0 6px 28px #0009;
  object-fit: cover;
  max-height: 450px;
  margin: 0 auto;
  display: block;
}
.details-info {
  flex: 1 1 300px;
  min-width: 225px;
  max-width: 100vw;
}
.details-section {
  margin-bottom: 1em;
  word-break: break-word;
}
.actors-list,
.similar-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  margin: 0;
  padding: 0;
  list-style: none;
}
.actor-card,
.similar-movie {
  background: var(--discord-dark-card);
  border-radius: 6px;
  padding: 0.5em 1em;
  font-size: 1em;
  color: var(--discord-dark-accent);
  margin-bottom: 0.3em;
  cursor: default;
}
body.light-mode .actor-card,
body.light-mode .similar-movie {
  background: var(--discord-light-card);
  color: var(--discord-light-accent);
}
.similar-list .similar-movie {
  cursor: pointer;
  min-width: 160px;
  text-align: center;
}
.trailer-frame {
  margin-top: 1em;
  border: none;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  height: 280px;
  box-shadow: 0 2px 12px rgba(88, 101, 242, 0.18);
  background: #23272a;
  display: block;
}
@media (max-width: 900px) {
  .main,
  .details-container {
    padding: 1rem;
  }
  .details-container {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    gap: 1.2rem;
  }
  .poster-large {
    width: 100%;
    max-width: 350px;
  }
}
