/* ============================================================================
   MOVIES PAGE STYLES  (loaded only by movies.html)
   Palette pulled from templatemo-style.css:
     yellow #E3AE57 · orange #ea833a / #E9724C · turquoise #50866f · dark #161616
   ============================================================================ */

html { background: #f4f4f4; }
.movies-page {
  font-family: "Source Sans Pro", sans-serif;
  background: #f4f4f4;
  color: #161616;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ---- Hero / header -------------------------------------------------------- */

.movies-hero {
  background: #161616;
  color: #fff;
  padding: 140px 0 60px;
  text-align: center;
}
.movies-hero h1 {
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0 0 10px;
}
.movies-hero h1 .fa { color: #E3AE57; margin-right: 10px; }
.movies-hero p {
  color: #cfcfcf;
  max-width: 640px;
  margin: 0 auto;
  font-size: 17px;
}

/* ---- Add box -------------------------------------------------------------- */

.movie-add-box {
  position: relative;
  max-width: 720px;
  margin: 30px auto 0;
  text-align: left;
}
.movie-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.movie-add-row .field-grow { flex: 1 1 280px; position: relative; }
.movie-add-box input[type="text"] {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  color: #161616;
  background: #fff;
}
#movie-author { flex: 0 1 180px; }
#add-movie-btn {
  height: 48px;
  padding: 0 28px;
  border: none;
  border-radius: 4px;
  background: #E3AE57;
  color: #161616;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
  white-space: nowrap;
}
#add-movie-btn:hover:not(:disabled) { background: #ea833a; color: #fff; }
#add-movie-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#add-feedback {
  display: none;
  margin-top: 12px;
  color: #E3AE57;
  font-weight: 600;
  text-align: center;
}

/* ---- Search suggestions dropdown ----------------------------------------- */

#movie-suggestions {
  list-style: none;
  margin: 6px 0 0;
  padding: 6px;
  position: absolute;
  z-index: 50;
  left: 0; right: 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  max-height: 360px;
  overflow-y: auto;
}
.ms-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  color: #161616;
}
.ms-item:hover { background: #f0e6d2; }
.ms-item img { width: 36px; height: 54px; object-fit: cover; border-radius: 3px; flex: 0 0 auto; }
.ms-title { flex: 1 1 auto; font-weight: 600; }
.ms-title em { color: #888; font-weight: 400; font-style: normal; }
.ms-genre {
  flex: 0 0 auto;
  font-size: 12px;
  color: #ea833a;
  background: #fff3e6;
  padding: 3px 10px;
  border-radius: 20px;
}
.ms-empty { padding: 12px; color: #888; }
.ms-type {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #50866f;
  background: #e7f0eb;
  padding: 3px 8px;
  border-radius: 4px;
}

/* ---- Status banner -------------------------------------------------------- */

#movies-status {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 14px 18px;
  background: #50866f;
  color: #fff;
  border-radius: 6px;
  text-align: center;
}
#movies-status code { background: rgba(0,0,0,0.25); padding: 1px 6px; border-radius: 3px; color: #fff; }

/* ---- The wall ------------------------------------------------------------- */

.movies-wall-wrap { padding: 50px 0 80px; }
.wall-empty { text-align: center; color: #888; font-size: 18px; padding: 40px 0; }

.movie-cat { margin-bottom: 46px; }
.cat-title {
  font-weight: 700;
  border-bottom: 3px solid #E3AE57;
  padding-bottom: 10px;
  margin: 0 0 22px;
}
.cat-count {
  font-size: 14px;
  color: #fff;
  background: #ea833a;
  border-radius: 20px;
  padding: 2px 11px;
  vertical-align: middle;
  margin-left: 6px;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px;
}
.movie-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  transition: transform 0.25s, box-shadow 0.25s;
}
a.movie-card,
a.movie-card:hover,
a.movie-card:focus { text-decoration: none; cursor: pointer; }
/* Only apply the hover-lift on real pointer (mouse) devices — on touch it
   causes a "tap just hovers" dead first-tap. */
@media (hover: hover) {
  .movie-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 26px rgba(0,0,0,0.22);
  }
}
.movie-card:active { transform: scale(0.98); }
.movie-card .mc-info h4 { color: #161616; }
.movie-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: #161616;
}
.mc-info { padding: 12px 12px 14px; }
.mc-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.25;
}
.mc-meta { font-size: 13px; color: #888; }

/* ---- Filter / sort controls ---------------------------------------------- */

.movies-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}
#wall-filter {
  flex: 1 1 240px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 15px;
  background: #fff;
}
.controls-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.controls-right label { margin: 0; font-size: 13px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
#wall-sort,
#person-filter {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 15px;
  cursor: pointer;
  max-width: 180px;
}
.genre-chips {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.genre-chip {
  border: 1px solid #e0c89a;
  background: #fff;
  color: #b07b2e;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}
.genre-chip:hover { background: #fff3e6; }
.genre-chip.active { background: #E3AE57; border-color: #E3AE57; color: #161616; font-weight: 700; }

/* media type segmented toggle */
.media-toggle { display: inline-flex; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; }
.media-btn {
  border: none;
  background: #fff;
  color: #888;
  padding: 0 14px;
  height: 44px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}
.media-btn + .media-btn { border-left: 1px solid #eee; }
.media-btn:hover { background: #faf3e6; }
.media-btn.active { background: #50866f; color: #fff; font-weight: 700; }

/* ---- Card extras (rating badge, vote button) ----------------------------- */

.movie-card { cursor: pointer; }
.mc-poster { position: relative; }
.mc-rating {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(22,22,22,0.82);
  color: #E3AE57;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 14px;
}
.mc-rating .fa { font-size: 11px; }
.mc-type {
  position: absolute;
  top: 8px; right: 8px;
  background: #50866f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}

.mc-info { display: flex; flex-direction: column; }
.mc-vote {
  align-self: flex-start;
  margin-top: 8px;
  border: 1px solid #eee;
  background: #fafafa;
  color: #888;
  border-radius: 18px;
  padding: 3px 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.mc-vote:hover { border-color: #E9724C; color: #E9724C; }
.mc-vote.voted { background: #E9724C; border-color: #E9724C; color: #fff; }
.mc-vote .fa { margin-right: 3px; }

/* ---- Detail modal --------------------------------------------------------- */

body.modal-open-movies { overflow: hidden; }
#movie-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mm-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.mm-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.mm-close {
  position: absolute;
  top: 10px; right: 14px;
  z-index: 2;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.mm-backdrop {
  height: 240px;
  background-size: cover;
  background-position: center;
  border-radius: 10px 10px 0 0;
}
.mm-content { padding: 22px 26px 26px; }
.mm-content h3 { margin: 0 0 6px; font-weight: 700; display: inline-block; }
.mm-rating {
  margin-left: 10px;
  color: #E9724C;
  font-weight: 700;
  font-size: 16px;
}
.mm-meta { color: #888; margin: 4px 0 14px; }
.mm-overview { line-height: 1.6; color: #333; }
.mm-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.mm-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  border: 1px solid #ddd;
  color: #161616 !important;
  font-weight: 600;
}
.mm-btn-primary { background: #E9724C; border-color: #E9724C; color: #fff !important; }
.mm-loading { padding: 50px; text-align: center; color: #888; }

/* ---- Responsive ----------------------------------------------------------- */

@media (max-width: 600px) {
  .movies-hero { padding: 120px 0 40px; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
  #movie-author { flex: 1 1 100%; }
  .mm-backdrop { height: 170px; }
  /* let the filter/sort controls wrap instead of overflowing the screen */
  .controls-right { width: 100%; }
  #person-filter, #wall-sort { flex: 1 1 auto; max-width: none; }
  .media-toggle { flex: 1 1 100%; }
  .media-btn { flex: 1 1 0; }
}
