/* ===================================================== */
/* 1️⃣ RESET & GLOBAL BASE */
/* ===================================================== */

/* RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, sans-serif;
}

/* FULL BACKGROUND FIX (mobile safe) */
:root,
html,
body {
  background: radial-gradient(circle at top, #1b0f14, #050505);
}

html {
  height: 100%;
}

body {
  min-height: 100svh;
  color: #ffffff;
  padding: 22px;
  padding-bottom: 100px; /* space for fixed footer */
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
}

/* ===================================================== */
/* 2️⃣ HEADER / TOP SECTION */
/* ===================================================== */

.header {
  text-align: center;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ff4b4b;
  white-space: nowrap; /* ✅ ONLY CHANGE: FORCE ONE LINE */
}

.header p {
  margin-top: 6px;
  font-size: 14px;
  color: #b5b5b5;
}

/* ===================================================== */
/* 3️⃣ SEARCH BAR */
/* ===================================================== */

.search-box {
  background: rgba(255,255,255,0.04);
  padding: 14px;
  border-radius: 18px;
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 22px;
}

.search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 14px 16px;
  font-size: 16px;
  color: #fff;
  outline: none;
}

.search-box input::placeholder {
  color: #777;
}

.search-box button {
  padding: 14px 26px;
  background: #e50914;
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ===================================================== */
/* 4️⃣ RESULTS CONTAINER */
/* ===================================================== */

.results {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ===================================================== */
/* 5️⃣ RESULT CARD COMPONENT */
/* ===================================================== */

.result-card {
  display: flex;
  gap: 14px;
  background: rgba(0,0,0,0.55);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  cursor: pointer;
}

.result-card:hover {
  background: rgba(0,0,0,0.65);
}

/* CARD CONTENT */
.card-content {
  flex: 1;
}

.title {
  font-size: 15.5px;
  line-height: 1.45;
  font-weight: 500;
  word-break: break-word;
}

/* META INFO */
.meta {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.size {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,75,75,0.5);
  color: #ff5c5c;
  font-size: 13px;
  font-weight: 500;
}

.lang {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 12px;
  color: #ccc;
}

.date {
  margin-top: 6px;
  font-size: 12px;
  color: #aaa;
}

.arrow {
  font-size: 22px;
  color: #777;
  margin-top: 6px;
}

/* ===================================================== */
/* 6️⃣ ADMIN PANEL STYLES */
/* ===================================================== */

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-actions button {
  background: #1a1a1a;
  border: none;
  color: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.admin-actions button:hover {
  background: #333;
}

/* LANGUAGE TAG SELECT (ADMIN) */
.lang-select {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 14px 10px;
}

.lang-select input {
  display: none;
}

.lang-select span {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 12px;
  color: #ccc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-select span:hover {
  border-color: #ff5c5c;
}

.lang-select input:checked + span {
  background: rgba(255,75,75,0.15);
  border-color: #ff5c5c;
  color: #ff5c5c;
}

#adminPanel .meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

#adminPanel #languageBox {
  padding-left: 16px;
  padding-right: 16px;
}

/* ===================================================== */
/* 7️⃣ UX RESTRICTIONS */
/* ===================================================== */

.header,
.results,
.result-card {
  user-select: none;
}

input,
textarea {
  user-select: text;
}

/* ===================================================== */
/* 8️⃣ BACK TO TOP BUTTON */
/* ===================================================== */

#backToTop {
  position: fixed;
  bottom: 90px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e50914;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  z-index: 9999;
}

/* ===================================================== */
/* 9️⃣ FIXED FOOTER */
/* ===================================================== */

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px 12px 12px;
  background: rgba(5,5,5,0.95);
  backdrop-filter: blur(6px);
  z-index: 999;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.footer-links a {
  font-size: 13px;
  color: #9a9a9a;
  text-decoration: none;
}

.footer-links a:hover {
  color: #ff5c5c;
}

.footer-copy {
  font-size: 12px;
  color: #666;
}

/* BACK TO HOME BUTTON */
.back-home {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: #ff5c5c;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.15);
}

.back-home:hover {
  background: rgba(255,75,75,0.15);
  border-color: #ff5c5c;
}

/* DISABLE COPY IN FOOTER */
.footer,
.footer * {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

/* ===================================================== */
/* 🔟 TELEGRAM POPUP (MODAL) */
/* ===================================================== */

.tg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.tg-popup {
  background: rgba(0,0,0,0.85);
  border-radius: 18px;
  padding: 22px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.tg-popup h3 {
  color: #ff5c5c;
  font-size: 18px;
  margin-bottom: 8px;
}

.tg-popup p {
  font-size: 13px;
  color: #bbb;
  margin-bottom: 18px;
}

.tg-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* SAME BUTTON SIZE */
.tg-join,
.tg-already {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-sizing: border-box;
}

.tg-join {
  background: #e50914;
  color: #fff;
  text-decoration: none;
}

.tg-already {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: #ccc;
  cursor: pointer;
}

.tg-already:hover {
  border-color: #ff5c5c;
  color: #ff5c5c;
}
/* =====================================================
   🖼️ POSTER FIT INSIDE CARD (TOP POSITION)
   (ADD ONLY – NO EXISTING CODE CHANGED)
===================================================== */

.result-card .poster {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
  background: #111;
}
/* === FIX POSTER OVERFLOW INSIDE CARD === */

.result-card {
  overflow: hidden;
}

.result-card .poster {
  display: block;
}
/* =====================================================
   🖼️ POSTER – 16:9 RATIO (INSIDE CARD)
===================================================== */

.result-card {
  overflow: hidden; /* clip poster to rounded card */
}

.result-card .poster {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;   /* ✅ 16:9 ratio */
  height: auto;
  object-fit: cover;
  border-radius: 0;       /* card handles rounding */
  margin-bottom: 10px;
  background: #111;
}
/* =====================================================
   🧱 STACK POSTER ABOVE TEXT (HOME PAGE CARD)
===================================================== */

.result-card {
  flex-direction: column; /* poster on top, text below */
}