/* ═══════════════════════════════════════════════
   FMW Directory Front-End Styles
   ═══════════════════════════════════════════════ */

/* ── Grid layout ───────────────────────────────── */
.fmw-grid {
  display: grid;
  gap: 20px;
  margin: 24px 0;
}
.fmw-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.fmw-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.fmw-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.fmw-grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.fmw-grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 900px) {
  .fmw-grid-cols-4,
  .fmw-grid-cols-5,
  .fmw-grid-cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .fmw-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .fmw-grid { grid-template-columns: 1fr; }
}

/* ── Card ──────────────────────────────────────── */
.fmw-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.fmw-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

.fmw-card-poster {
  position: relative;
  aspect-ratio: 2/3;
  background: #1a1a2e;
  overflow: hidden;
}
.fmw-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fmw-card-no-poster {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: #16213e;
  color: #0f3460;
}
.fmw-card-rating {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,.7);
  color: #ffd700;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.fmw-card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.fmw-card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.3;
}
.fmw-card-title a { text-decoration: none; color: inherit; }
.fmw-card-title a:hover { color: #e50914; }

.fmw-card-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}
.fmw-card-meta span::after { content: '·'; margin-left: 8px; }
.fmw-card-meta span:last-child::after { content: ''; }

.fmw-card-genres {
  font-size: 11px;
  color: #888;
  margin: 0 0 10px;
}
.fmw-card-actions { margin-top: auto; }

/* ── Single title ──────────────────────────────── */
.fmw-single {
  position: relative;
  margin: 0 0 40px;
}
.fmw-single-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 400px;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: 0;
}
.fmw-single-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.4) 0%, rgba(0,0,0,.85) 100%);
}
.fmw-single-inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 32px;
  padding: 40px 0 0;
  align-items: flex-start;
  flex-wrap: wrap;
}
.fmw-single-poster {
  flex-shrink: 0;
  width: 220px;
}
.fmw-single-poster img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.fmw-single-info {
  flex: 1;
  color: #fff;
  min-width: 280px;
  padding-top: 20px;
}
.fmw-single-title {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 6px;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.fmw-orig-title {
  color: rgba(255,255,255,.7);
  font-size: 14px;
  margin: 0 0 16px;
  font-style: italic;
}
.fmw-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.fmw-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
}
.fmw-badge-year   { background: rgba(255,255,255,.2); color: #fff; }
.fmw-badge-type   { background: #e50914;              color: #fff; }
.fmw-badge-rating { background: rgba(255,215,0,.2);   color: #ffd700; border: 1px solid #ffd700; }

.fmw-genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.fmw-genre-tag {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.fmw-description {
  color: rgba(255,255,255,.85);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 640px;
}

.fmw-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.fmw-imdb-id {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  margin: 0;
}

/* ── Buttons ───────────────────────────────────── */
.fmw-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s, transform .1s;
  letter-spacing: .3px;
}
.fmw-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.fmw-btn:active { transform: translateY(0); }

.fmw-btn-primary {
  background: #e50914;
  color: #fff;
  border: none;
}
.fmw-btn-secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(4px);
}
.fmw-btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  background: #e50914;
  color: #fff;
  border: none;
  border-radius: 4px;
}

/* ── Empty state ───────────────────────────────── */
.fmw-empty {
  text-align: center;
  color: #888;
  padding: 40px;
  font-style: italic;
}

/* ── Responsive single ─────────────────────────── */
@media (max-width: 700px) {
  .fmw-single-backdrop { height: 260px; }
  .fmw-single-inner    { padding-top: 200px; }
  .fmw-single-poster   { width: 140px; }
  .fmw-single-title    { font-size: 24px; }
}


/* ═══════════════════════════════════════════════
   ADS
   ═══════════════════════════════════════════════ */

.fmw-ad-wrap {
  margin: 20px auto;
  text-align: center;
  clear: both;
}
.fmw-ad-label {
  display: block;
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 4px;
}
.fmw-ad-no-label .fmw-ad-label { display: none; }

/* Google policy: clear separation from content */
.fmw-ad-before_play_btn  { margin: 16px 0; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.1); }
.fmw-ad-below_title_info { margin: 16px 0; }
.fmw-ad-header_banner    { margin: 0 0 16px; }
.fmw-ad-footer_banner    { margin: 16px 0 0; }
.fmw-ad-home_top         { margin-bottom: 20px; }
.fmw-ad-home_mid         { margin: 24px 0; }

/* Grid inline ad slot — same size as a card */
.fmw-grid-ad-slot {
  background: #f9f9f9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
}


/* ═══════════════════════════════════════════════
   HOME PAGE
   ═══════════════════════════════════════════════ */

.fmw-home-wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.fmw-home-hero {
  text-align: center;
  padding: 40px 16px 24px;
}
.fmw-home-title {
  font-size: clamp(24px, 5vw, 42px);
  font-weight: 900;
  margin: 0 0 10px;
  background: linear-gradient(135deg, #e50914, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.fmw-home-sub {
  font-size: 16px;
  color: #666;
  margin: 0;
}


/* ═══════════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════════ */

.fmw-search-wrap {
  position: relative;
  margin-bottom: 20px;
}
.fmw-search-form { display: flex; flex-direction: column; gap: 10px; }

.fmw-search-input-wrap {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
}
.fmw-search-input {
  flex: 1;
  padding: 14px 18px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-right: none;
  border-radius: 8px 0 0 8px;
  outline: none;
  transition: border-color .2s;
}
.fmw-search-input:focus { border-color: #e50914; }
.fmw-search-btn {
  padding: 14px 24px;
  background: #e50914;
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  white-space: nowrap;
  transition: background .15s;
}
.fmw-search-btn:hover { background: #c0000f; }

.fmw-filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.fmw-filter-select {
  padding: 9px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  transition: border-color .2s;
  min-width: 140px;
}
.fmw-filter-select:focus { border-color: #e50914; outline: none; }
.fmw-clear-filters {
  padding: 9px 14px;
  background: #f3f3f3;
  border: 2px solid #ddd;
  border-radius: 6px;
  color: #666;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s;
}
.fmw-clear-filters:hover { background: #e9e9e9; color: #333; }


/* ═══════════════════════════════════════════════
   LIVE SEARCH SUGGESTIONS
   ═══════════════════════════════════════════════ */

.fmw-suggestions {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 9999;
  max-height: 400px;
  overflow-y: auto;
}
.fmw-sug-list { list-style: none; margin: 0; padding: 4px 0; }
.fmw-sug-item { border-bottom: 1px solid #f5f5f5; }
.fmw-sug-item:last-child { border-bottom: none; }
.fmw-sug-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.fmw-sug-link:hover { background: #f9f9f9; }
.fmw-sug-poster {
  width: 40px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  background: #1a1a2e;
}
.fmw-sug-poster img { width: 100%; height: 100%; object-fit: cover; }
.fmw-sug-no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.fmw-sug-info { display: flex; flex-direction: column; gap: 3px; }
.fmw-sug-title { font-size: 14px; font-weight: 600; color: #1d2327; }
.fmw-sug-meta  { font-size: 12px; color: #888; }


/* ═══════════════════════════════════════════════
   FILTER PILLS & RESULTS META
   ═══════════════════════════════════════════════ */

.fmw-filter-pills {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.fmw-pill {
  background: #e50914;
  color: #fff;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fmw-pill-remove { color: rgba(255,255,255,.8); text-decoration: none; font-size: 13px; }
.fmw-pill-remove:hover { color: #fff; }

.fmw-results-meta {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}

.fmw-empty {
  text-align: center;
  padding: 60px 20px;
}
.fmw-empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }


/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */

.fmw-pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 32px 0;
}
.fmw-page-btn {
  display: inline-block;
  padding: 8px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
}
.fmw-page-btn:hover    { border-color: #e50914; color: #e50914; }
.fmw-page-active       { background: #e50914; border-color: #e50914; color: #fff !important; }
.fmw-page-dots         { color: #999; padding: 0 4px; font-size: 14px; }
.fmw-page-info         { font-size: 12px; color: #999; margin-left: 8px; }

@media (max-width: 600px) {
  .fmw-filter-row { flex-direction: column; }
  .fmw-filter-select { min-width: 100%; }
}
