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

:root {
  --background-color: #F3F3F3;
  --primary-blue: #0288D1;
  --dark-blue: #01579B;
  --light-blue: #B3E5FC;
  --text-dark: #263238;
  --text-light: #FFFFFF;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow: rgba(0, 0, 0, 0.1);
  --card-bg: #FFFFFF;
  --nav-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
  --background-color: #121212;
  --primary-blue: #4FC3F7;
  --dark-blue: #0288D1;
  --light-blue: #01579B;
  --text-dark: #FFFFFF;
  --text-light: #FFFFFF;
  --glass-bg: rgba(0, 0, 0, 0.2);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.3);
  --card-bg: #1E1E1E;
  --nav-bg: rgba(18, 18, 18, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

html {
  font-size: 16px;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 12px;
  }
}

body {
  background-color: var(--background-color);
  color: var(--text-dark);
  min-height: 100vh;
}

.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 12px var(--shadow);
  border-radius: 12px;
}

nav {
  height: clamp(50px, 8vh, 60px);
  padding: 0 clamp(1rem, 5vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-left {
  display: flex;
  align-items: center;
}

.logo {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--primary-blue);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: clamp(0.8rem, 2vw, 1.5rem);
  margin-left: auto;
}

.nav-links a {
  padding: clamp(0.4rem, 1.5vw, 0.6rem);
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
}

.nav-links a:nth-child(3) {
  margin-right: 4px;
}

.nav-links .material-icons-round {
  font-size: clamp(18px, 3vw, 20px);
}

.nav-links a:hover {
  background: var(--glass-bg);
}

.nav-links a.active {
  background: none;
  color: inherit;
}

.nav-right {
  display: none;
}

.theme-toggle {
  display: none;
}

.banner-section {
  margin-top: clamp(50px, 8vh, 60px);
  padding: 0 clamp(1rem, 5vw, 2rem);
  display: block;
}

.banner {
  position: relative;
  height: clamp(300px, 50vh, 400px);
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 12px;
  overflow: hidden;
  background-size: cover !important;
  background-position: center !important;
  transition: background 0.3s ease;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8),
    rgba(0, 0, 0, 0.1)
  );
  pointer-events: none;
}

.banner-content {
  position: relative;
  z-index: 1;
  color: var(--text-light);
}

.banner-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.banner-subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1.125rem);
  opacity: 0.9;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.play-button {
  width: clamp(40px, 6vw, 48px);
  height: clamp(40px, 6vw, 48px);
  border-radius: 50%;
  background: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

.play-button .material-icons-round {
  font-size: clamp(20px, 3vw, 24px);
  color: var(--primary-blue);
}

.play-button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  opacity: 1;
}

.category-section {
  padding: clamp(0.5rem, 2vw, 1rem);
}

.category-buttons {
  display: flex;
  gap: clamp(0.4rem, 1.5vw, 0.8rem);
  margin-bottom: 1rem;
  overflow-x: auto;
  padding: 0.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-buttons::-webkit-scrollbar {
  display: none; 
}

.category-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: clamp(0.4rem, 2vw, 0.6rem) clamp(0.8rem, 3vw, 1.2rem);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: clamp(80px, 15vw, 90px);
  position: relative;
  overflow: hidden;
  font-size: 0.9rem;
}

.category-button i {
  font-size: clamp(0.8rem, 2vw, 1rem);
  transition: transform 0.3s ease;
}

.category-button span {
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  font-weight: 500;
  white-space: nowrap;
}

.category-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.9);
}

.category-button.active {
  background: var(--light-blue);
  color: var(--primary-blue);
  box-shadow: 0 4px 15px rgba(2, 136, 209, 0.2);
  border: 1px solid rgba(2, 136, 209, 0.3);
}

.category-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  height: 3px;
  background: var(--primary-blue);
  border-radius: 3px;
}

.category-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.2)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-button:hover::before {
  opacity: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.1rem, 3vw, 1.25rem);
  font-weight: 700;
}

.section-actions {
  display: flex;
  gap: 0.5rem;
}

.action-button {
  width: clamp(30px, 5vw, 35px);
  height: clamp(30px, 5vw, 35px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.movie-slider {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scroll-behavior: smooth;
}

.movie-card {
  flex: 0 0 clamp(120px, 25vw, 150px);
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 8px 16px var(--shadow);
  transition: transform 0.3s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
}

.movie-card img {
  width: 100%;
  height: clamp(180px, 35vh, 225px);
  object-fit: cover;
  border-radius: 12px;
}

.movie-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  border-radius: 0 0 12px 12px;
}

.movie-title {
  font-size: clamp(0.7rem, 1.8vw, 0.75rem);
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-meta {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.65rem, 1.6vw, 0.7rem);
  color: rgba(255, 255, 255, 0.8);
}

.movie-section {
  margin-bottom: 1rem;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  margin: clamp(2%, 5vh, 5%) auto;
  width: clamp(300px, 90%, 900px);
  background: var(--card-bg);
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
}

.close {
  position: absolute;
  right: clamp(0.8rem, 2vw, 1rem);
  top: clamp(0.8rem, 2vw, 1rem);
  color: var(--text-dark);
  cursor: pointer;
  z-index: 10;
  background: var(--glass-bg);
  width: clamp(30px, 5vw, 35px);
  height: clamp(30px, 5vw, 35px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.modal-info {
  display: grid;
  grid-template-columns: minmax(200px, 300px) 1fr;
  gap: clamp(1.5rem, 4vw, 2rem);
}

@media (max-width: 600px) {
  .modal-info {
    grid-template-columns: 1fr;
  }
  
  .modal-info img {
    max-width: 200px;
    margin: 0 auto;
  }
}

.modal-info img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  aspect-ratio: 2/3;
  object-fit: cover;
}

.modal-details {
  display: flex;
  flex-direction: column;
  gap: clamp(0.8rem, 2vw, 1rem);
}

.modal-details h2 {
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.5rem, 1.5vw, 0.8rem);
  color: var(--text-dark);
  opacity: 0.8;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.modal-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-overview {
  font-size: clamp(0.9rem, 2vw, 1rem);
  line-height: 1.6;
  color: var(--text-dark);
  opacity: 0.9;
  margin: clamp(0.5rem, 2vw, 1rem) 0;
}

.play-btn {
  padding: clamp(0.8rem, 2vw, 1rem) clamp(1.5rem, 3vw, 2rem);
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: clamp(0.9rem, 2.2vw, 1rem);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(2, 136, 209, 0.3);
  width: fit-content;
  margin-top: auto;
}

.play-btn:hover {
  background: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 136, 209, 0.4);
}

.search-input {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  padding: clamp(6px, 1.5vw, 8px) clamp(12px, 2.5vw, 16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  width: clamp(150px, 30vw, 200px);
  transition: all 0.3s ease;
  outline: none;
}

.search-input.hidden {
  width: 0;
  padding: 8px 0;
  border: none;
  opacity: 0;
}

.search-icon {
  display: none;
}

.search-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background-color);
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}

.search-page.active {
  display: block;
  opacity: 1;
}

.search-header {
  position: sticky;
  top: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  z-index: 2001;
  box-shadow: 0 2px 10px var(--shadow);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

#searchInput {
  flex: 1;
  padding: clamp(0.8rem, 2vw, 1rem);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-dark);
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  outline: none;
}

.close-search {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.search-results {
  padding: clamp(1rem, 3vw, 1.5rem);
  padding-bottom: 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 25vw, 180px), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 100px);
}

.search-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 8px 16px var(--shadow);
  transition: transform 0.3s ease;
  cursor: pointer;
  height: 100%;
}

.search-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}

.search-card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: clamp(0.5rem, 1.5vw, 0.8rem);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
}

.search-card-title {
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.7rem, 1.8vw, 0.8rem);
  color: rgba(255, 255, 255, 0.8);
}

.movies-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background-color);
  z-index: 2000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding-bottom: 2rem;
}

.movies-page.active {
  display: block;
  opacity: 1;
}

.movies-header {
  position: sticky;
  top: 0;
  padding: clamp(1rem, 3vw, 1.5rem);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  z-index: 2001;
  box-shadow: 0 2px 10px var(--shadow);
}

.movies-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.movies-nav h2 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--text-dark);
}

.close-movies {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.movies-grid {
  padding: clamp(1rem, 3vw, 1.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 25vw, 180px), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  max-width: 1200px;
  margin: 0 auto;
}

.movies-grid .movie-card {
  flex: none;
  width: 100%;
}

#genrePage.movies-page {
  z-index: 2000;
}

.close-genre {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.category-button {
  cursor: pointer;
}

.movies-page .movies-grid {
  padding-bottom: 4rem;
}

.loading, .error, .no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text-dark);
  font-size: 1.2rem;
}

.error {
  color: #ff5252;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  z-index: 2002;
  box-shadow: 0 -2px 10px var(--shadow);
}

.pagination-controls button {
  padding: clamp(0.5rem, 1.5vw, 0.8rem) clamp(1rem, 2.5vw, 1.5rem);
  border: none;
  border-radius: 25px;
  background: var(--primary-blue);
  color: white;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.pagination-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-controls button:hover:not(:disabled) {
  background: var(--dark-blue);
  transform: translateY(-2px);
}

.pagination-controls .page-info {
  font-size: clamp(0.9rem, 2.2vw, 1rem);
  color: var(--text-dark);
  font-weight: 500;
}

.movies-grid {
  padding-bottom: clamp(4rem, 10vh, 6rem) !important;
}