@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 40px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== Theme Variables ===== */
html[data-theme="dark"] {
  --bg-color: #0e0e0e;
  --navbar-bg: #121212;
  --section-bg: #1a1a1a;
  --text-color: #f1f1f1;
  --muted-text: #bbbbbb;
  --accent: #00ffcc;
  --accent-hover: #00ddb3;
  --input-bg: #222;
  --input-border: #444;
  --result-border: #00ffd5;
  --spinner-color: #00ffd5;
  --footer-bg: #0d0d0d;
  --shadow: rgba(0, 255, 200, 0.2);
}

html[data-theme="light"] {
  --bg-color: #ffffff;
  --navbar-bg: #f5f5f5;
  --section-bg: #fafafa;
  --text-color: #222222;
  --muted-text: #555555;
  --accent: #00bfa6;
  --accent-hover: #009e8a;
  --input-bg: #fff;
  --input-border: #ccc;
  --result-border: #00bfa6;
  --spinner-color: #00bfa6;
  --footer-bg: #eeeeee;
  --shadow: rgba(0, 191, 166, 0.15);
}

/* ===== Apply Theme ===== */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* ===== Navbar ===== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--navbar-bg);
  padding: 20px 50px;
  border-bottom: 1px solid #2b2b2b;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar.scrolled {
  box-shadow: 0 2px 4px var(--shadow);
}

.navbar-logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--accent);
}

.navbar-links {
  list-style: none;
  display: flex;
  gap: 30px;
}

.navbar-links li a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-links li a:hover,
.navbar-links li a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.theme-toggle i {
  font-size: 20px;
  color: var(--accent);
  cursor: pointer;
  margin-left: 10px;
}

/* ===== Hero Section ===== */
.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
  background-color: var(--section-bg);
  border-bottom: 1px solid #2b2b2b;
}

.hero-text h1 {
  font-size: 40px;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-text p {
  font-size: 18px;
  color: var(--muted-text);
  max-width: 600px;
  margin-bottom: 40px;
}


/* ===== Search Section ===== */
.search-section {
  padding: 40px 50px;
  background-color: var(--navbar-bg);
  text-align: center;
}

.section-title {
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 20px;
}

.search-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.search-bar textarea {
  padding: 12px 20px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  font-size: 16px;
  background-color: var(--input-bg);
  color: var(--text-color);
  outline: none;
  resize: vertical;
}

.search-bar button {
  padding: 12px 25px;
  font-size: 16px;
  background-color: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.search-bar button:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

/* ===== Loading Spinner ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  gap: 10px;
  color: var(--accent);
  font-size: 16px;
}

.spinner {
  border: 4px solid #ccc;
  border-top: 4px solid var(--spinner-color);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== Result Section ===== */
.result-section {
  padding: 40px 50px;
  background-color: var(--section-bg);
}

.result-title {
  font-size: 24px;
  color: var(--accent);
  margin-bottom: 15px;
  font-weight: bold;
}

.result-container {
  background-color: var(--input-bg);
  padding: 20px;
  border-radius: 10px;
  color: var(--text-color);
  border-left: 4px solid var(--result-border);
  white-space: pre-line;
  box-shadow: 0 0 10px var(--shadow);
  font-size: 1rem;
  animation: fadeIn 0.6s ease-in-out forwards;
  opacity: 0;
}

/* ===== More Info Section ===== */
.more-info-section {
  padding: 20px 50px;
  text-align: center;
}

.extra-details {
  margin-top: 15px;
  background-color: var(--section-bg);
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid var(--accent);
  display: none;
}

/* ===== Info Section ===== */
.info-section {
  background-color: var(--navbar-bg);
  padding: 30px 50px;
  border-top: 1px solid #2b2b2b;
}

.info-box {
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted-text);
}

.info-box h4 {
  color: var(--accent);
  margin-bottom: 15px;
}

.info-box ul {
  list-style: none;
  padding: 0;
}

.info-box ul li {
  margin: 10px 0;
  font-size: 16px;
}

/* ===== Footer ===== */
.footer {
  background-color: var(--footer-bg);
  padding: 30px 50px;
  color: #777;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 20px;
}

.footer-left h4,
.footer-right h4 {
  color: var(--accent);
  margin-bottom: 10px;
}

.footer-bottom {
  text-align: center;
  font-size: 14px;
  color: #777;
}

/* ===== Back to Top Button ===== */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: none;
  background-color: var(--accent);
  color: black;
  border: none;
  padding: 12px 16px;
  font-size: 16px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 8px var(--shadow);
  z-index: 99;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 10px;
    padding: 20px;
  }

  .hero-text h1 {
    font-size: 32px;
  }

  .hero-text p {
    font-size: 16px;
  }

  .swiper-container {
    width: 100%;
  }

  .search-bar textarea {
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
  }
}

/* ===== Netflix-Style Slider Section (Updated) ===== */
.netflix-slider-section {
  overflow: hidden;
  width: 100%;
  background-color: var(--section-bg);
  padding: 20px 0;
}

.netflix-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.slider-track {
  display: flex;
  width: fit-content;
  animation: scroll 30s linear infinite;
}

.slider-track img {
  height: 200px;
  width: auto;
  margin-right: 16px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.slider-track img:hover {
  transform: scale(1.05);
  cursor: pointer;
  animation-play-state: paused;
}

/* Pause animation when user hovers */
.netflix-slider:hover .slider-track {
  animation-play-state: paused;
}

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

/* Responsive image height */
@media (max-width: 768px) {
  .slider-track img {
    height: 130px;
  }
}
