/* ===============================
   GammaFlex – Global Styles
   =============================== */

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #141414;
  color: white;
}

/* ===============================
   Header
   =============================== */

header {
  background-color: #000;
  color: #00ccff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
}

header span {
  font-size: 2.5rem;
  font-weight: 800;
  color: #00ccff;
}

.header-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
}

.header-buttons a {
  background-color: #00ccff;
  color: #000;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  font-weight: bold;
}

.header-buttons a:hover {
  background-color: #00aacc;
}

/* ===============================
   Tabs
   =============================== */

.tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.5rem;
  background-color: #1f1f1f;
}

.tabs button {
  background: none;
  border: none;
  color: #00ccff;
  font-size: 1rem;
  cursor: pointer;
}

.tabs button:hover {
  text-decoration: underline;
}

/* ===============================
   Slider
   =============================== */

.slider-wrapper {
  overflow: hidden;
  padding: 1rem;
  position: relative;
}

.slider-track {
  display: flex;
  gap: 1rem;
  min-width: 200%;
  animation: scroll-left 60s linear infinite;
}

@keyframes scroll-left {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.slider-item {
  flex: 0 0 auto;
  width: 240px;
  border-radius: 10px;
  overflow: hidden;
  background-color: #222;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.slider-item:hover {
  transform: scale(1.03);
}

.slider-item img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

/* ===============================
   Sections & Cards
   =============================== */

.section-title {
  font-size: 1.3rem;
  color: #00ccff;
  margin-left: 2rem;
  margin-top: 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem 2rem 2rem 2rem;
}

.movie {
  position: relative;
  background-color: #222;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
}

.movie:hover { transform: scale(1.03); }

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

.movie-title {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
}

.movie::after {
  content: "\25B6";
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 10px 14px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.movie:hover::after { opacity: 1; }

.live-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: red;
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ===============================
   Back to top
   =============================== */

#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #00ccff;
  color: black;
  border: none;
  padding: 10px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: none;
}

/* ===============================
   Poster size enforcement
   =============================== */

/* slider row (top carousel) */
#slideTrack .movie img {
  display: block;
  width: 270px;       /* consistent look */
  height: 405px;      /* 2:3 aspect */
  object-fit: cover;
  border-radius: 8px;
}

/* content sections (“Latest”, genres, Live TV) */
#sections .grid .movie img {
  display: block;
  width: 240px;       /* section card size */
  height: 360px;      /* keep 2:3 */
  object-fit: cover;
  border-radius: 8px;
}

/* ===============================
   Centered Search Bar (homepage block)
   =============================== */

/* outer container spans full width and centers its content */
.gfm-search {
  width: 100%;
  display: flex;
  justify-content: center;     /* centers the pill horizontally */
  padding: 14px 16px 10px;
  background: #0e0e0e;
  border-top: 1px solid #111;
  border-bottom: 1px solid #111;
}

/* pill body */
.gfm-search-box {
  width: 100%;
  max-width: 760px;            /* controls visual width */
  display: grid;
  grid-template-columns: 36px 1fr auto;  /* icon | input | button */
  align-items: center;
  gap: 8px;
  background: #121416;
  border: 1px solid #1f2a30;
  border-radius: 9999px;
  padding: 6px 6px 6px 6px;    /* even padding around */
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

/* icon cell */
.gfm-search-icon {
  text-align: center;
  font-size: 18px;
  opacity: .9;
  color: #a8d9ea;
}

/* input */
.gfm-search-box input {
  width: 100%;
  background: transparent;
  color: #eaf8ff;
  border: 0;
  border-radius: 9999px;
  padding: 12px 12px;
  font-size: 16px;
  outline: none;
}
.gfm-search-box input::placeholder { color: #88b6c7; }
.gfm-search-box input:focus {
  box-shadow: 0 0 0 2px rgba(0,204,255,.15);
}

/* button */
.gfm-search-btn {
  background: linear-gradient(180deg, #00cfff, #00b2e3);
  color: #041116;
  border: 0;
  border-radius: 9999px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.gfm-search-btn:hover { filter: brightness(.95); }

/* suggestions dropdown aligned to the pill */
.gfm-suggest {
  width: 100%;
  max-width: 760px;
  margin: 10px auto 0;
  background: #141414;
  border: 1px solid #242424;
  border-radius: 12px;
  overflow: hidden;
  display: none;               /* toggled by JS */
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}

.gfm-suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #1e1e1e;
}
.gfm-suggest-item:last-child { border-bottom: 0; }
.gfm-suggest-item:hover { background: #1b1b1b; }

.gfm-suggest-thumb {
  width: 42px;
  height: 62px;
  object-fit: cover;
  border-radius: 6px;
  background: #222;
}
.gfm-suggest-meta { display:flex; flex-direction: column; }
.gfm-suggest-title { color:#eaf8ff; font-weight:700; font-size: 14px; line-height: 1.1; }
.gfm-suggest-sub   { color:#9ac7d6; font-size: 12px; }

/* ===============================
   Responsive
   =============================== */

@media (max-width: 768px) {
  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 1rem;
  }

  header span { font-size: 1.8rem; }

  .header-buttons { gap: 0.5rem; flex-wrap: nowrap; }
  .header-buttons a { padding: 6px 12px; font-size: 0.9rem; }

  .tabs { flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

  .slider-item { width: 160px; }
  .slider-item img { height: auto; aspect-ratio: 2/3; }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    padding: 1rem;
  }

  .movie img { aspect-ratio: 2/3; height: auto; }
  .movie-title { font-size: 0.75rem; }

  .slider-track { animation-duration: 10s !important; }

  /* search pill tighter on mobile */
  .gfm-search { padding: 10px 10px 8px; }
  .gfm-search-box { max-width: 92vw; grid-template-columns: 28px 1fr auto; }
  .gfm-search-btn { padding: 10px 12px; font-size: 14px; }
}
