/* Dawah media experience V18 */

.m18-directory {
  width: min(1500px, calc(100% - 32px));
  margin-inline: auto;
  padding: 24px 0 90px;
  color: #113c31;
}

.m18-directory * {
  box-sizing: border-box;
}

.m18-directory-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  min-height: 105px;
  padding: 19px 21px;
  border: 1px solid #dce5de;
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 90% 15%,
      rgba(215, 237, 170, 0.45),
      transparent 220px
    ),
    #fff;
  box-shadow: 0 13px 34px rgba(9, 54, 42, 0.055);
}

.m18-header-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #e9f1df;
  color: #15533f;
}

.m18-header-copy {
  min-width: 0;
}

.m18-header-copy > span,
.m18-results-header span {
  color: #647d63;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.m18-header-copy h1 {
  margin: 3px 0 4px;
  font-size: clamp(25px, 3vw, 35px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.m18-header-copy p {
  margin: 0;
  color: #6a7b73;
  font-size: 11px;
}

.m18-total {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.m18-total strong {
  font-size: 28px;
  line-height: 1;
}

.m18-total span {
  color: #66786f;
  font-size: 10px;
}

.m18-filters {
  display: grid;
  grid-template-columns:
    minmax(250px, 1.6fr)
    repeat(3, minmax(155px, 0.75fr))
    auto;
  gap: 7px;
  align-items: stretch;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid #dce5de;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(9, 54, 42, 0.045);
}

.m18-search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 52px;
  padding: 0 13px;
  border-radius: 11px;
  background: #f2f6f0;
}

.m18-search .ui-icon {
  width: 18px;
  color: #3f6a5b;
}

.m18-search input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 6px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #153f34;
  font-size: 14px;
  box-shadow: none;
}

.m18-filter {
  position: relative;
  display: flex;
  justify-content: center;
  flex-direction: column;
  min-width: 0;
  min-height: 52px;
  padding: 6px 11px;
  border: 1px solid #e0e7e1;
  border-radius: 11px;
  background: #fff;
}

.m18-filter > span {
  color: #6a7c72;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.m18-filter select {
  width: 100%;
  min-height: 29px;
  padding: 3px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #153f34;
  font-size: 12px;
  font-weight: 650;
}

.m18-live-status {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  padding: 7px 10px;
  color: #57704e;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.m18-live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #82b455;
  box-shadow: 0 0 0 4px #edf5df;
}

[data-m18-live-form][data-loading="true"] .m18-live-status i {
  background: #c49d3a;
  box-shadow: 0 0 0 4px #fff3d5;
}

.m18-submit {
  min-height: 43px;
  padding: 8px 15px;
  border: 0;
  border-radius: 10px;
  background: #0a4939;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

body.m18-live-enabled .m18-submit {
  display: none;
}

.m18-results {
  min-height: 220px;
  padding-top: 27px;
  transition: opacity 150ms ease;
}

.m18-results[aria-busy="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.m18-results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding-inline: 3px;
}

.m18-results-header h2 {
  margin: 4px 0 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.m18-results-header a {
  color: #426557;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.m18-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.m18-card {
  display: grid;
  grid-template-rows: 124px minmax(112px, auto) auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dae4dc;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(8, 50, 39, 0.045);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.m18-card:hover {
  transform: translateY(-3px);
  border-color: #b8ccbe;
  box-shadow: 0 17px 38px rgba(8, 50, 39, 0.09);
}

.m18-cover {
  position: relative;
  display: block;
  width: 100%;
  min-height: 124px;
  padding: 14px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.m18-cover.is-audio {
  background:
    radial-gradient(
      circle at 82% 14%,
      rgba(215, 241, 155, 0.32),
      transparent 105px
    ),
    linear-gradient(135deg, #073c30, #126149);
}

.m18-cover.is-video {
  background:
    radial-gradient(
      circle at 78% 12%,
      rgba(223, 240, 177, 0.27),
      transparent 115px
    ),
    linear-gradient(135deg, #102f28, #287154);
}

.m18-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255,255,255,.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.24) 1px, transparent 1px);
  background-size: 23px 23px;
}

.m18-cover-type {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,0.19);
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  font-size: 9px;
  font-weight: 750;
}

.m18-cover-type .ui-icon {
  width: 14px;
  height: 14px;
}

.m18-cover-play {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 13px;
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 50%;
  background: #ddf0a6;
  color: #084534;
  box-shadow: 0 9px 22px rgba(0,0,0,0.18);
  transition: transform 150ms ease;
}

.m18-cover:hover .m18-cover-play {
  transform: scale(1.08);
}

.m18-cover-play .ui-icon {
  width: 17px;
  height: 17px;
}

.m18-wave {
  position: absolute;
  right: 69px;
  bottom: 18px;
  display: flex;
  align-items: end;
  gap: 4px;
  height: 32px;
}

.m18-wave i {
  display: block;
  width: 4px;
  border-radius: 999px;
  background: #dff2aa;
}

.m18-wave i:nth-child(1) { height: 9px; }
.m18-wave i:nth-child(2) { height: 17px; }
.m18-wave i:nth-child(3) { height: 27px; }
.m18-wave i:nth-child(4) { height: 14px; }
.m18-wave i:nth-child(5) { height: 31px; }
.m18-wave i:nth-child(6) { height: 20px; }
.m18-wave i:nth-child(7) { height: 12px; }
.m18-wave i:nth-child(8) { height: 24px; }
.m18-wave i:nth-child(9) { height: 15px; }

.m18-video-symbol {
  position: absolute;
  right: 70px;
  bottom: 16px;
  color: rgba(224, 242, 176, 0.78);
}

.m18-video-symbol .ui-icon {
  width: 29px;
  height: 29px;
}

.m18-card-content {
  min-width: 0;
  padding: 15px 16px 10px;
}

.m18-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 20px;
  margin-bottom: 7px;
}

.m18-tags span {
  max-width: 145px;
  padding: 4px 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3e6;
  color: #597150;
  font-size: 7px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.m18-card-content h2 {
  margin: 0;
  overflow-wrap: anywhere;
  color: #103d31;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.m18-card-content p {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: #687970;
  font-size: 10px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.m18-card-footer {
  padding: 0 12px 12px;
}

.m18-card-footer button {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 17px;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 43px;
  padding: 6px 9px;
  border: 0;
  border-radius: 11px;
  background: #f0f5e9;
  color: #123f33;
  text-align: left;
  cursor: pointer;
}

.m18-card-footer button > span {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: #0a4c3b;
  color: #fff;
}

.m18-card-footer .ui-icon {
  width: 15px;
  height: 15px;
}

.m18-card-footer strong {
  font-size: 10px;
}

.m18-empty {
  display: grid;
  grid-template-columns: 47px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 108px;
  padding: 18px;
  border: 1px solid #dce5de;
  border-radius: 15px;
  background: #fff;
}

.m18-empty > span {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 12px;
  background: #edf3e5;
}

.m18-empty h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.m18-empty p {
  margin: 0;
  color: #6a7a72;
  font-size: 10px;
}

.m18-empty a,
.m18-pagination a {
  padding: 9px 13px;
  border-radius: 9px;
  background: #0a4939;
  color: #fff !important;
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
}

.m18-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding-top: 22px;
  color: #65776e;
  font-size: 10px;
}

/* Persistent bottom player */

.m18-player[hidden],
.m18-player [hidden] {
  display: none !important;
}

.m18-player {
  position: fixed;
  z-index: 500;
  right: 12px;
  bottom: 10px;
  left: 12px;
  color: #123d32;
  pointer-events: none;
}

.m18-player-panel,
.m18-player-dock,
.m18-player-message {
  pointer-events: auto;
}

.m18-player-panel {
  width: min(720px, calc(100vw - 24px));
  max-height: 0;
  margin: 0 auto;
  overflow: hidden;
  border: 0 solid #d4e0d7;
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -20px 55px rgba(5, 41, 31, 0.18);
  opacity: 0;
  transform: translateY(15px);
  transition:
    max-height 230ms ease,
    opacity 180ms ease,
    transform 230ms ease,
    border-width 180ms ease;
}

.m18-player.is-expanded .m18-player-panel {
  max-height: min(68vh, 560px);
  border-width: 1px;
  opacity: 1;
  transform: translateY(0);
}

.m18-player-video {
  background: #03110d;
}

.m18-player-video video,
.m18-player-video [data-youtube-frame] {
  display: block;
  width: 100%;
  max-height: min(57vh, 470px);
  aspect-ratio: 16 / 9;
  background: #000;
}

.m18-player-video video {
  object-fit: contain;
}

.m18-player-video [data-youtube-frame] {
  position: relative;
}

.m18-player-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.m18-player-video > a {
  display: flex;
  justify-content: center;
  min-height: 38px;
  padding: 10px;
  background: #0a3d30;
  color: #fff !important;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.m18-player-audio {
  position: relative;
  display: flex;
  align-items: center;
  gap: 17px;
  min-height: 190px;
  padding: 28px;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 87% 15%,
      rgba(220, 242, 163, 0.28),
      transparent 170px
    ),
    linear-gradient(135deg, #073c30, #126149);
  color: #fff;
}

.m18-player-audio::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px);
  background-size: 27px 27px;
}

.m18-player-art,
.m18-player-audio > div,
.m18-player-wave {
  position: relative;
  z-index: 1;
}

.m18-player-art {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #def1a7;
  color: #084534;
  box-shadow: 0 13px 30px rgba(0,0,0,0.2);
}

.m18-player-art svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.m18-player-audio > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 5px;
}

.m18-player-audio > div > span {
  color: #cce0d2;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.m18-player-audio > div strong {
  overflow: hidden;
  font-size: 21px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m18-player-audio > div small {
  color: #d5e3da;
  font-size: 11px;
}

.m18-player-wave {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 53px;
}

.m18-player-wave i {
  display: block;
  width: 5px;
  border-radius: 999px;
  background: #dff2aa;
}

.m18-player-wave i:nth-child(1) { height: 14px; }
.m18-player-wave i:nth-child(2) { height: 34px; }
.m18-player-wave i:nth-child(3) { height: 22px; }
.m18-player-wave i:nth-child(4) { height: 47px; }
.m18-player-wave i:nth-child(5) { height: 29px; }
.m18-player-wave i:nth-child(6) { height: 40px; }
.m18-player-wave i:nth-child(7) { height: 18px; }
.m18-player-wave i:nth-child(8) { height: 32px; }

.m18-player.is-playing .m18-player-wave i {
  animation: m18Wave 800ms ease-in-out infinite alternate;
}

@keyframes m18Wave {
  to {
    height: 9px;
    opacity: 0.55;
  }
}

.m18-player-dock {
  display: grid;
  grid-template-columns:
    44px
    minmax(150px, 0.85fr)
    minmax(240px, 1.7fr)
    minmax(100px, 0.45fr)
    auto
    38px
    38px
    38px;
  gap: 10px;
  align-items: center;
  width: min(1500px, 100%);
  min-height: 65px;
  margin: 0 auto;
  padding: 9px 11px;
  border: 1px solid rgba(11, 65, 50, 0.15);
  border-radius: 17px;
  background: rgba(255,255,255,0.975);
  box-shadow:
    0 15px 50px rgba(4, 39, 29, 0.2),
    0 3px 10px rgba(4, 39, 29, 0.08);
  backdrop-filter: blur(20px);
}

.m18-main-play,
.m18-dock-button {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.m18-main-play {
  width: 43px;
  height: 43px;
  border-radius: 50%;
  background: #094b3a;
  color: #fff;
}

.m18-main-play svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.m18-pause-icon {
  display: none;
}

.m18-player.is-playing .m18-play-icon {
  display: none;
}

.m18-player.is-playing .m18-pause-icon {
  display: block;
}

.m18-now-playing {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.m18-now-playing > span {
  color: #668075;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.m18-now-playing strong,
.m18-now-playing small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m18-now-playing strong {
  font-size: 12px;
}

.m18-now-playing small {
  color: #687a71;
  font-size: 9px;
}

.m18-progress-area {
  display: grid;
  grid-template-columns: 35px minmax(80px, 1fr) 35px;
  gap: 7px;
  align-items: center;
  color: #6c7d74;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.m18-progress-area input,
.m18-volume input {
  width: 100%;
  accent-color: #0b5944;
}

.m18-volume {
  display: grid;
  grid-template-columns: 17px minmax(55px, 1fr);
  gap: 6px;
  align-items: center;
}

.m18-volume svg,
.m18-dock-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.m18-speed {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #687a71;
  font-size: 8px;
}

.m18-speed select {
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid #d8e2da;
  border-radius: 9px;
  background: #f3f7f1;
  color: #153f33;
  font-size: 10px;
}

.m18-dock-button {
  width: 37px;
  height: 37px;
  border-radius: 10px;
  background: #f0f5ed;
  color: #315d4e;
}

.m18-player.is-expanded [data-player-expand] svg {
  transform: rotate(180deg);
}

.m18-player-message {
  width: min(720px, calc(100% - 20px));
  margin: 5px auto 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff4d5;
  color: #755b17;
  font-size: 9px;
  text-align: center;
}

.m18-player-message:empty {
  display: none;
}

body.has-m18-player {
  padding-bottom: 88px;
}

/* Tablet */

@media (max-width: 1050px) {
  .m18-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .m18-filters {
    grid-template-columns:
      minmax(240px, 1.5fr)
      repeat(2, minmax(145px, 0.75fr));
  }

  .m18-player-dock {
    grid-template-columns:
      44px minmax(135px, 1fr) minmax(180px, 1.5fr)
      auto 38px 38px 38px;
  }

  .m18-volume {
    display: none;
  }
}

/* Mobile */

@media (max-width: 720px) {
  .m18-directory {
    width: calc(100% - 20px);
    padding-top: 12px;
  }

  .m18-directory-header {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-height: 84px;
    padding: 13px;
    border-radius: 15px;
  }

  .m18-header-icon {
    width: 39px;
    height: 39px;
  }

  .m18-header-copy h1 {
    font-size: 23px;
  }

  .m18-header-copy p {
    display: none;
  }

  .m18-total span {
    display: none;
  }

  .m18-total strong {
    font-size: 22px;
  }

  .m18-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 6px;
  }

  .m18-search {
    grid-column: 1 / -1;
    min-height: 47px;
  }

  .m18-filter {
    min-height: 50px;
  }

  .m18-live-status {
    justify-content: center;
  }

  .m18-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .m18-card {
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-rows: minmax(128px, auto) auto;
  }

  .m18-cover {
    grid-row: 1 / 3;
    min-height: 100%;
  }

  .m18-cover-type {
    padding: 5px 7px;
    font-size: 7px;
  }

  .m18-wave,
  .m18-video-symbol {
    display: none;
  }

  .m18-cover-play {
    right: 50%;
    bottom: 15px;
    transform: translateX(50%);
  }

  .m18-cover:hover .m18-cover-play {
    transform: translateX(50%);
  }

  .m18-card-content {
    min-height: 90px;
    padding: 13px 12px 7px;
  }

  .m18-card-content h2 {
    font-size: 16px;
  }

  .m18-card-footer {
    padding: 0 9px 9px;
  }

  .m18-empty {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .m18-empty > a {
    grid-column: 1 / -1;
    text-align: center;
  }

  .m18-player {
    right: 7px;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    left: 7px;
  }

  .m18-player-panel {
    width: 100%;
    border-radius: 17px 17px 0 0;
  }

  .m18-player.is-expanded .m18-player-panel {
    max-height: 60vh;
  }

  .m18-player-audio {
    min-height: 150px;
    padding: 20px;
  }

  .m18-player-art {
    width: 60px;
    height: 60px;
  }

  .m18-player-wave {
    display: none;
  }

  .m18-player-audio > div strong {
    font-size: 17px;
  }

  .m18-player-dock {
    grid-template-columns:
      40px minmax(0, 1fr) 37px 37px;
    gap: 7px;
    min-height: 61px;
    padding: 8px;
    border-radius: 15px;
  }

  .m18-main-play {
    width: 39px;
    height: 39px;
  }

  .m18-progress-area,
  .m18-volume,
  .m18-speed,
  [data-player-pip] {
    display: none !important;
  }

  .m18-now-playing > span {
    display: none;
  }

  .m18-now-playing strong {
    font-size: 11px;
  }

  .m18-now-playing small {
    font-size: 8px;
  }

  body.has-m18-player {
    padding-bottom: 145px;
  }
}

@media (max-width: 390px) {
  .m18-filters {
    grid-template-columns: 1fr;
  }

  .m18-search {
    grid-column: 1;
  }

  .m18-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .m18-card,
  .m18-cover-play,
  .m18-player-panel,
  .m18-player-wave i {
    transition: none !important;
    animation: none !important;
  }
}