@font-face {
  font-family: "Yekan";
  src: url("../fonts/Yekan.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #ff8c32;
  --primary-glow: rgba(255, 140, 50, 0.3);
  --primary-soft: rgba(255, 140, 50, 0.08);

  --bg: #0f0f0f;
  --bg-radial-1: rgba(255, 140, 50, 0.08);
  --bg-radial-2: rgba(255, 140, 50, 0.04);

  --surface: #1a1a1a;
  --surface-hover: #252525;
  --surface-2: #202020;

  --border: #333333;
  --border-soft: rgba(255, 255, 255, 0.06);

  --text: #ffffff;
  --text-secondary: #a0a0a0;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 18px rgba(255, 140, 50, 0.16);

  --transition: 0.28s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: 0.15s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Yekan", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 1rem;
  overflow-x: hidden;
  direction: rtl;
  color-scheme: dark;
  margin-bottom: 50px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea,
a,
.file-card,
.btn-icon,
.back-btn,
.section-title_btn,
.search-icon {
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

button,
input,
select,
textarea {
  font: inherit;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: none;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), #ffb067);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff9f55, var(--primary));
}

::selection {
  background: var(--primary);
  color: #000;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

header {
  background: rgba(26, 26, 26, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 10px;
  z-index: 100;
}

#filterSearchBtn {
  grid-column: 1 / -1;
  display: flex;
  gap: 1rem;
}

.filter-search {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.filter-search-view header .brand {
  justify-content: center;
  grid-column: 1 / -1;
}

.filter-search .back-btn {
  margin: 0;
}

.filter-search.active {
  display: grid;
}

.filter-search .search-box,
.filter-search #goHome {
  grid-column: 1 / -1;
}

.search-container {
  display: flex;
  justify-content: center;
  position: relative;
  grid-column: 1 / -1;
}

.search-box {
  width: 100%;
  background: linear-gradient(180deg, #171717, var(--bg));
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.85rem 1.5rem;
  border-radius: 50px;
  font-size: 1rem;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.24);
  padding-left: 3rem;
}

.search-box::placeholder {
  color: #7e7e7e;
}

.search-box:focus {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px var(--primary-glow),
    inset 0 2px 5px rgba(0, 0, 0, 0.2);
  background: #161616;
}

.search-icon {
  position: absolute;
  left: 1rem;
  width: 24px;
  cursor: pointer;
  color: var(--primary);
  top: 55%;
  transform: translateY(-55%);
}

.search-icon:hover {
  color: #ff9f55;
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.view-section.active {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section {
  display: flex;
  flex-direction: column;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-title_btn {
  cursor: pointer;
  color: inherit;
}

.section-title_btn:hover {
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

.section-content {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  grid-auto-flow: column;
  grid-auto-columns: 10rem;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  scroll-behavior: smooth;
  padding-block: 0.25rem;
}

.section-content.active {
  cursor: grabbing;
}

.hero-logo {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  text-shadow:
    0 0 20px var(--primary-glow),
    0 0 38px rgba(255, 140, 50, 0.12);
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.hero-input-wrapper {
  width: 100%;
  max-width: 500px;
  position: relative;
}

.hero-input {
  width: 100%;
  padding: 1.2rem 2rem;
  font-size: 1.2rem;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: linear-gradient(180deg, #1c1c1c, var(--surface));
  color: #fff;
  text-align: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.22);
}

.hero-input::placeholder {
  color: #888;
}

.hero-input:focus {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px var(--primary-glow),
    0 0 30px rgba(255, 140, 50, 0.14);
}

.file-list {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
}

.file-card {
  background: linear-gradient(180deg, #1c1c1c, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.5rem;
  gap: 1rem;
  box-shadow: var(--shadow-soft);
}

.file-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top,
    rgba(255, 140, 50, 0.1),
    transparent 55%
  );
  opacity: 0;
  pointer-events: none;
}

.file-card:hover {
  border-color: var(--primary);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 16px rgba(255, 140, 50, 0.12);
  transform: translateY(-2px);
}

.file-card:hover::before {
  opacity: 1;
}

.card-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #000;
  border-radius: 3px;
  pointer-events: none;
}

.card-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.card-title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.imdb-badge {
  background: #f5c518;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.75rem;
  white-space: nowrap;
}

.details-header {
  display: flex;
  gap: 2rem;
  background: linear-gradient(180deg, #1d1d1d, var(--surface));
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-wrap: wrap;
  box-shadow: var(--shadow-soft);
}

.details-poster {
  width: 200px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  align-self: flex-start;
}

.details-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  min-width: 0;
}

.details-title {
  font-size: 2rem;
  color: var(--primary);
  text-shadow: 0 0 14px var(--primary-glow);
  line-height: 1.2;
}

.details-desc {
  color: #ccc;
  line-height: 1.7;
  font-size: 0.95rem;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.seasons-container {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.season-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.season-title {
  font-size: 1.2rem;
  background: transparent;
  color: var(--primary);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border) !important;
  padding-bottom: 0.5rem;
  display: inline-block;
  border: none;
  text-shadow: 0 0 10px var(--primary-glow);
}

select.season-title {
  cursor: pointer;
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.episode-item {
  display: flex;
  align-items: center;
  background: var(--surface);
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.episode-item:hover {
  border-color: var(--border);
  background: var(--surface-hover);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.18),
    0 0 10px rgba(255, 140, 50, 0.06);
}

.ep-number {
  width: 40px;
  height: 40px;
  background: linear-gradient(180deg, #3a3a3a, var(--border));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin-left: 1rem;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ep-info {
  flex: 1;
  margin-right: 1rem;
  min-width: 0;
}

.ep-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
}

.ep-size {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.ep-actions {
  display: flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.btn-icon {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.btn-icon:hover {
  background: var(--primary);
  color: #fff !important;
  fill: #fff !important;
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px rgba(255, 140, 50, 0.08),
    0 0 14px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-icon:hover.copy path {
  fill: #fff !important;
}

.btn-icon.play {
  color: #ff5656;
}

.btn-icon.played {
  color: #4ade80;
}

.btn-icon.download {
  color: #60a5fa;
}

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.loading {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin: 2rem auto;
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

div#loadingIndicator {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 101;
  background-color: #000000c2;
  align-content: center;
  justify-content: center;
  flex-wrap: wrap;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.back-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
  box-shadow: var(--shadow-soft);
}

.back-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(255, 140, 50, 0.08);
}

input.back-btn {
  cursor: text;
}

#loadMoreBtn {
  min-height: 320px;
}

.modal {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  width: min(40%, 720px);
  max-height: fit-content;
  inset: 0;
  margin: auto;
  background: linear-gradient(180deg, #1a1a1a, #151515);
  z-index: 102;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.65),
    0 0 24px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  transition: all 100ms ease-in;
}

.modal.active,
.overlay.active {
  visibility: visible;
  opacity: 1;
}

.modal-title {
  background: #121212;
  position: relative;
  padding: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.close-modal {
  cursor: pointer;
  color: #ff5656;
  font-size: 3rem;
  position: absolute;
  left: 0.5rem;
  top: 0;
  line-height: 1;
  user-select: none;
}

.close-modal:hover {
  color: #ff7a7a;
  text-shadow: 0 0 12px rgba(255, 86, 86, 0.2);
}

.modal-content {
  padding: 1rem;
  overflow-x: hidden;
  max-height: 70vh;
  overflow-y: auto;
}

.modal .back-btn {
  margin: 0;
}

.overlay {
  content: "";
  position: fixed;
  display: block;
  visibility: hidden;
  opacity: 0;
  background-color: #000000c2;
  width: 100%;
  height: 100%;
  z-index: 101;
}

.filter-search-view .search-container {
  display: none;
}

.donate-link {
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  padding: 0.5rem;
  background: rgba(26, 26, 26, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  overflow: hidden;
  max-height: 10%;
}

.donate-link_content {
  min-width: 100%;
  width: max-content;
  animation: marq 20s infinite linear;
}

@keyframes marq {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

@media (max-width: 768px) {
  body {
    padding: 0.75rem;
  }

  header {
    top: 8px;
    grid-template-columns: 1fr;
  }

  .details-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
  }

  .details-poster {
    width: 150px;
    align-self: center;
  }

  .details-title {
    font-size: 1.7rem;
  }

  .ep-actions {
    margin-right: 0;
    margin-left: auto;
  }

  .hero-logo {
    font-size: 2rem;
  }

  .modal {
    width: 80%;
  }

  .brand {
    justify-content: center;
  }

  .brand,
  .search-container {
    grid-column: 1 / -1;
  }

  .file-list {
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  }
  .file-card:hover {
    transform: translateY(0px);
  }
  .donate-link_content {
    animation: marq 15s infinite linear;
  }
}

@media (max-width: 500px) {
  html {
    font-size: 14px;
  }

  header {
    gap: 0.85rem;
  }

  header .search-container {
    width: 100%;
  }

  .hero-input {
    font-size: 1rem;
    padding: 1rem 1.2rem;
    padding-left: 2.8rem;
  }

  .details-desc {
    max-height: 180px;
  }

  .card-info {
    padding: 0.85rem;
  }

  .episode-item {
    padding: 0.7rem;
  }

  .ep-number {
    width: 36px;
    height: 36px;
    margin-left: 0.75rem;
  }

  .modal {
    width: 92%;
    min-height: auto;
  }
  .donate-link_content {
    animation: marq 10s infinite linear;
  }
}
