/* =============================================
   POPCORN PARDNER — style.css
   Color palette (logo-aligned):
     --amber:   #FFE790  (logo yellow)
     --red:     #FF7171  (logo red)
     --dark:    #180D0D  (near-black rosy-brown)
     --cream:   #FFF8E7  (parchment)
     --muted:   #A07070  (muted rose)
     --card-bg: #261212  (dark rose-wood)
============================================= */

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

:root {
  --amber: #FFE790;
  --amber-light: #FFF0A8;
  --red: #FF7171;
  --dark: #4A2828;
  --cream: #FFFEFD;
  --muted: #C09090;
  --card-bg: #3A1C1C;
  --border: #6A4040;
  --text-on-dark: #F5D5D5;

  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: 'Oswald', system-ui, sans-serif;
  --radius: 12px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .page-title,
[data-theme="light"] .section-title {
  color: #482A2A;
}

body {
  font-family: var(--font-body);
  background-color: var(--dark);
  color: var(--cream);
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition),
    border-color var(--transition), transform var(--transition);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--amber);
  color: var(--dark);
  border: 2px solid var(--amber);
}

.btn-primary:hover {
  background-color: var(--amber-light);
  border-color: var(--amber-light);
}

.btn-outline {
  background-color: transparent;
  color: var(--amber);
  border: 2px solid var(--amber);
}

.btn-outline:hover {
  background-color: var(--amber);
  color: var(--dark);
}

.btn-ghost {
  background-color: transparent;
  color: var(--cream);
  border: 2px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--muted);
  color: var(--cream);
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(74, 40, 40, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: #DDB8B8;
  letter-spacing: 0.01em;
}

.logo-img {
  height: 34px;
  width: auto;
  display: block;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav a {
  font-size: 0.9rem;
  color: var(--text-on-dark);
  transition: color var(--transition);
}

nav a:hover {
  color: #FFFEFD;
}

/* ===== HERO ===== */
.hero {
  padding-block: 5rem 4rem;
  background: #fffefd;
  border-bottom: 2px solid #C8A0A0;
}

.hero-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3.5rem;
}

.hero-logo {
  height: min(260px, 38vw);
  width: auto;
  flex-shrink: 0;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.hero-brand {
  font-family: 'Black Han Sans', system-ui, sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.75rem);
  font-weight: 400;
  line-height: 1;
  color: #482A2A;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 500;
  line-height: 1.3;
  color: #6B4040;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-sub {
  color: #6B4040;
  font-size: 1.1rem;
}

.hero .btn-primary {
  background-color: #482A2A;
  border-color: #482A2A;
  color: #FFF8E7;
}

.hero .btn-primary:hover {
  background-color: #664040;
  border-color: #664040;
}

.hero .btn-ghost {
  color: #482A2A;
  border-color: #C0A0A0;
}

.hero .btn-ghost:hover {
  border-color: #482A2A;
  color: #482A2A;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-logo {
    height: min(180px, 40vw);
    width: auto;
  }

  .hero-text {
    align-items: center;
  }
}


/* ===== SECTION SHARED ===== */
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #DDB8B8;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* ===== HOME SECTIONS ===== */
.home-section {
  padding-block: 4rem;
  background-color: var(--dark);
  border-top: 1px solid var(--border);
}

.home-section--alt {
  background-color: #3F2020;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.section-header .section-title {
  text-align: left;
  margin-bottom: 0;
}

.section-link {
  font-size: 0.85rem;
  color: var(--amber);
  transition: color var(--transition);
}

.section-link:hover {
  color: var(--amber-light);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 380px;
}

/* ===== FOOTER ===== */
.site-footer {
  background-color: var(--card-bg);
  border-top: 1px solid var(--border);
  padding-block: 1.5rem;
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ===== ACCESSIBILITY ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== NAV ACTIVE STATE ===== */
nav a.nav-active {
  color: var(--amber);
}

/* ===== SEARCH PAGE ===== */
.search-page {
  padding-block: 3rem 5rem;
  min-height: calc(100vh - 130px);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: #DDB8B8;
  margin-bottom: 1.5rem;
}

.search-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.search-input {
  flex: 1;
  padding: 0.65rem 1rem;
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--cream);
  font-size: 0.95rem;
  font-family: var(--font-body);
  transition: border-color var(--transition);
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--amber);
}

/* ===== RESULTS GRID ===== */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}

.movie-card {
  background-color: #FFFEFD;
  border: 1px solid #FFE790;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), transform var(--transition),
    box-shadow var(--transition);
}

.movie-card:hover {
  border-color: #664040;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(74, 40, 40, 0.15);
}

.movie-card .movie-title {
  color: #482A2A;
}

.movie-card .movie-overview {
  color: #7A5050;
}

.movie-card .review-date {
  color: #9A7070;
}

.movie-card .card-actions {
  border-top-color: #E8CECE;
}

.movie-card .watchlist-btn,
.movie-card .watching-btn {
  color: #9A7070;
}

.movie-card .watchlist-btn:hover,
.movie-card .watching-btn:hover,
.movie-card .watchlist-btn--active,
.movie-card .watching-btn--active {
  color: #482A2A;
}

.movie-poster {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background-color: #F0D8D0;
}

.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.movie-info {
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.movie-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.4rem;
}

.movie-overview {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-status {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  padding-block: 3rem;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 1.75rem;
  position: relative;
}

.modal::-webkit-scrollbar {
  display: none;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--cream);
}

.modal-movie {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.modal-poster {
  width: 130px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--dark);
}

.modal-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-movie-info {
  flex: 1;
  min-width: 0;
  max-width: 280px;
}

.modal-movie-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.modal-movie-overview {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal .modal-movie-overview {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
  margin-bottom: 0.65rem;
}

/* ===== MODAL FORM ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-on-dark);
  margin-bottom: 0.5rem;
}

.review-textarea {
  width: 100%;
  padding: 0.65rem 1rem;
  background-color: var(--dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--cream);
  font-size: 0.9rem;
  font-family: var(--font-body);
  line-height: 1.55;
  resize: vertical;
  transition: border-color var(--transition);
}

.review-textarea::placeholder {
  color: var(--muted);
}

.review-textarea:focus {
  outline: none;
  border-color: var(--amber);
}

/* ===== HAT RATING ===== */
.hat-rating {
  display: flex;
  gap: 0.25rem;
}

.hat-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.1rem;
  opacity: 0.25;
  line-height: 1;
  transition: opacity var(--transition), transform var(--transition);
}

.hat-btn img {
  height: 1.25rem;
  width: auto;
  display: block;
}


.hat-btn.hat-active {
  opacity: 1;
}

.hat-btn:hover {
  transform: scale(1.15);
}

/* ===== FORM ERROR ===== */
.form-error {
  font-size: 0.85rem;
  color: #e05a5a;
  margin-bottom: 1rem;
}

/* ===== MODAL ACTIONS ===== */
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-actions-right {
  display: flex;
  gap: 0.75rem;
}

/* ===== RATING DISPLAY (homepage cards) ===== */
.rating-display {
  display: flex;
  gap: 0.1rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.hat img {
  height: 0.7rem;
  width: auto;
  display: block;
}

.hat-empty {
  opacity: 0.2;
}

.review-date {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

/* ===== CARD ACTIONS ===== */
/* ===== CURRENTLY WATCHING CARD ===== */
.currently-watching-card {
  display: flex;
  gap: 1.25rem;
  background-color: var(--card-bg);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 1.25rem;
  max-width: 520px;
  box-shadow: 0 4px 20px rgba(255, 113, 113, 0.15);
}

.cw-poster {
  width: 90px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--dark);
}

.cw-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cw-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.cw-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.4rem;
}

.cw-overview {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.cw-actions {
  margin-top: auto;
  flex-direction: row;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
}

/* ===== CARD ACTIONS ===== */
.card-actions {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.watchlist-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}

.watchlist-btn:hover {
  color: var(--amber);
}

.watchlist-btn--active {
  color: var(--amber);
}

.watchlist-btn--remove:hover {
  color: #e05a5a;
}

.watching-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}

.watching-btn:hover {
  color: var(--amber);
}

.watching-btn--active {
  color: var(--amber);
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle-btn {
  background: none;
  border: none;
  color: var(--text-on-dark);
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition);
}

.theme-toggle-btn:hover {
  color: var(--amber);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ===== LIGHT MODE ===== */
:root[data-theme="light"] {
  --dark:         #FFFEFD;
  --card-bg:      #FFFEFD;
  --border:       #DDB8B8;
  --cream:        #1C0707;
  --muted:        #7A5050;
  --text-on-dark: #3D1515;
  --amber:        #664040;
  --amber-light:  #7A4A4A;
  --red:          #CC4040;
}

[data-theme="light"] .site-header {
  background-color: rgba(255, 254, 253, 0.92);
}

[data-theme="light"] .hero {
  background: #FFFEFD;
  border-bottom-color: #DDB8B8;
}

[data-theme="light"] .home-section--alt {
  background-color: #F5F0EE;
}

[data-theme="light"] .movie-card {
  border-color: #DDB8B8;
}

/* ===== REVIEW TRIGGER BUTTON ===== */
.modal-review-trigger {
  margin-top: 1.25rem;
  width: 100%;
}

/* ===== OMDB INFO ===== */
.omdb-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.omdb-pill {
  font-size: 0.72rem;
  color: var(--muted);
  background-color: var(--dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

/* ===== POSTER EDIT BUTTON ===== */
.poster-wrap {
  position: relative;
}

.poster-edit-btn {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.65);
  border: none;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 1;
}

.poster-wrap:hover .poster-edit-btn {
  opacity: 1;
}

/* ===== FANART PICKER MODAL ===== */
.fanart-modal {
  max-width: 680px;
}

.fanart-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.fanart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
}

.fanart-option {
  background: none;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  aspect-ratio: 2 / 3;
  transition: border-color var(--transition), transform var(--transition);
}

.fanart-option:hover {
  border-color: var(--amber);
  transform: scale(1.03);
}

.fanart-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== STREAMING MODAL ===== */
.streaming-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.streaming-inline-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-on-dark);
  margin-top: 0.75rem;
  margin-bottom: 0.4rem;
}

.streaming-loading {
  color: var(--muted);
  font-size: 0.95rem;
  padding-block: 0.5rem;
  text-align: center;
}

.streaming-message {
  color: var(--text-on-dark);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  text-align: center;
}

.streaming-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.source-pill {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background-color: var(--dark);
  border: 1px solid var(--amber);
  border-radius: 999px;
  color: var(--amber);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--transition), color var(--transition);
}

a.source-pill:hover {
  background-color: var(--amber);
  color: var(--dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  nav {
    gap: 0.85rem;
  }

  .search-form {
    flex-direction: column;
  }

  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}