
/* Mobile-only responsive overrides for RadioDJ plugin
   These rules apply only to viewports 768px and narrower and are designed
   to preserve desktop styles unchanged.
*/
@media (max-width: 900px) {

  /* Make plugin containers adapt to device width */
  .radiodj, .radiodj-player, .radiodj-container, .rdj-container, .radiodj-wrapper, .radiodj-widget, .radiodj-embed {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: visible !important;
  }

  /* Images, iframes and embeds scale down */
  .radiodj img, .radiodj-player img, img.radiodj, .radiodj iframe, .radiodj object, .radiodj embed, .radiodj video {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* Make iframes responsive */
  .radiodj iframe, .radiodj-player iframe {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9;
  }

  /* Buttons and controls stack and become tappable */
  .radiodj .button, .radiodj button, .radiodj .rdj-button, .radiodj .controls button, .radiodj .controls {
    display: block !important;
    width: 100% !important;
    margin: 6px 0 !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
    padding: 12px 14px !important;
  }

  /* Make lists, info and text wrap nicely */
  .radiodj .rdj-meta, .radiodj .rdj-info, .radiodj .rdj-track, .radiodj .track-info {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  /* Tables scroll horizontally rather than break layout */
  .radiodj table, .radiodj-player table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Convert flex rows to stacked columns if necessary */
  .radiodj, .radiodj-player, .radiodj .flex, .radiodj .rdj-flex, .radiodj .rdj-row {
    display: block !important;
  }
  .radiodj .flex > *, .radiodj .rdj-flex > *, .radiodj .rdj-row > * {
    display: block !important;
    width: 100% !important;
    margin-bottom: 8px !important;
  }

  /* Increase touch target area for small controls */
  .radiodj .control, .radiodj .toggle, .radiodj .playpause {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 8px !important;
  }

  /* Reduce font sizes slightly to avoid overflow but keep readability */
  .radiodj, .radiodj-player, .radiodj * {
    font-size: 15px !important;
    line-height: 1.3 !important;
  }

  /* Minor spacing adjustments for mobile */
  .radiodj .rdj-header, .radiodj .rdj-footer {
    padding: 8px !important;
  }

  /* Ensure no fixed-width elements push layout offscreen */
  [style*="width:"] {
    max-width: 100% !important;
  }
}



/* --- v2 update: improved mobile table and form responsiveness --- */
@media (max-width: 900px) {

  /* Make table horizontally scrollable */
  .radiodj table, .radiodj-player table, .rdj-table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-collapse: collapse !important;
  }

  /* Prevent text from squishing */
  .radiodj table td, .radiodj table th, .rdj-table td, .rdj-table th {
    white-space: nowrap !important;
    padding: 8px 10px !important;
  }

  /* Ensure search form adapts */
  .radiodj form, .rdj-form {
    display: block !important;
    width: 100% !important;
  }

  .radiodj form input[type="text"], .rdj-form input[type="text"],
  .radiodj form select, .rdj-form select {
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 8px !important;
    font-size: 16px !important;
  }

  .radiodj form input[type="submit"], .rdj-form input[type="submit"],
  .radiodj form button, .rdj-form button {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
    padding: 12px 14px !important;
  }

  /* Slightly larger touch targets and spacing */
  .radiodj table tr {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .radiodj table td {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
}
/* --- end v2 update --- */