/* ============================================================
   MODAL STYLES — Quds Radio
   Covers: media-modal (video / image / gallery),
           programsTableModal, shareModal
   ============================================================ */

/* ─── Shared backdrop ───────────────────────────────────────── */
.modal-backdrop.show {
  opacity: 0.7;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ─── Entrance animation ────────────────────────────────────── */
.modal.fade .modal-dialog {
  transform: translateY(32px) scale(0.96);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.36, 0.64, 1),
              opacity  0.28s ease;
}

.modal.show .modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* ─── Base modal card ───────────────────────────────────────── */
.modal-content {
  background-color: var(--white);
  border: none;
  border-radius: 1.4rem;
  box-shadow:
    0 2px  4px rgba(7, 97, 124, 0.04),
    0 8px 24px rgba(7, 97, 124, 0.12),
    0 32px 72px rgba(7, 97, 124, 0.18);
  overflow: hidden;
}

body.dark .modal-content {
  background-color: #101d26;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.modal-header {
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: none;
  position: relative;
}

.modal-footer {
  border-top: 1px solid var(--gray);
  padding: 1rem 1.6rem;
}

body.dark .modal-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* ─── Shared close button ───────────────────────────────────── */
.modal .btn-close {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(7, 97, 124, 0.10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 01.293 14.293L6.586 8 .293 1.707A1 1 0 01.293.293z' fill='%2307617c'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 1;
  transition: background-color 0.2s ease, transform 0.25s ease;
  flex-shrink: 0;
  cursor: pointer;
  filter: none !important;
}

.modal .btn-close:hover {
  background-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 01.293 14.293L6.586 8 .293 1.707A1 1 0 01.293.293z' fill='white'/%3E%3C/svg%3E");
  transform: rotate(90deg);
}

body.dark .modal .btn-close {
  background-color: rgba(255, 255, 255, 0.10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 01.293 14.293L6.586 8 .293 1.707A1 1 0 01.293.293z' fill='%237ecfea'/%3E%3C/svg%3E");
}

body.dark .modal .btn-close:hover {
  background-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 01.293 14.293L6.586 8 .293 1.707A1 1 0 01.293.293z' fill='white'/%3E%3C/svg%3E");
}

/* ─── Responsive base ───────────────────────────────────────── */
.modal-dialog,
.modal-content {
  max-width: 40vw;
}

@media (max-width: 1376px) {
  .modal-dialog,
  .modal-content { max-width: 60vw; }
}

@media (max-width: 992px) {
  .modal-dialog,
  .modal-content { max-width: 90vw; }
  .days-tabs { flex-wrap: wrap; }
}

/* ============================================================
   MEDIA MODAL  (video / image / infographic / gallery)
   ============================================================ */
.media-modal .modal-dialog {
  max-width: min(94vw, 1020px);
}

.media-modal .modal-content {
  max-width: 100%;
  background: #ffffff;
  border-radius: 1.4rem;
}

body.dark .media-modal .modal-content {
  background: #0f1d27;
}

/* Decorative top-bar accent */
.media-modal .modal-content::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Header */
.media-modal .modal-header {
  padding: 1.3rem 1.6rem 0.9rem;
  gap: 1rem;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(7,97,124,0.04) 0%, rgba(200,131,25,0.03) 100%);
  border-bottom: 1px solid rgba(7, 97, 124, 0.08);
}

body.dark .media-modal .modal-header {
  background: rgba(255,255,255,0.02);
  border-bottom-color: rgba(255,255,255,0.06);
}

/* Tag badge */
.media-modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.9rem;
  border-radius: 999px;
  background: rgba(7, 97, 124, 0.10);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  border: 1px solid rgba(7, 97, 124, 0.15);
}

body.dark .media-modal-tag {
  background: rgba(7, 97, 124, 0.25);
  color: #7ecfea;
  border-color: rgba(7, 97, 124, 0.4);
}

/* Title */
.media-modal .modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--black);
  line-height: 1.4;
  margin: 0;
}

body.dark .media-modal .modal-title {
  color: #e8f4f8;
}

/* Description */
.media-modal-description {
  color: var(--sub-gray);
  font-size: 0.86rem;
  line-height: 1.6;
  margin-top: 0.3rem !important;
  max-width: 42rem;
}

/* Body */
.media-modal .modal-body {
  padding: 1rem 1.2rem 1.4rem;
}

/* ── Video ── */
.media-modal-video {
  width: 100%;
  max-height: 70vh;
  border-radius: 1rem;
  background: #000;
  display: block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.media-modal .plyr {
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.media-modal .plyr--video { background: #000; }
.media-modal .plyr__controls { border-radius: 0 0 1rem 1rem; }

/* ── Image / Infographic ── */
.media-modal-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48vh;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(7,97,124,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(200,131,25,0.06) 0%, transparent 60%),
    var(--primary-light);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

body.dark .media-modal-image-wrap {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(7,97,124,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(200,131,25,0.08) 0%, transparent 60%),
    rgba(255,255,255,0.03);
}

.media-modal-image {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 0.85rem;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.08),
    0 20px 56px rgba(7, 97, 124, 0.18);
  background: #fff;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.media-modal-image:hover { transform: scale(1.01); }

body.dark .media-modal-image {
  background: #12232e;
  box-shadow: 0 20px 56px rgba(0,0,0,0.55);
}

/* ── Gallery / Album ── */
.media-modal-gallery,
.media-modal-slide {
  width: 100%;
}

.media-modal-gallery {
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
}

.media-modal-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080d11;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  min-height: 38vh;
}

.media-modal-slide img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.media-modal-slide img:hover { transform: scale(1.015); }

.media-modal-pagination {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.media-modal-pagination .swiper-pagination-bullet {
  background: rgba(255,255,255,0.45);
  width: 8px;
  height: 8px;
  opacity: 1;
  transition: all 0.25s ease;
}

.media-modal-pagination .swiper-pagination-bullet-active {
  background: var(--accent);
  width: 22px;
  border-radius: 4px;
}

/* ============================================================
   PROGRAMS TABLE MODAL
   ============================================================ */
#programsTableModal .modal-dialog {
  max-width: min(92vw, 700px);
}

#programsTableModal .modal-content {
  background: var(--white);
}

body.dark #programsTableModal .modal-content {
  background: #0f1d27;
}

#programsTableModal .modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, #0a8eae 100%);
  padding: 1.2rem 1.6rem;
  border-radius: 1.4rem 1.4rem 0 0;
  position: relative;
}

#programsTableModal .modal-title {
  color: #fff !important;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  width: 100%;
  margin: 0;
}

#programsTableModal .btn-close {
  position: absolute;
  top: -14px;
  left: -14px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  font-size: 0.65rem;
  padding: 0;
  border-radius: 50%;
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 01.293 14.293L6.586 8 .293 1.707A1 1 0 01.293.293z' fill='white'/%3E%3C/svg%3E");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
  border: 2.5px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 5;
}

#programsTableModal .btn-close:hover {
  background-color: #a56c12;
  transform: rotate(90deg);
}

body.dark #programsTableModal .btn-close {
  background-color: var(--accent);
  border-color: #0f1d27;
}

/* Days tabs */
.days-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  list-style-type: none;
  border: none;
  padding: 0;
}

.day-tab .nav-link {
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  background-color: var(--primary-light);
  color: var(--sub-gray);
  transition: all 0.22s ease;
  font-weight: 500;
  border: 1.5px solid transparent;
}

.day-tab .nav-link:hover {
  color: var(--primary) !important;
  border-color: rgba(7, 97, 124, 0.35);
  font-weight: unset;
}

.day-tab .nav-link.active {
  background-color: var(--primary);
  color: var(--white) !important;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(7, 97, 124, 0.32);
}

body.dark .day-tab .nav-link {
  background-color: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.55);
}

body.dark .day-tab .nav-link:hover {
  color: #7ecfea !important;
  border-color: rgba(126, 207, 234, 0.35);
}

body.dark .day-tab .nav-link.active {
  color: #fff !important;
}

/* Programs table */
.programs-content {
  border: 1px solid var(--gray);
  border-radius: 0.85rem;
  max-height: 270px;
  overflow-y: auto;
  font-size: 0.82rem;
}

body.dark .programs-content {
  border-color: rgba(255,255,255,0.1);
}

.programs-content::-webkit-scrollbar { width: 4px; }
.programs-content::-webkit-scrollbar-track { background: transparent; }
.programs-content::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}

.programs-content thead {
  position: sticky;
  top: 0;
  font-size: 0.85rem;
  background-color: var(--primary-light);
  color: var(--primary) !important;
  font-weight: 700;
  z-index: 1;
}

body.dark .programs-content thead {
  background-color: rgba(7,97,124,0.22);
  color: #7ecfea !important;
}

.table > :not(caption) > * > * {
  border-bottom: 1px solid var(--gray) !important;
}

body.dark .table > :not(caption) > * > * {
  border-bottom-color: rgba(255,255,255,0.07) !important;
  color: rgba(255,255,255,0.78) !important;
}

.programs-content tbody tr {
  transition: background 0.15s ease;
}

.programs-content tbody tr:hover {
  background-color: rgba(7, 97, 124, 0.04);
}

body.dark .programs-content tbody tr:hover {
  background-color: rgba(255,255,255,0.035);
}

.programs-content tbody tr td {
  vertical-align: middle;
  border: none !important;
  position: relative;
  padding: 0.6rem 0.85rem;
}

.programs-content tbody tr td:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%; left: 0;
  transform: translateY(-50%);
  height: 58%;
  width: 1px;
  background-color: var(--gray);
}

body.dark .programs-content tbody tr td:not(:last-child)::after {
  background-color: rgba(255,255,255,0.08);
}

.avatar-img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-light);
}

/* ============================================================
   SHARE MODAL
   ============================================================ */
#shareModal .modal-dialog {
  max-width: min(92vw, 440px);
}

#shareModal .modal-content {
  border-radius: 1.4rem;
}

#shareModal .modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, #0a8eae 100%);
  border-radius: 1.4rem 1.4rem 0 0;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#shareModal .modal-title {
  color: #fff !important;
  font-size: 1rem;
  font-weight: 700;
}

#shareModal .btn-close {
  background-color: rgba(255,255,255,0.2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 01.293 14.293L6.586 8 .293 1.707A1 1 0 01.293.293z' fill='white'/%3E%3C/svg%3E");
}

#shareModal .btn-close:hover {
  background-color: rgba(255,255,255,0.35);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 01.293 14.293L6.586 8 .293 1.707A1 1 0 01.293.293z' fill='white'/%3E%3C/svg%3E");
}

#shareModal .modal-body { padding: 1.5rem; }

#shareModal .form-control {
  border-radius: 0.7rem;
  border: 1.5px solid var(--gray);
  font-size: 0.85rem;
  direction: ltr;
  text-align: left;
  padding: 0.6rem 0.9rem;
  background-color: var(--primary-light);
  color: var(--black);
  transition: border-color 0.2s, box-shadow 0.2s;
}

#shareModal .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 97, 124, 0.12);
}

body.dark #shareModal .form-control {
  background-color: rgba(255,255,255,0.05);
  color: #e8f4f8;
  border-color: rgba(255,255,255,0.12);
}

#shareModal .share-social-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

#shareModal .share-social-icons .list-inline-item {
  background-color: var(--primary-light);
  border-radius: 50%;
  padding: 0.55rem;
  cursor: pointer;
  transition: all 0.22s ease;
  border: 1.5px solid transparent;
}

#shareModal .share-social-icons .list-inline-item:hover {
  background-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(7,97,124,0.28);
}

#shareModal .share-social-icons .list-inline-item:hover svg path {
  fill: #fff;
}

#shareModal .modal-footer {
  padding: 0.75rem 1.5rem 1.25rem;
}

.copy-btn,
#copyLinkBtn {
  background: linear-gradient(135deg, var(--primary) 0%, #0a8eae 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.5rem 1.8rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 16px rgba(7, 97, 124, 0.35);
}

.copy-btn:hover,
#copyLinkBtn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(7, 97, 124, 0.45);
}

/* ─── Mobile tweaks ─────────────────────────────────────────── */
@media (max-width: 767px) {
  #programsTableModal .btn-close {
    position: absolute;
    top: -12px;
    left: -12px;
  }

  .media-modal .modal-header { padding: 1rem 1rem 0.65rem; }
  .media-modal .modal-body   { padding: 0.5rem 0.75rem 1rem; }

  .media-modal-image-wrap {
    min-height: 34vh;
    padding: 0.75rem;
  }

  .media-modal-image,
  .media-modal-video,
  .media-modal-slide img {
    max-height: 56vh;
  }

  .media-modal .modal-dialog    { margin: 0.5rem auto; }
  #shareModal .modal-dialog,
  #programsTableModal .modal-dialog { margin: 0.6rem auto; }
}
