/* ==========================================================
   ابزارهای پلیر : پخش با VLC و تماشای گروهی
   ========================================================== */
.dm-player-tools {
  display: none;
}

/* دکمه های نوار کنترل */
.plyr__controls .dm-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  direction: rtl;
}

.plyr__controls .dm-control .dm-vlc-icon {
  width: 18px;
  height: 20px;
  display: block;
  object-fit: contain;
}

.plyr__controls .dm-control > i {
  font-size: 16px;
  width: 18px;
  text-align: center;
}

.plyr__controls .dm-control .dm-ctrl-label {
  display: none;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.plyr__controls .dm-control .dm-badge {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 10px;
  background: #1f7f9d;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}

.plyr__controls #dm-party-btn.active > i {
  color: #4fd1f0;
}

@media (min-width: 1200px) {
  .plyr__controls .dm-control {
    padding-right: 10px;
    padding-left: 10px;
  }

  .plyr__controls .dm-control .dm-ctrl-label {
    display: inline-block;
  }

  .plyr__controls .dm-control:hover .plyr__tooltip {
    display: none;
  }
}

@media (max-width: 480px) {
  .plyr__controls #dm-party-btn {
    display: none;
  }
}

/* راهنمای اولین بار VLC */
.dm-hint {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  z-index: 5;
  width: 230px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(20, 24, 33, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  color: #e8e8e8;
  font-size: 12px;
  line-height: 1.9;
  text-align: right;
  white-space: normal;
  direction: rtl;
  cursor: default;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: 0.25s opacity, 0.25s transform;
  -webkit-transition: 0.25s opacity, 0.25s transform;
}

.dm-hint.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dm-hint::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -7px;
  border: 7px solid transparent;
  border-top-color: rgba(20, 24, 33, 0.94);
}

.dm-hint p {
  margin: 0;
}

.dm-hint b {
  color: #ffa726;
  font-weight: 700;
}

.dm-hint .ok {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

/* مودال */
body.dm-modal-open {
  overflow: hidden;
}

.dm-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: 0.2s opacity;
  -webkit-transition: 0.2s opacity;
  direction: rtl;
}

.dm-modal[hidden] {
  display: none;
}

.dm-modal.is-open {
  opacity: 1;
}

.dm-modal-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 20px;
  background: #151922;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
  color: #e8e8e8;
  transform: translateY(12px);
  transition: 0.25s transform;
  -webkit-transition: 0.25s transform;
  scrollbar-width: thin;
  scrollbar-color: #3a3f4b transparent;
}

.dm-modal.is-open .dm-modal-box {
  transform: translateY(0);
}

.dm-modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #bbb;
  font-size: 16px;
  cursor: pointer;
  transition: 0.2s all;
  -webkit-transition: 0.2s all;
}

.dm-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* دکمه ها */
.dm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: 0.2s all;
  -webkit-transition: 0.2s all;
}

.dm-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dm-btn.primary {
  background: #1f7f9d;
  border-color: #1f7f9d;
}

.dm-btn.primary:hover {
  background: #2591b3;
  border-color: #2591b3;
}

.dm-btn.block {
  display: flex;
  width: 100%;
}

.dm-btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.dm-btn[hidden] {
  display: none;
}

/* VLC */
.dm-vlc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 40px;
}

.dm-vlc-head .dm-vlc-logo {
  width: 44px;
  height: 50px;
  object-fit: contain;
}

.dm-vlc-head .title {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.dm-vlc-head .sub {
  margin: 4px 0 0;
  color: #9aa1ad;
  font-size: 13px;
}

.dm-vlc-about {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 152, 0, 0.07);
  border-right: 3px solid #ff9800;
  color: #cfd3da;
  font-size: 13px;
  line-height: 2;
}

.dm-vlc-about b {
  display: block;
  color: #ffb74d;
  font-weight: 700;
}

.dm-vlc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.dm-vlc-actions .dm-btn[hidden] + .dm-btn {
  grid-column: 1 / -1;
}

.dm-vlc-msg {
  min-height: 20px;
  margin: 8px 0 0;
  color: #8ee2a5;
  font-size: 12px;
  line-height: 1.8;
}

.dm-vlc-msg.error {
  color: #ff9b9b;
}

.dm-vlc-link {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #9aa1ad;
  font-family: monospace, monospace;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
  -webkit-user-select: all;
}

.dm-vlc-subs {
  margin-top: 12px;
  font-size: 12px;
  color: #9aa1ad;
}

.dm-vlc-subs[hidden] {
  display: none;
}

.dm-vlc-subs .list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.dm-vlc-subs .list a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e8e8e8;
  text-decoration: none;
  transition: 0.2s background;
  -webkit-transition: 0.2s background;
}

.dm-vlc-subs .list a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.dm-vlc-guide {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.dm-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.dm-tabs .tab {
  flex: 1;
  padding: 7px 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #9aa1ad;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s all;
  -webkit-transition: 0.2s all;
}

.dm-tabs .tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.dm-tab-body {
  padding: 12px 4px 0;
}

.dm-tab-body[hidden] {
  display: none;
}

.dm-tab-body ol {
  margin: 0;
  padding-right: 18px;
  color: #cfd3da;
  font-size: 13px;
  line-height: 2.1;
}

.dm-tab-body ol li {
  list-style: decimal;
}

.dm-tab-body b {
  color: #fff;
  font-weight: 600;
}

.dm-tab-body span[dir="ltr"] {
  display: inline-block;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
}

.dm-get-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #4fd1f0;
  font-size: 12px;
  text-decoration: none;
}

.dm-get-app:hover {
  color: #8be3f7;
}

/* تماشای گروهی */
.dm-party {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  width: 320px;
  max-height: calc(100vh - 190px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: rgba(21, 25, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: #e8e8e8;
  direction: rtl;
  opacity: 0;
  transform: translateX(15px);
  transition: 0.2s opacity, 0.2s transform;
  -webkit-transition: 0.2s opacity, 0.2s transform;
  overflow: hidden;
}

.dm-party[hidden] {
  display: none;
}

.dm-party.is-open {
  opacity: 1;
  transform: translateX(0);
}

.dm-party-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.dm-party-head .title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.dm-party-head .title i {
  color: #4fd1f0;
}

.dm-party-head .code {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-family: monospace, monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1px;
  direction: ltr;
}

.dm-party-head .code[hidden] {
  display: none;
}

.dm-party-head .btns button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #bbb;
  cursor: pointer;
}

.dm-party-head .btns button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dm-party-step {
  padding: 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3f4b transparent;
}

.dm-party-step[hidden] {
  display: none;
}

.dm-party-step .dm-btn + .dm-btn {
  margin-top: 8px;
}

.dm-party-desc {
  margin: 0 0 14px;
  color: #cfd3da;
  font-size: 13px;
  line-height: 2;
}

.dm-party-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -4px 0 14px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 183, 77, 0.08);
  color: #e9c48a;
  font-size: 12px;
  line-height: 1.9;
}

.dm-party-note i {
  margin-top: 4px;
  color: #ffb74d;
}

.dm-party-desc b {
  color: #4fd1f0;
  font-weight: 700;
}

.dm-party-or {
  position: relative;
  margin: 14px 0;
  text-align: center;
  font-size: 12px;
  color: #777e8b;
}

.dm-party-or::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.dm-party-or span {
  position: relative;
  padding: 0 10px;
  background: #171b24;
}

.dm-party-joinform,
.dm-party-share .row,
.dm-party-chat .send {
  display: flex;
  gap: 6px;
}

.dm-party input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: 0;
  box-sizing: border-box;
}

.dm-party input[type="text"]:focus {
  border-color: #1f7f9d;
}

.dm-party input[dir="ltr"] {
  font-family: monospace, monospace;
  text-align: left;
}

.dm-party-joinform input {
  text-transform: uppercase;
  letter-spacing: 2px;
}

.dm-party-joinform input::placeholder {
  letter-spacing: 0;
  text-align: right;
  direction: rtl;
  font-family: "iranyekan", tahoma, sans-serif;
}

.dm-party-share .row .dm-btn {
  min-height: 40px;
  padding: 0 12px;
}

.dm-party-switch {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.25);
}

.dm-party-switch[hidden] {
  display: none;
}

.dm-party-switch p {
  margin: 0 0 10px;
  color: #ffcc80;
  font-size: 12px;
}

.dm-party-share .label {
  display: block;
  margin-bottom: 6px;
  color: #9aa1ad;
  font-size: 12px;
}

.dm-party-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.dm-party-members .member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: #e8e8e8;
}

.dm-party-members .member .avatar {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #1f7f9d;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.dm-party-members .member.me .avatar {
  background: #5c6bc0;
}

.dm-party-members .member .fa-crown {
  color: #ffc107;
  font-size: 10px;
}

.dm-party-members .waiting {
  font-size: 12px;
  color: #777e8b;
  align-self: center;
}

.dm-party-note {
  margin: 10px 0 0;
  color: #777e8b;
  font-size: 11px;
}

.dm-party-chat {
  margin-top: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.dm-party-chat .messages {
  height: 150px;
  padding: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a3f4b transparent;
}

.dm-party-chat .messages:empty::before {
  content: "پیام های اتاق اینجا نمایش داده می شود";
  display: block;
  margin-top: 55px;
  text-align: center;
  font-size: 12px;
  color: #5d6370;
}

.dm-party-chat .msg {
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.9;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.dm-party-chat .msg b {
  margin-left: 5px;
  color: #4fd1f0;
  font-weight: 600;
}

.dm-party-chat .msg.me b {
  color: #9fa8da;
}

.dm-party-chat .msg span {
  color: #e8e8e8;
}

.dm-party-chat .send {
  padding: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-party-chat .send input[type="text"] {
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
}

.dm-party-chat .send button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #1f7f9d;
  color: #fff;
  cursor: pointer;
}

.dm-party-chat .send button i {
  transform: scaleX(-1);
}

.dm-party-leave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #ef9a9a;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.dm-party-leave:hover {
  background: rgba(244, 67, 54, 0.1);
}

.dm-party-pill {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  background: rgba(21, 25, 34, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  direction: rtl;
}

.dm-party-pill[hidden] {
  display: none;
}

.dm-party-pill i {
  color: #4fd1f0;
}

.dm-party-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5252;
}

.dm-party-pill .dot[hidden] {
  display: none;
}

/* پیام کوتاه */
.dm-player-toast {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 100000;
  max-width: calc(100% - 40px);
  padding: 9px 18px;
  border-radius: 30px;
  background: rgba(21, 25, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  text-align: center;
  direction: rtl;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: 0.25s opacity, 0.25s transform;
  -webkit-transition: 0.25s opacity, 0.25s transform;
}

.dm-player-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 600px) {
  .dm-modal {
    align-items: flex-end;
    padding: 0;
  }

  .dm-modal-box {
    max-width: 100%;
    max-height: 88vh;
    padding: 20px 16px;
    border-radius: 20px 20px 0 0;
  }

  .dm-vlc-actions {
    grid-template-columns: 1fr;
  }

  .dm-party {
    top: auto;
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
    max-height: 70vh;
    transform: translateY(15px);
  }

  .dm-party.is-open {
    transform: translateY(0);
  }

  .dm-party-pill {
    top: 70px;
    right: 10px;
  }

  .dm-party-chat .messages {
    height: 110px;
  }
}
