/* BravesCounselor Mobile + iPad Polish Patch
   Additive responsive layer. Safe to load after bravescounselor-ui.css.
*/

:root{
  --bc-touch:48px;
  --bc-ipad-max:1180px;
}

/* Better tap targets everywhere */
a, button, .bc-btn, input, select, textarea {
  -webkit-tap-highlight-color: rgba(242,201,76,.24);
}
button, .bc-btn, .bc-staffbar nav a, .bc-launcher a {
  min-height: 44px;
}

/* Smooth scroll containers */
.bc-table-wrap,
.pick-content,
.calendar,
.pick-sidebar {
  -webkit-overflow-scrolling: touch;
}

/* iPad / tablet comfort */
@media (min-width: 701px) and (max-width: 1180px) {
  .bc-wrap {
    max-width: var(--bc-ipad-max);
    padding: 28px 22px;
  }

  .bc-hero-grid {
    grid-template-columns: 1fr;
    max-width: 880px;
  }

  .bc-card-lg {
    padding: 30px;
  }

  .bc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bc-grid-tight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bc-staffbar {
    align-items: flex-start;
  }

  .bc-staffbar nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .bc-staffbar nav a {
    text-align: center;
  }
}

/* iPad landscape calendar tuning */
@media (min-width: 900px) and (max-width: 1366px) {
  .pick-wrap {
    padding: 14px;
  }

  .pick-main {
    grid-template-columns: 250px 1fr !important;
  }

  .pick-sidebar {
    padding: 18px !important;
  }

  .pick-content {
    padding: 18px !important;
  }

  .dayCard {
    padding: 12px 8px !important;
  }

  .dayCard .num {
    font-size: 26px !important;
  }

  .slotGrid {
    grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)) !important;
  }

  .slotBtn {
    padding: 12px 10px !important;
  }

  .slotBtn .time {
    font-size: 18px !important;
  }
}

/* Phone shell */
@media (max-width: 700px) {
  body {
    min-width: 0;
  }

  .bc-page-center {
    padding: 12px 10px 82px;
    align-items: flex-start;
  }

  .bc-wrap, .bc-wrap-wide {
    padding: 14px 10px 88px;
  }

  .bc-card,
  .bc-card-lg {
    border-radius: 20px;
    padding: 18px;
  }

  .bc-title-xl {
    font-size: 36px;
  }

  .bc-lead {
    font-size: 17px;
  }

  .bc-grid,
  .bc-grid-tight {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .bc-tile {
    padding: 18px;
    border-radius: 16px;
  }

  .bc-tile strong {
    font-size: 18px;
  }

  .bc-staffbar {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: -14px -10px 14px;
    border-radius: 0 0 18px 18px;
    border-left: 0;
    border-right: 0;
    backdrop-filter: blur(12px);
  }

  .bc-staffbar > div {
    width: 100%;
  }

  .bc-staffbar span {
    display: block;
    margin-left: 0;
    margin-top: 2px;
    font-size: 13px;
  }

  .bc-staffbar nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }

  .bc-staffbar nav a {
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
  }

  .bc-topline {
    margin-top: 8px;
  }

  .bc-badge {
    align-self: flex-start;
  }

  .bc-actions {
    position: relative;
  }

  input, select, textarea {
    font-size: 16px;
    min-height: var(--bc-touch);
  }

  textarea {
    min-height: 110px;
  }

  .bc-btn {
    min-height: var(--bc-touch);
    justify-content: center;
  }

  .bc-table-wrap {
    margin-left: -6px;
    margin-right: -6px;
    border-radius: 14px;
    overflow-x: auto;
  }

  .bc-table {
    min-width: 720px;
  }

  .bc-table th,
  .bc-table td {
    padding: 10px;
  }

  .bc-launcher {
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    max-width: calc(100vw - 20px);
    justify-content: center;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
  }

  .bc-launcher a {
    width: 46px;
    height: 46px;
  }

  .bc-launcher a span {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Student picker phone improvements */
@media (max-width: 700px) {
  .pick-wrap {
    padding: 0 !important;
  }

  .pick-shell {
    min-height: 100vh;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .pick-hero {
    padding: 20px 16px !important;
    border-radius: 0 0 24px 24px;
  }

  .pick-hero h1 {
    font-size: 31px !important;
  }

  .pick-hero p {
    font-size: 15px;
  }

  .pick-alert {
    width: 100%;
    min-width: 0 !important;
  }

  .pick-content {
    padding: 16px !important;
  }

  .weekHeader {
    gap: 10px !important;
  }

  .weekRange {
    font-size: 20px !important;
  }

  .weekNav {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .weekNav a {
    padding: 11px 8px !important;
    font-size: 13px;
  }

  .selectedPanel {
    padding: 16px !important;
    border-radius: 20px !important;
  }

  .selectedTop h2 {
    font-size: 23px !important;
  }

  .slotGroup h3 {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(10px);
    padding: 8px 0;
  }

  .slotBtn {
    min-height: 70px;
    border-radius: 18px !important;
  }

  .confirmBox {
    border-radius: 22px !important;
    padding: 22px !important;
  }

  .confirmActions {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .confirmActions button {
    width: 100%;
    min-height: 48px;
  }
}

/* Today Flow mobile action cards */
@media (max-width: 760px) {
  .datebar {
    display: grid !important;
    grid-template-columns: 1fr;
  }

  .datebar form {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr auto;
  }

  .actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
  }

  .actions form,
  .actions button {
    width: 100%;
  }

  .noteform {
    display: grid !important;
    grid-template-columns: 1fr;
  }
}

/* Drag/drop availability calendar mobile/iPad */
@media (max-width: 1180px) {
  .toolbar,
  .topbar {
    align-items: stretch !important;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .calendar {
    overflow: auto !important;
    display: block !important;
    white-space: nowrap;
    max-height: calc(100vh - 230px);
  }

  .calendar .head,
  .calendar .timecell,
  .calendar .cell {
    min-width: 132px;
  }

  .calendar .timecell {
    position: sticky;
    left: 0;
    z-index: 4;
  }
}

@media (max-width: 700px) {
  .calendar {
    max-height: calc(100vh - 250px);
    border-radius: 16px !important;
  }

  .calendar .head,
  .calendar .timecell,
  .calendar .cell {
    min-width: 118px;
    min-height: 46px;
  }

  .legend {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px !important;
  }

  .pill {
    justify-content: flex-start;
    font-size: 12px;
  }
}

/* Office display / kiosk scaling */
@media (max-width: 900px) {
  .display-wrap,
  .monitor-wrap,
  .office-display {
    padding: 12px !important;
  }
}

/* Print stays clean */
@media print {
  .bc-staffbar,
  .bc-launcher,
  .bc-footer-note,
  .bc-actions {
    display:none !important;
  }

  body {
    background:#fff !important;
    color:#000 !important;
  }

  .bc-card,
  .bc-card-lg,
  .bc-tile {
    box-shadow:none !important;
    border:1px solid #ccc !important;
  }
}
