/* ==========================================================================
   Jobnest — AI Coach mobile polish
   - Make "View Previous Sessions" button look proper
   - Show the sessions panel as a slide-in drawer on mobile instead of hiding it
   ========================================================================== */

@media (max-width: 768px) {

  /* ---------- Polished "View Previous Sessions" button ---------- */
  #btn-view-sessions {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px !important;
    background: linear-gradient(135deg, rgba(26,110,245,.18), rgba(0,212,255,.12)) !important;
    border: 1px solid rgba(0,212,255,.4) !important;
    color: var(--cyan) !important;
    border-radius: 100px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    min-height: 42px !important;
    cursor: pointer;
    transition: transform .15s ease, background .2s ease;
  }
  #btn-view-sessions:active {
    transform: scale(.97);
    background: linear-gradient(135deg, rgba(26,110,245,.28), rgba(0,212,255,.2)) !important;
  }
  #btn-view-sessions::before { content: "📋"; font-size: 14px; }

  /* ---------- Make the sessions panel visible on mobile ---------- */
  /* Originally hidden via `.coach-wrap.has-session .coach-l { display:none }`.
     Override so it slides down as a drawer inside the same page. */
  .coach-wrap.has-session .coach-l,
  #coach-app.has-session .coach-l {
    display: flex !important;
    position: fixed !important;
    top: 112px !important;  /* below top bar + some space */
    left: 12px !important;
    right: 12px !important;
    max-height: 70vh !important;
    z-index: 500 !important;
    background: var(--navy2) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    padding: 14px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 20px 50px rgba(0,0,0,.6);
    animation: jnSlideDown .28s cubic-bezier(.4, 0, .2, 1);
    flex-direction: column;
    gap: 6px;
  }
  @keyframes jnSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Backdrop behind the drawer — tap to close */
  .coach-wrap.has-session::before,
  #coach-app.has-session::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(2px);
    z-index: 499;
    animation: jnFade .25s ease;
  }
  @keyframes jnFade { from { opacity: 0; } to { opacity: 1; } }

  /* Sessions list items inside the drawer */
  .coach-wrap.has-session .coach-l .new-session-btn,
  #coach-app.has-session .coach-l .new-session-btn {
    width: 100%;
    padding: 11px 16px !important;
    background: linear-gradient(135deg, var(--blue), var(--cyan)) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 100px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    margin-bottom: 10px !important;
    cursor: pointer;
  }

  /* Close-drawer hint label */
  .coach-wrap.has-session .coach-l::before,
  #coach-app.has-session .coach-l::before {
    content: "Previous sessions — tap outside to close";
    display: block;
    font-size: 10.5px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: .3px;
  }

  /* Session list items visual tweak */
  #coach-session-list > * {
    padding: 10px 12px !important;
    border-radius: 10px !important;
    margin-bottom: 6px !important;
  }
}
