/* Zen IPTV feature styles */

#toast-host {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.zen-toast {
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(22, 24, 34, 0.96);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.zen-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.zen-toast--success {
  border-color: rgba(61, 220, 132, 0.35);
}

.zen-toast--error {
  border-color: rgba(224, 49, 49, 0.45);
}

.zen-empty {
  width: 100%;
  padding: 36px 20px;
  text-align: center;
  color: var(--text-dim);
}

.zen-empty .icon,
.zen-empty .lucide {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  opacity: 0.45;
}

.zen-empty h3 {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 6px;
}

.zen-empty p {
  font-size: 13px;
  margin-bottom: 14px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-demo-source {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(135, 106, 255, 0.42);
  border-radius: 10px;
  background: rgba(135, 106, 255, 0.12);
  color: var(--accent-2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 11px 14px;
  cursor: pointer;
}

.settings-top {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.settings-top .btn-demo-source {
  width: auto;
  margin-top: 0;
}

.btn-demo-source:hover {
  background: rgba(135, 106, 255, 0.2);
  border-color: rgba(157, 141, 255, 0.68);
}

.btn-demo-source .icon,
.btn-demo-source .lucide {
  width: 16px;
  height: 16px;
}

#notify-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(28, 30, 44, 0.96);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: min(560px, calc(100% - 32px));
}

#notify-banner.hidden {
  display: none;
}

.notify-text {
  font-size: 13px;
  flex: 1;
}

.notify-action,
.notify-close {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.notify-close {
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
}

.skeleton-card {
  flex: 0 0 auto;
  width: 168px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.2s ease infinite;
}

.skeleton-card--wide {
  width: 260px;
  aspect-ratio: 16 / 9;
}

@keyframes skeleton-shine {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.view.view-enter {
  animation: view-fade 0.28s ease both;
}

@keyframes view-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.zen-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  background: rgba(8, 9, 12, 0.72);
  padding: 20px;
}

.zen-modal.hidden {
  display: none;
}

.zen-modal-card {
  width: min(380px, 100%);
  background: var(--zen-surface);
  border: 1px solid var(--zen-surface-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.zen-modal-card h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.zen-modal-card p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.zen-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.pin-input {
  width: 100%;
  letter-spacing: 0.4em;
  text-align: center;
  font-size: 22px;
  padding: 12px;
  border: 1px solid var(--zen-field-border);
  border-radius: var(--zen-field-radius);
  background: var(--zen-field-bg);
  color: #fff;
  font-family: var(--font-ui);
}

.profile-switch-wrap {
  position: relative;
}

.profile-switch-menu {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  width: 200px;
  background: rgba(18, 20, 28, 0.98);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 50;
}

.profile-switch-menu.hidden {
  display: none;
}

.profile-switch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.profile-switch-item:hover,
.profile-switch-item.active {
  background: rgba(255, 255, 255, 0.06);
}

.profile-switch-item .avatar {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

#mini-player {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 320px;
  z-index: 10050;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  background: #000;
}

#mini-player.hidden {
  display: none;
}

#mini-player-bg {
  height: 100px;
  background-size: cover;
  background-position: center;
}

#mini-player-info {
  padding: 10px 12px;
  background: rgba(12, 13, 18, 0.95);
  display: flex;
  align-items: center;
  gap: 8px;
}

#mini-player-info strong {
  display: block;
  font-size: 13px;
}

#mini-player-info small {
  font-size: 11px;
  color: var(--text-dim);
}

#mini-player-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  padding: 4px;
}

.vod-player.mini {
  opacity: 0;
  pointer-events: none;
}

.vod-tracks-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.vod-track-opt {
  border: 0;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: var(--font-ui);
  text-align: left;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.vod-track-opt.selected {
  background: var(--accent-soft);
}

.movie-filters {
  display: flex;
  gap: 10px;
  padding: 0 28px 14px;
  flex-wrap: wrap;
}

.movie-filters select {
  border: 1px solid var(--border);
  background: var(--input);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
}

.search-section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 16px 0 10px;
  color: var(--text-dim);
}

body[data-theme="light"] {
  --bg-deep: #eef0f6;
  --panel: #ffffff;
  --panel-2: #f4f5f9;
  --panel-3: #e8eaf0;
  --input: #f0f2f8;
  --text: #12131a;
  --text-dim: rgba(18, 19, 26, 0.62);
  --text-mute: rgba(18, 19, 26, 0.4);
  --border: rgba(18, 19, 26, 0.1);
}

body.rtl {
  direction: rtl;
}

body.rtl .sidebar {
  border-right: 0;
  border-left: 1px solid var(--border);
}

.epg-date-picker {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.epg-date-btn,
.text-button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
}

.epg-date-btn {
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
}

.epg-date-btn.active,
.epg-date-btn:hover {
  background: var(--accent-soft);
  color: #fff;
}

.profile-insights,
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.profile-stat,
.analytics-stat,
.sync-status-card,
.download-hero,
.insight-card,
.admin-notice {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
}

.profile-stat {
  padding: 16px;
}

.profile-stat strong,
.profile-stat span {
  display: block;
}

.profile-stat strong {
  font-size: 22px;
}

.profile-stat span,
.analytics-stat span,
.sync-status-card span,
.download-hero span,
.insight-card-head span,
.download-copy small,
.admin-item-body small {
  color: var(--text-dim);
  font-size: 12px;
}

.sync-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.sync-status-card > div:nth-child(2) {
  display: grid;
  gap: 3px;
  flex: 1;
}

.sync-status-icon,
.notification-icon,
.download-art {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  color: var(--accent-2);
  background: var(--accent-soft);
}

.feature-page {
  max-width: 980px;
  margin: 0 auto;
}

.feature-toolbar,
.insight-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.feature-toolbar {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.feature-toolbar .text-button,
.insight-card-head span {
  margin-left: auto;
}

.status-dot,
.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6d5dfc;
}

.notification-list,
.download-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.notification-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.notification-item:hover,
.notification-item.is-unread {
  border-color: rgba(135, 106, 255, 0.45);
}

.notification-copy,
.download-copy {
  display: grid;
  gap: 4px;
  flex: 1;
}

.notification-copy span {
  color: var(--text-dim);
  font-size: 13px;
}

.notification-copy small {
  color: var(--text-mute);
  font-size: 11px;
}

.download-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
}

.download-hero > div {
  display: grid;
  gap: 4px;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.download-status {
  color: var(--accent-2);
  font-size: 12px;
}

.download-progress {
  display: block;
  height: 4px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--border);
}

.download-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
}

.analytics-grid {
  grid-template-columns: repeat(4, 1fr);
  margin: 18px 0;
}

.analytics-stat {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.analytics-stat .icon {
  color: var(--accent-2);
}

.insight-card {
  padding: 18px;
  margin-bottom: 14px;
}

.activity-bars {
  display: flex;
  align-items: end;
  justify-content: space-between;
  height: 150px;
  gap: 12px;
  padding-top: 22px;
}

.activity-bar-wrap {
  display: grid;
  align-items: end;
  justify-items: center;
  height: 100%;
  flex: 1;
  gap: 8px;
}

.activity-bar {
  display: block;
  width: min(28px, 100%);
  min-height: 8px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--accent-2), #6d5dfc);
}

.activity-bar-wrap small {
  color: var(--text-dim);
  font-size: 11px;
}

.admin-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  margin: 18px 0;
  color: var(--text-dim);
  font-size: 13px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.admin-item {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-2);
}

.admin-item-art {
  display: flex;
  align-items: flex-end;
  height: 150px;
  padding: 10px;
  background-color: var(--panel-3);
  background-size: cover;
  background-position: center;
}

.admin-item-art span {
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
}

.admin-item-body {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.admin-item-body div {
  display: flex;
  gap: 12px;
}

.text-button {
  color: var(--accent-2);
  font-size: 12px;
}

.text-button.danger {
  color: #ff8c9a;
}

.btn:focus-visible,
.nav-btn:focus-visible,
.settings-card:focus-visible,
.settings-row:focus-visible,
.notification-item:focus-visible,
.epg-date-btn:focus-visible,
.text-button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .epg-date-picker {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .live-header {
    flex-wrap: wrap;
  }

  .profile-insights,
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sync-status-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sync-status-card .btn {
    margin-left: 50px;
  }

  #mini-player {
    right: 12px;
    bottom: 76px;
    width: calc(100% - 24px);
  }
}

@media (max-width: 480px) {
  .feature-page {
    padding: 16px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .settings-sub-header {
    align-items: flex-start;
  }

  .settings-sub-header .btn {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
