/* ============================================================================
   mobile-responsive.css
   Purpose: make the desktop-locked Metronic (layout2) admin dashboard usable
            on phones/tablets. Presentation-only overrides. Loaded LAST so it
            wins the cascade over all theme CSS.
   Breakpoint: applies at <= 992px (phones + small tablets).
   Author: mobile-adaptation pass 2026-07
   ============================================================================ */

/* Never let content push the page sideways on any screen size. Fixed/off-canvas
   elements escape this because none of their ancestors use `transform`. */
html,
body {
  max-width: 100%;
}
.page-wrapper {
  overflow-x: hidden;
}

/* Off-canvas overlay element (added in topbar.blade.php). Hidden by default;
   fades in only when the sidebar is open on mobile. */
.mobile-sidebar-overlay {
  display: none;
}

/* Hamburger button (added in topbar.blade.php) is desktop-hidden. */
.mobile-hamburger-toggler {
  display: none;
}

/* ==========================================================================
   MOBILE / TABLET  (<= 992px)
   ========================================================================== */
@media (max-width: 992px) {

  /* ---- Compact fixed top bar: logo + hamburger --------------------------- */
  .page-header.navbar,
  .admin-page-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: 56px !important;
    min-height: 56px !important;
    background: var(--dark-color, #1a1b1e) !important;
    z-index: 10020;   /* above overlay + sidebar so logo/hamburger stay tappable */
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  }
  .page-header.navbar .page-header-inner {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 10px;
  }
  .page-header.navbar .page-logo,
  .admin-page-header-logo {
    height: 56px !important;
    background: transparent !important;
    width: auto !important;
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
  }
  .page-header.navbar .page-logo .logo-default {
    margin: 0 !important;
    width: auto !important;
    max-width: 150px;
    max-height: 34px;
    height: auto;
  }
  .admin-logo-title {
    display: none !important;
  }
  /* Hide the theme's own (broken) togglers; we ship our own hamburger. */
  .page-header.navbar .menu-toggler.sidebar-toggler,
  .page-header.navbar .menu-toggler.responsive-toggler {
    display: none !important;
  }

  /* ---- Our hamburger button --------------------------------------------- */
  .mobile-hamburger-toggler {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    margin-left: auto;
    flex: 0 0 auto;
    cursor: pointer;
    background: transparent;
    border: 0;
  }
  .mobile-hamburger-toggler span {
    display: block;
    height: 2px;
    width: 24px;
    background: #ffffff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }
  body.mobile-sidebar-open .mobile-hamburger-toggler span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  body.mobile-sidebar-open .mobile-hamburger-toggler span:nth-child(2) {
    opacity: 0;
  }
  body.mobile-sidebar-open .mobile-hamburger-toggler span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* ---- Content takes full width (no sidebar gutter) ---------------------- */
  .page-container.admin-page-container,
  .page-container {
    margin-top: 56px !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }
  .page-content-wrapper,
  .admin-page-content-wrapper {
    margin-left: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
  .page-content,
  .admin-page-content {
    margin-left: 0 !important;
    padding: 14px 12px !important;
    min-height: calc(100vh - 56px) !important;
  }

  /* ---- Off-canvas sidebar ------------------------------------------------ */
  .page-sidebar-wrapper {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    max-width: 82%;
    margin: 0 !important;
    background: var(--dark-color, #1a1b1e) !important;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 10010;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Bootstrap's .navbar-collapse.collapse hides the sidebar; force it visible
     so our off-canvas panel always renders (we control show/hide via transform). */
  .page-sidebar.navbar-collapse,
  .page-sidebar.navbar-collapse.collapse {
    display: block !important;
    height: 100% !important;
    max-height: none !important;
    padding-top: 56px;
    overflow: visible !important;
    float: none !important;
    width: 100% !important;
  }
  .page-sidebar-menu {
    height: auto !important;
    padding-top: 8px !important;
  }
  .page-sidebar-menu > li > a {
    padding: 14px 18px !important;   /* touch-friendly rows */
    font-size: 15px;
  }

  body.mobile-sidebar-open .page-sidebar-wrapper {
    transform: translateX(0);
    box-shadow: 2px 0 18px rgba(0, 0, 0, 0.45);
  }
  body.mobile-sidebar-open {
    overflow: hidden;   /* lock body scroll while menu is open */
  }

  .mobile-sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    z-index: 10005;
  }
  body.mobile-sidebar-open .mobile-sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }

  /* ---- Panels / portlets full width ------------------------------------- */
  .portlet {
    margin-bottom: 14px !important;
  }
  .portlet-body,
  .portlet.light > .portlet-body {
    padding: 12px !important;
  }
  [class*="col-md-"],
  [class*="col-lg-"] {
    padding-left: 8px;
    padding-right: 8px;
  }

  /* ---- Wide tables: horizontal scroll instead of blowing out layout ------ */
  /* DataTables already wraps <table> in .table-responsive; enforce scroll. */
  .table-responsive,
  .dataTables_scroll,
  .dataTables_scrollBody {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    max-width: 100%;
    border: 0;
  }
  /* Any bootstrap table (DataTable or plain) scrolls on its own axis. */
  .admin-page-content .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .admin-page-content .table th,
  .admin-page-content .table td {
    white-space: nowrap;
  }

  /* ---- DataTables controls: stacked & centered -------------------------- */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    text-align: center !important;
    width: 100%;
    margin: 8px 0 !important;
    white-space: normal;
  }
  .dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 8px 12px !important;   /* bigger tap targets */
    min-width: 40px;
  }
  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length select {
    width: auto;
    min-height: 40px;
  }
  /* Custom top search box is desktop-floated & 400px wide; go full width. */
  .admin-search-form {
    width: 100% !important;
    float: none !important;
    right: 0 !important;
    margin: 10px 0 !important;
    display: block;
  }

  /* ---- Forms: full-width, touch-friendly -------------------------------- */
  .admin-page-content .form-control,
  .admin-page-content select,
  .admin-page-content textarea,
  .admin-page-content input[type="text"],
  .admin-page-content input[type="email"],
  .admin-page-content input[type="password"],
  .admin-page-content input[type="number"],
  .admin-page-content input[type="date"],
  .admin-page-content input[type="search"],
  .admin-page-content input[type="tel"] {
    width: 100% !important;
    min-height: 44px;
    font-size: 16px;          /* prevents iOS zoom-on-focus */
    box-sizing: border-box;
  }
  .admin-page-content textarea {
    min-height: 96px;
  }
  .admin-page-content .form-group {
    margin-bottom: 14px;
  }
  /* Buttons: comfortable tap size; primary/action/submit buttons go full width. */
  .admin-page-content .btn {
    min-height: 44px;
    padding: 11px 16px;
  }
  .admin-page-content .form-group > .btn,
  .admin-page-content .form-actions .btn,
  .admin-page-content button[type="submit"].btn,
  .admin-page-content .admin-action-btn {
    display: block;
    width: 100%;
    margin: 6px 0 0 0;
  }
  /* Modals full-width with breathing room. */
  .modal-dialog {
    width: auto !important;
    margin: 12px !important;
  }

  /* ---- Login / auth screen ---------------------------------------------- */
  .user-login-5 .login-bg,
  .auth-left-bg {
    display: none !important;
  }
  .user-login-5 .login-container,
  .login-container {
    width: 100% !important;
    float: none !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .login-content {
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    padding: 24px 20px !important;
  }
  .login-content .auth-input,
  .login-content .form-control {
    width: 100% !important;
    min-height: 48px;
    font-size: 16px;
  }
  .login-content .btn,
  .login-content button[type="submit"] {
    width: 100%;
    min-height: 48px;
  }
}

/* ==========================================================================
   APPROVAL / REVIEW QUEUES — card layout (highest-priority mobile UX)
   The songs & buy/sell "waiting approval" screens are server-rendered
   DataTables. On mobile we CSS-transform each row into a self-contained
   review card: media prominent, metadata labelled, and a big touch-friendly
   Approve/Publish toggle (green) + Delete (red) at the bottom.
   Column labels are injected via ::before matched to the fixed <thead> order.
   ========================================================================== */
@media (max-width: 992px) {

  /* Un-scroll these specific tables and let them stack as cards. */
  #waitingapprovalsongs_table,
  #waitingapprovalsbuysells_table {
    display: block;
    white-space: normal !important;
    overflow-x: visible !important;
    background: transparent;
  }
  #waitingapprovalsongs_table thead,
  #waitingapprovalsbuysells_table thead {
    display: none !important;
  }
  #waitingapprovalsongs_table tbody,
  #waitingapprovalsbuysells_table tbody,
  #waitingapprovalsongs_table tr,
  #waitingapprovalsbuysells_table tr,
  #waitingapprovalsongs_table td,
  #waitingapprovalsbuysells_table td {
    display: block !important;
    width: 100% !important;
    white-space: normal !important;
  }
  #waitingapprovalsongs_table tr,
  #waitingapprovalsbuysells_table tr {
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin: 0 0 18px 0;
    padding: 14px 14px 6px 14px;
    overflow: hidden;
  }
  #waitingapprovalsongs_table td,
  #waitingapprovalsbuysells_table td {
    border: 0 !important;
    padding: 7px 2px !important;
    text-align: left !important;
    font-size: 14px;
    line-height: 1.35;
    word-break: break-word;
  }
  /* Field label from column header. */
  #waitingapprovalsongs_table td::before,
  #waitingapprovalsbuysells_table td::before {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9a9a9a;
    margin-bottom: 2px;
  }

  /* Prominent media at the top of each card. */
  #waitingapprovalsongs_table td img,
  #waitingapprovalsbuysells_table td img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 240px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
  }

  /* Long links shouldn't overflow the card. */
  #waitingapprovalsongs_table td a[target="_blank"],
  #waitingapprovalsbuysells_table td a[target="_blank"] {
    word-break: break-all;
  }

  /* ---- SONGS queue column labels (thead order) -------------------------- */
  #waitingapprovalsongs_table td:nth-of-type(2)::before  { content: "Title"; }
  #waitingapprovalsongs_table td:nth-of-type(3)::before  { content: "Author"; }
  #waitingapprovalsongs_table td:nth-of-type(4)::before  { content: "Image"; }
  #waitingapprovalsongs_table td:nth-of-type(5)::before  { content: "YouTube link"; }
  #waitingapprovalsongs_table td:nth-of-type(6)::before  { content: "Spotify link"; }
  #waitingapprovalsongs_table td:nth-of-type(7)::before  { content: "Posted by"; }
  #waitingapprovalsongs_table td:nth-of-type(8)::before  { content: "Group"; }
  #waitingapprovalsongs_table td:nth-of-type(9)::before  { content: "Date posted"; }
  #waitingapprovalsongs_table td:nth-of-type(10)::before { content: "Played"; }
  #waitingapprovalsongs_table td:nth-of-type(11)::before { content: "Likes"; }
  #waitingapprovalsongs_table td:nth-of-type(12)::before { content: "Rank"; }
  #waitingapprovalsongs_table td:nth-of-type(13)::before { content: "Shared"; }
  #waitingapprovalsongs_table td:nth-of-type(14)::before { content: "Approve / publish"; }
  #waitingapprovalsongs_table td:nth-of-type(15)::before { content: "Remove"; }

  /* ---- BUY/SELL queue column labels (thead order) ----------------------- */
  #waitingapprovalsbuysells_table td:nth-of-type(2)::before  { content: "Ad title"; }
  #waitingapprovalsbuysells_table td:nth-of-type(3)::before  { content: "Description"; }
  #waitingapprovalsbuysells_table td:nth-of-type(4)::before  { content: "Price"; }
  #waitingapprovalsbuysells_table td:nth-of-type(5)::before  { content: "Seats"; }
  #waitingapprovalsbuysells_table td:nth-of-type(6)::before  { content: "City"; }
  #waitingapprovalsbuysells_table td:nth-of-type(7)::before  { content: "Contact"; }
  #waitingapprovalsbuysells_table td:nth-of-type(8)::before  { content: "Image"; }
  #waitingapprovalsbuysells_table td:nth-of-type(9)::before  { content: "Group"; }
  #waitingapprovalsbuysells_table td:nth-of-type(10)::before { content: "Posted by"; }
  #waitingapprovalsbuysells_table td:nth-of-type(11)::before { content: "Date posted"; }
  #waitingapprovalsbuysells_table td:nth-of-type(12)::before { content: "Likes"; }
  #waitingapprovalsbuysells_table td:nth-of-type(13)::before { content: "Messages"; }
  #waitingapprovalsbuysells_table td:nth-of-type(14)::before { content: "Visits"; }
  #waitingapprovalsbuysells_table td:nth-of-type(15)::before { content: "Forwards"; }
  #waitingapprovalsbuysells_table td:nth-of-type(16)::before { content: "Approve / publish"; }

  /* ---- Big APPROVE toggle cell (green) ---------------------------------- */
  #waitingapprovalsongs_table td:nth-of-type(14),
  #waitingapprovalsbuysells_table td:nth-of-type(16) {
    background: #eef7ee;
    border: 1px solid #cfe8cf;
    border-radius: 12px;
    padding: 14px !important;
    margin-top: 10px;
    text-align: center !important;
  }
  #waitingapprovalsongs_table td:nth-of-type(14)::before,
  #waitingapprovalsbuysells_table td:nth-of-type(16)::before {
    color: #2b7a2b;
    font-size: 13px;
    margin-bottom: 8px;
  }
  /* Enlarge the Metronic .switch inside the approve cell for thumbs. */
  #waitingapprovalsongs_table td .switch,
  #waitingapprovalsbuysells_table td .switch {
    transform: scale(1.6);
    transform-origin: center;
    display: inline-block;
    margin: 6px 0;
  }

  /* ---- Big DELETE/REMOVE control (red) ---------------------------------- */
  #waitingapprovalsongs_table td:nth-of-type(15) {
    background: #fdeeee;
    border: 1px solid #f3cccc;
    border-radius: 12px;
    padding: 6px !important;
    margin-top: 10px;
    text-align: center !important;
  }
  #waitingapprovalsongs_table td:nth-of-type(15)::before {
    color: #b33636;
  }
  #waitingapprovalsongs_table td:nth-of-type(15) a.delete-btn,
  #waitingapprovalsongs_table td:nth-of-type(15) a {
    display: block;
    width: 100%;
    min-height: 48px;
    line-height: 30px;
    padding: 9px 0;
    color: #b33636 !important;
    font-size: 16px;
    font-weight: 600;
  }
  #waitingapprovalsongs_table td:nth-of-type(15) a i {
    margin-right: 6px;
  }
}
