/* /home/hkiugcom/website.airplay/assets/audit/audit_table.css */
/* ------------------------------------------------------------
   Audit table – Mobile behaviour (≤ 639px)
------------------------------------------------------------ */
@media (max-width: 639px) {

  /* Yleinen rivistabiilisuus */
  #auditTable td,
  #auditTable th {
    vertical-align: top;
  }

  /* Yleinen cell-wrapper */
  #auditTable td .ap-td {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  /* Mono-fontit: estä baseline-hyppely */
  #auditTable td.mono {
    line-height: 1.15;
  }

  /* --------------------------------------------------------
     Last played / On Air -sarake (date + time stacked)
  -------------------------------------------------------- */
  #auditTable th.col-last,
  #auditTable td.col-last {
    width: clamp(56px, 18vw, 86px) !important;
    min-width: 0 !important;
  }

  #auditTable td.col-last {
    white-space: normal;
    line-height: 1.15;
  }

  /* Last-play sisältö kahdelle riville */
  #auditTable td.col-last .ap-td--last .ap-last-d,
  #auditTable td.col-last .ap-td--last .ap-last-t {
    display: block;
    line-height: 1.12;
  }

  #auditTable td.col-last .ap-td--last .ap-last-t {
    opacity: 0.92;
  }

  /* --------------------------------------------------------
     Track / title -solu
  -------------------------------------------------------- */
  #auditTable td.ap-td-track .ap-td--track {
    width: 100%;
    min-width: 0;
  }

  /* --------------------------------------------------------
     Teksticlampit (artist / title)
  -------------------------------------------------------- */
  .ap-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }

  .ap-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }
}

/* ------------------------------------------------------------
   Desktop (≥ 640px): Last-play yhdelle riville
------------------------------------------------------------ */
@media (min-width: 640px) {
  #auditTable td.col-last .ap-td--last {
    flex-direction: row;
    gap: 6px;
  }

  #auditTable td.col-last .ap-td--last .ap-last-d,
  #auditTable td.col-last .ap-td--last .ap-last-t {
    display: inline;
  }

  /* Artist desktop: keep single line + ellipsis */
  #auditTable td.col-artist .ap-td span{
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }
}

/* ------------------------------------------------------------
   Audit: keep impact icon pinned to the right in Track/Title cell
------------------------------------------------------------ */
#auditTable td.ap-td-track .ap-td--track {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

#auditTable td.ap-td-track .ap-track-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* The icon must not wrap below */
#auditTable td.ap-td-track .impact-icon {
  flex: 0 0 auto;
  margin-left: 8px;
}

#auditTable td.ap-td-track .ap-track-right{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   PERFORMANCE (2h) – bar
------------------------------------------------------------ */
.ap-perf-td { white-space: nowrap; }

.ap-perf-bar {
  width: 92px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  position: relative;
}

.ap-perf-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(170,185,200,0.22) 0%,
    rgba(170,185,200,0.35) 65%,
    rgba(250,204,21,0.18) 88%,
    rgba(250,204,21,0.34) 100%
  );
  box-shadow: 0 0 0 1px rgba(250,204,21,0.05) inset;
  transition: width 520ms cubic-bezier(.22,.92,.22,1);
}

/* Pienempi mobiilissa */
@media (max-width: 639px) {
  .ap-perf-bar { width: 76px; height: 9px; }
}

.ap-perf-td.ap-dur-onair .ap-onair-text {
  color: rgba(148,163,184,0.85);
}

.ap-showmix-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 8px;
  background: rgba(148,163,184,0.6);
  vertical-align: middle;
}

/* SHOW / MIX + timer (no extra layout width; timer overlays label) */
td.ap-perf-td.ap-showmix { white-space: nowrap; }

td.ap-perf-td.ap-showmix .ap-showmix-wrap {
  position: relative;
  display: inline-block;
}

td.ap-perf-td.ap-showmix .ap-showmix-label {
  display: inline-block;
  transition: opacity 220ms ease-in-out;
}

td.ap-perf-td.ap-showmix .ap-showmix-timer {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-block;
  opacity: 0;
  transition: opacity 850ms ease-in-out;
  pointer-events: none;
}

td.ap-perf-td.ap-showmix.ap-showmix--timer .ap-showmix-label { opacity: 0; }
td.ap-perf-td.ap-showmix.ap-showmix--timer .ap-showmix-timer { opacity: 1; }
