@font-face {
  font-family: 'Vazirmatn';
  src: url('Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-color: #070b14;
  --card-bg: #0f172a;
  --card-hover: #1e293b;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #38bdf8;
  --focus-ring: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --badge-dub: #10b981;
  --badge-sub: #0284c7;
  --badge-orig: #8b5cf6;
  --font-family: 'Vazirmatn', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Tahoma", "Arial", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  overflow-x: hidden;
  padding: 16px;
}

button, input, textarea, select {
  font-family: inherit;
}

@media (min-width: 769px) {
  body {
    padding: 24px 36px;
  }
}

/* افکت فوکوس برای ریموت کنترل تلویزیون */
:focus-visible,
.card:focus, .card:hover,
.continue-card:focus, .continue-card:hover,
.btn:focus, .btn:hover,
.stream-pill-btn:focus, .stream-pill-btn:hover,
.season-tab:focus, .season-tab:hover,
.ep-btn:focus, .ep-btn:hover,
.stream-item:focus, .stream-item:hover,
.osd-btn:focus, .osd-btn:hover,
.sub-opt-btn:focus, .sub-opt-btn:hover,
.sub-item-btn:focus, .sub-item-btn:hover,
.filter-btn:focus, .filter-btn:hover,
.player-back-btn:focus, .player-back-btn:hover,
.settings-btn:focus, .settings-btn:hover,
.user-btn:focus, .user-btn:hover,
.modal-poster-close:focus, .modal-poster-close:hover,
.modal-close-pill:focus, .modal-close-pill:hover,
.search-input:focus {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.85) !important;
  transform: scale(1.03);
  z-index: 10;
}

.osd-btn.menu-open {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.55) !important;
}

header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 16px;
}

@media (min-width: 769px) {
  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.logo {
  font-size: 24px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.top-history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.user-btn {
  background: #0369a1;
  color: #ffffff;
  border: 1px solid #38bdf8;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.35);
}

.settings-btn {
  background: #0f172a;
  color: #38bdf8;
  border: 1px solid #334155;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 2px solid #1e293b;
  border-radius: 25px;
  padding: 8px 16px;
  width: 100%;
  transition: all 0.2s;
}

@media (min-width: 769px) {
  .search-box {
    width: 320px;
  }
}

.search-box:focus-within {
  border-color: var(--focus-ring);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  width: 100%;
  direction: rtl;
}

.settings-input {
  background: #070b14;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: monospace, sans-serif;
  letter-spacing: 0.5px;
  color: #fff;
  width: 100%;
  margin-top: 4px;
}

.filters-container {
  margin-bottom: 14px;
}

.filters-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

.filters-bar::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid #334155;
  color: #cbd5e1;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  transition: all 0.2s;
  flex-shrink: 0;
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary-light);
  color: #fff;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.6);
}

.row-title {
  font-size: 17px;
  font-weight: 700;
  margin: 18px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shelf {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px 16px 4px;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

.shelf::-webkit-scrollbar {
  display: none;
}

.card {
  flex: 0 0 135px;
  height: 205px;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  outline: none;
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}

@media (min-width: 769px) {
  .card {
    flex: 0 0 165px;
    height: 250px;
  }
}

.catalog-more-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  text-align: center;
  color: #e2e8f0;
  background: linear-gradient(145deg, #0f172a, #070b14);
  border: 2px dashed #334155;
  user-select: none;
}

.catalog-more-card .more-icon {
  font-size: 42px;
  line-height: 1;
  color: #38bdf8;
  font-weight: 300;
}

.catalog-more-card .more-label {
  font-size: 12px;
  line-height: 1.7;
  font-weight: 800;
}

.catalog-more-card.loading {
  opacity: .75;
  border-style: solid;
}

.catalog-more-card.error {
  border-color: #f59e0b;
  color: #fde68a;
}

@media (min-width: 769px) {
  .catalog-more-card .more-icon {
    font-size: 50px;
  }
  .catalog-more-card .more-label {
    font-size: 14px;
  }
}

.card:focus .card-title,
.card:hover .card-title {
  font-size: 1.12em;
}

.card:focus .card-meta,
.card:hover .card-meta {
  font-size: 1.05em;
  color: #fff;
}

.card .card-title,
.card .card-meta {
  transition: font-size .16s ease, color .16s ease;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(7, 11, 20, 0.95) 25%, transparent 100%);
  padding: 8px 6px 4px 6px;
}

.card-title {
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
}

/* ادامه تماشا */
.continue-card {
  flex: 0 0 220px;
  height: 130px;
  border-radius: 10px;
  position: relative;
  background: var(--card-bg);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  border: 2px solid transparent;
  transition: transform 0.2s;
}

.continue-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.delete-continue-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  z-index: 15;
  outline: none;
  transition: transform 0.2s, background 0.2s;
}

.delete-continue-btn:hover,
.delete-continue-btn:focus {
  background: #ef4444 !important;
  transform: scale(1.2) !important;
}

.continue-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(0deg, rgba(7, 11, 20, 0.95), transparent);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}

/* پنجره‌های مودال */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.94);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 10px;
}

.modal-box {
  width: 100%;
  max-width: 950px;
  max-height: 90vh;
  background: #0d1527;
  border-radius: 14px;
  border: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 769px) {
  .modal-box {
    flex-direction: row;
    width: 85vw;
    max-height: 85vh;
  }
}

.dm-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
}

.modal-poster {
  position: relative;
  width: 100%;
  height: 165px;
  flex-shrink: 0;
  background: #070b14;
}

@media (min-width: 769px) {
  .modal-poster {
    width: 270px;
    height: auto;
  }
}

.modal-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-close-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close-pill:hover,
.modal-close-pill:focus {
  background: #334155;
  color: #fff;
}

.modal-poster-close {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 12;
  backdrop-filter: blur(8px);
}

.modal-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-y: auto;
  min-width: 0;
}

.modal-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 6px;
  color: #38bdf8;
}

.modal-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  background: #1e293b;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  color: #38bdf8;
  border: 1px solid #334155;
}

.modal-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 14px;
  max-height: 70px;
  overflow-y: auto;
}

/* استایل اختصاصی پنجره بخش کاربری (User Modal) */
.user-modal-box {
  flex-direction: column !important;
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.user-stat-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-stat-val {
  font-size: 20px;
  font-weight: 900;
  color: #38bdf8;
}

.user-stat-lbl {
  font-size: 10px;
  color: #94a3b8;
}

.user-actions-box {
  background: #0a0f1d;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 14px;
  margin-top: 4px;
}

.user-box-heading {
  font-size: 13px;
  font-weight: bold;
  color: #f8fafc;
  margin-bottom: 6px;
}

.user-box-desc {
  font-size: 11px;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 12px;
}

.user-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-action-btn {
  width: 100%;
  padding: 10px 14px;
  font-size: 12px;
  background: #0284c7;
  border: 1px solid #38bdf8;
}

.user-action-btn.delete-all-btn {
  background: #7f1d1d;
  border-color: #ef4444;
  margin-top: 4px;
}

/* تب‌های فصل و قسمت‌ها */
.season-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.season-tab {
  background: #0f172a;
  border: 1px solid #334155;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #cbd5e1;
  white-space: nowrap;
  outline: none;
}

.season-tab.active {
  background: var(--primary);
  border-color: var(--primary-light);
  color: #fff;
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 7px;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.ep-btn {
  background: #0f172a;
  border: 1px solid #334155;
  color: #fff;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  transition: all 0.2s;
}

.ep-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
}

.ep-btn.current-playing {
  background: #0c4a6e;
  border: 2px solid #38bdf8;
  color: #e0f2fe;
}

.ep-btn.watched {
  background: #142a22;
  border-color: #10b981;
  color: #a7f3d0;
}

.ep-watch-toggle {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 9px;
  line-height: 1.4;
  cursor: pointer;
}

.ep-btn.watched .ep-watch-toggle {
  background: #064e3b;
  color: #a7f3d0;
}

.season-watch-toggle {
  flex: 0 0 auto;
  border: 1px solid #0284c7;
  background: #0c4a6e;
  color: #e0f2fe;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 10px;
  cursor: pointer;
}

.ep-btn.unreleased {
  opacity: 0.45;
  border-style: dashed;
  border-color: #475569;
  background: #070b14;
  color: #94a3b8;
}

.ep-date {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ep-btn.unreleased .ep-date {
  color: #f59e0b;
  font-weight: 600;
}

/* لینک‌های استریم */
.streams-section {
  background: #070b14;
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
  border: 1px solid #1e293b;
}

.streams-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  line-height: 1.5;
}

.streams-top-refresh {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.streams-refresh-top-btn {
  background: #0f172a;
  border: 1px solid #334155;
  color: #38bdf8;
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 7px;
  width: 100%;
}

.stream-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  background: #0f172a;
  border: 1px solid #1e293b;
  padding: 9px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  outline: none;
  min-width: 0;
}

.stream-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.stream-top-row::-webkit-scrollbar {
  display: none;
}

.stream-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.stream-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.stream-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  color: #ffffff;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  outline: none;
}

.stream-item .stream-name {
  font-size: 10.5px;
  color: #cbd5e1;
  direction: ltr;
  text-align: left;
  width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
  word-break: break-all;
}

.quality-tag {
  background: #0284c7;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}

.lang-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: bold;
  white-space: nowrap;
}

.lang-dub { background: var(--badge-dub); color: #fff; }
.lang-sub { background: var(--badge-sub); color: #fff; }
.lang-orig { background: var(--badge-orig); color: #fff; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}

/* پلیر ویدیو */
#playerContainer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: none;
  transition: cursor 0.2s;
}

#playerContainer.hide-cursor {
  cursor: none;
}

#playerContainer:fullscreen,
#playerContainer:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
}

#mainVideo {
  width: 100%;
  height: 100%;
  outline: none;
}

.player-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.92) 0%, rgba(0,0,0,0) 100%);
  z-index: 1010;
  gap: 10px;
  transition: opacity 0.35s ease, transform 0.35s ease;
  opacity: 1;
  transform: translateY(0);
}

.player-top-bar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.player-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.player-title {
  font-size: 14px;
  font-weight: 800;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

@media (max-width: 768px) {
  .player-title {
    max-width: 140px;
    font-size: 12px;
  }
}

.player-actions-left {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  max-width: calc(100% - 150px);
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.player-actions-left::-webkit-scrollbar {
  display: none;
}

.osd-btn {
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  outline: none;
}

.player-back-btn {
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  outline: none;
}

.track-modal {
  position: absolute;
  top: 54px;
  background: #0d1527;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 350px;
  max-width: 92vw;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  z-index: 1025;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95);
}

.track-modal #playerQualityList,
.track-modal #playerStreamsList {
  max-height: min(42vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.track-modal-title {
  font-size: 12px;
  color: #38bdf8;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 4px;
  margin-top: 4px;
  margin-bottom: 2px;
  font-weight: bold;
}

.sub-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0;
  font-size: 11px;
  color: #cbd5e1;
}

.sub-btn-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.sub-opt-btn {
  background: #0f172a;
  color: #fff;
  border: 1px solid #0284c7;
  border-radius: 4px;
  padding: 4px 7px;
  font-size: 10px;
  cursor: pointer;
  outline: none;
}

.sub-opt-btn.active {
  background: #0284c7;
  font-weight: bold;
}

.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  outline: none;
}

.sub-item-btn {
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #cbd5e1;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  width: 100%;
  text-align: right;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  transition: all 0.2s;
}

.sub-item-btn.active {
  background: #0284c7 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  font-weight: bold;
}

#customSubtitleOverlay {
  position: absolute;
  bottom: 28px;
  left: 4%;
  right: 4%;
  text-align: center;
  pointer-events: none;
  z-index: 1005;
  display: flex;
  justify-content: center;
  transition: bottom 0.2s ease;
}

.subtitle-text {
  padding: 5px 16px;
  border-radius: 6px;
  line-height: 1.45;
  direction: rtl;
  max-width: 95%;
  transition: font-size 0.15s, color 0.15s;
}

.subtitle-text.box-bg {
  background-color: rgba(0, 0, 0, 0.85);
  text-shadow: 2px 2px 3px #000;
}

.subtitle-text.no-bg {
  background-color: transparent !important;
  text-shadow:
    -2px -2px 0 #000,
     2px -2px 0 #000,
    -2px  2px 0 #000,
     2px  2px 0 #000,
     0px  3px 6px rgba(0, 0, 0, 0.95);
}

.subtitle-text.font-vazir {
  font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif !important;
}

.subtitle-text.font-system {
  font-family: "Tahoma", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: 50%;
  border-top-color: #38bdf8;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { 
  to { transform: rotate(360deg); } 
}