/* Default modern reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
}

/* Base Light Theme */
:root {
  --bg-color: #ffffff;
  --text-main: #1e1e1e;
  --text-muted: #6b7280;
  --header-bg: #ffffff;
  --border-color: #e5e7eb;
  --search-bg: #f9fafb;
  --card-bg: #ffffff;
  --card-hover: #f3f4f6;
  --accent-color: #00d3a9;
  --btn-bg: #f3f4f6;
  --btn-text: #1e1e1e;
  --footer-bg: #f9fafb;
}

/* Dark Theme */
[data-theme='dark'] {
  --bg-color: #020617;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --header-bg: rgba(2, 6, 23, 0.85);
  --border-color: #1e293b;
  --search-bg: #0f172a;
  --card-bg: #0f172a;
  --card-hover: #1e293b;
  --accent-color: #ce1a3b;
  --btn-bg: #1e293b;
  --btn-text: #f8fafc;
  --footer-bg: linear-gradient(180deg, #020617 0%, #1e1b4b 100%);
}

body.theme-container {
  background-color: var(--bg-color);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

.layout-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Header Logo Styling */
.header-logo-container {
  display: flex;
  align-items: baseline;
  font-family: Impact, "Oswald", sans-serif;
  user-select: none;
}

.header-logo-text {
  font-size: 38px;
  letter-spacing: 1px;
  font-weight: normal;
}

.header-logo-ring {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 3px solid #ff2020;
  border-radius: 50%;
  box-shadow: 0 0 12px #ff2020, 0 0 4px #ff2020 inset;
  margin: 0 4px 0 2px;
  position: relative;
  top: -2px;
  animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 0 8px #ff2020, 0 0 2px #ff2020 inset; }
  to { box-shadow: 0 0 18px #ff2020, 0 0 6px #ff2020 inset; }
}

.header-logo-suffix {
  font-size: 32px;
  font-weight: normal;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Search bar */
.search-bar-container {
  max-width: 650px;
  margin: 1.5rem auto 0;
  position: relative;
  z-index: 100;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--search-bg);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.6rem 1.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.search-wrapper:focus-within {
  border-color: var(--accent-color);
  background-color: var(--bg-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-color);
  transform: translateY(-2px);
}

.search-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  margin-right: 1rem;
  transition: color 0.3s;
}

.search-wrapper:focus-within .search-icon {
  color: var(--accent-color);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  min-width: 0;
  height: 40px;
}

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

.search-submit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  padding: 0.5rem;
  border-radius: 50%;
}

.search-submit:hover {
  color: var(--accent-color);
  background: rgba(206, 26, 59, 0.1);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
  display: none;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: var(--text-main);
  transition: all 0.2s;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.search-result-item:last-child { border-bottom: none; }

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
  padding-left: 1.75rem;
}

.search-result-img {
  width: 45px;
  height: 65px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.search-result-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-result-meta span:first-child {
  color: var(--accent-color);
  font-weight: 600;
}

/* Main Content */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Footer */
.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1rem 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.footer-brand h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 500px;
}

.telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--text-main);
  color: var(--bg-color);
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, opacity 0.2s;
}

.telegram-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.footer-bottom {
  width: 100%;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.heart {
  color: #ff4757;
}

.team {
  color: var(--text-main);
  font-weight: 500;
}

.footer-legal {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

@media (max-width: 600px) {
  .footer-legal {
    flex-direction: column;
    gap: 0.5rem;
  }
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #2ed573;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(46, 213, 115, 0.4);
}

/* Category Filters (Pills) */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0 3rem;
}

.pill {
  background-color: var(--search-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
}

.pill:hover {
  background-color: var(--card-hover);
}

.pill.active {
  border-color: #00d3a9;
  color: #00d3a9;
  background: rgba(0, 211, 169, 0.1);
}

.pill i {
  font-size: 1rem;
}

.icon-all { color: #00d3a9; }
.icon-movie { color: #ff4757; }
.icon-tv { color: #3b82f6; }
.icon-anime { color: #a855f7; }
.icon-drama { color: #fbbf24; }

/* Sections for Home Grid */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.view-more {
  color: var(--accent-color);
  font-size: 0.9rem;
  text-decoration: none;
}

.horizontal-scroll-container {
  display: flex;
  overflow-x: auto;
  gap: 1.5rem;
  padding: 1rem 0 2rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  width: 95dvw;
  margin-left: calc((100% - 95dvw) / 2);
}

@media (min-width: 1200px) {
  .horizontal-scroll-container {
    width: 100%;
    margin-left: 0;
    overflow-x: scroll; /* Allow desktop users to see scrollbar if they want, but hidden below */
  }
}

.horizontal-scroll-container::-webkit-scrollbar {
  display: none;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1rem 0;
}

@media (min-width: 600px) { .content-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .content-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .content-grid { grid-template-columns: repeat(5, 1fr); } }

.movie-card {
  scroll-snap-align: start;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  background-color: var(--card-bg);
  transition: transform 0.2s;
}

.horizontal-scroll-container .movie-card {
  flex: 0 0 calc(60% - 1rem); /* Larger cards for better mobile swiping */
  width: calc(60% - 1rem);
}

@media (min-width: 600px) {
  .horizontal-scroll-container .movie-card {
    flex: 0 0 calc(33.333% - 1rem);
    width: calc(33.333% - 1rem);
  }
}

@media (min-width: 900px) {
  .horizontal-scroll-container .movie-card {
    flex: 0 0 calc(25% - 1rem);
    width: calc(25% - 1rem);
  }
}

@media (min-width: 1200px) {
  .horizontal-scroll-container .movie-card {
    flex: 0 0 calc(20% - 1rem);
    width: calc(20% - 1rem);
  }
}

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

.movie-poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  width: 100%;
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-info {
  padding: 0.75rem 0.5rem;
}

.movie-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

/* Starfield Animation */
.starfield-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}

.passing-star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.6);
  opacity: 0;
  animation: passingStar linear infinite;
}

@keyframes passingStar {
  0% { transform: translate(0, 0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translate(-100vw, 100vh); opacity: 0; }
}

/* Shooting Star */
.shooting-star {
    position: fixed;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 2px;
    background: linear-gradient(to left, rgba(255, 230, 0, 1), transparent);
    transform: rotate(-45deg);
    z-index: 5;
    pointer-events: none;
    animation: shooting 4s linear infinite;
}

.shooting-star::after {
    content: '';
    position: absolute;
    right: 0;
    top: -5px;
    width: 12px;
    height: 12px;
    background: #ffcc00;
    border-radius: 50%;
    box-shadow: 0 0 20px 4px #ffcc00;
}

@keyframes shooting {
    0% { transform: translate(0, 0) rotate(-45deg); opacity: 0; }
    10% { opacity: 1; }
    30% { transform: translate(-120vw, 120vh) rotate(-45deg); opacity: 0; }
    100% { transform: translate(-120vw, 120vh) rotate(-45deg); opacity: 0; }
}

/* Theme Toggle Button (Pill Style) */
.theme-toggle-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  width: 72px;
  height: 36px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Stars for Dark Mode */
.theme-toggle-btn .stars-container {
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 30px;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    gap: 4px;
    opacity: 1;
    transition: opacity 0.3s;
}

.theme-toggle-btn .stars-container span {
    display: inline-block;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
}

/* Clouds for Light Mode */
.theme-toggle-btn .clouds-container {
    position: absolute;
    right: 10px;
    top: 0;
    bottom: 0;
    width: 30px;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-end;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.theme-toggle-btn .clouds-container span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
}

.theme-toggle-btn .toggle-thumb {
  position: absolute;
  right: 4px;
  width: 28px;
  height: 28px;
  background: #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 5;
}

[data-theme='light'] .theme-toggle-btn {
  background: #fde68a;
  border-color: #fbbf24;
}

[data-theme='light'] .theme-toggle-btn .toggle-thumb {
  transform: translateX(-36px);
  background: #fbbf24;
  box-shadow: 0 0 10px #fbbf24;
}

[data-theme='light'] .theme-toggle-btn .stars-container {
    opacity: 0;
}

[data-theme='light'] .theme-toggle-btn .clouds-container {
    opacity: 1;
}

.theme-toggle-btn svg {
  width: 16px;
  height: 16px;
  z-index: 10;
}

/* Detail Page Specifics - Modern Redesign */
.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.detail-backdrop-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.detail-backdrop-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(40px) brightness(0.3);
    transform: scale(1.1);
}

.detail-backdrop-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-color) 100%);
}

.detail-hero {
    display: flex;
    gap: 3rem;
    padding: 4rem 0;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .detail-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2rem 0;
    }
}

.detail-poster-main {
    width: 320px;
    flex-shrink: 0;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px var(--border-color);
    transition: transform 0.3s ease;
}

.detail-poster-main:hover {
    transform: scale(1.02);
}

.detail-content-wrap {
    flex: 1;
}

.badge-pill {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.detail-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 600px) {
    .detail-title { font-size: 2.5rem; }
}

.meta-info-bar {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
    color: var(--text-muted);
}

@media (max-width: 900px) { .meta-info-bar { justify-content: center; } }

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

.meta-item i { color: var(--accent-color); }

.detail-desc {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 800px;
}

.action-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

@media (max-width: 900px) { .action-row { justify-content: center; } }

.btn-premium {
    padding: 1rem 2.5rem;
    border-radius: 16px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s;
    background: var(--accent-color);
    color: #000;
}

.btn-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(206, 26, 59, 0.4);
}

.btn-outline {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: #fff;
}

.content-section {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 3rem;
    margin-bottom: 3rem;
}

.staff-review-text {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #cbd5e1;
}

.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
}
