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

html, body {
  height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
  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);
}

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

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

.theme-toggle i {
  cursor: pointer;
  font-size: 18px;
  margin-left: 10px;
  color: var(--text-color);
  transition: color 0.3s;
}

.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;
  padding-bottom: 4px;
}

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

/* ===== Hero Section ===== */
.hero-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
  background-color: var(--section-bg);
  border-bottom: 1px solid var(--input-border);
  text-align: center;
  min-height: 60vh;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
  width: 100%;
  gap: 20px;
}

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

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

.hero-image img {
  width: 300px;
  border-radius: 12px;
  animation: float 3s ease-in-out infinite;
  max-width: 100%;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* ===== 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;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-bar input {
  padding: 12px 20px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  width: 300px;
  font-size: 16px;
  background-color: var(--input-bg);
  color: var(--text-color);
  outline: none;
}

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

.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: 5px solid #ccc;
  border-top: 5px solid var(--spinner-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  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;
}

.structured-result {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.result-card {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 0 10px var(--shadow);
  animation: fadeIn 0.5s ease-in-out forwards;
  opacity: 0;
}

.result-card h4 {
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.error-box {
  color: #ff4c4c;
  font-weight: 500;
  padding: 15px;
  background-color: #2a1a1a;
  border-left: 4px solid red;
  border-radius: 6px;
  animation: fadeIn 0.5s ease-in-out forwards;
  opacity: 0;
}

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

.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: var(--muted-text);
}

.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: var(--muted-text);
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
  }

  .hero-image img {
    margin-top: 20px;
    width: 80%;
  }

  .navbar {
    flex-direction: column;
    gap: 10px;
    padding: 20px;
  }

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

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

  .swiper-slide img {
    max-height: 300px;
  }
}

/* ===== 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;
  }
}