/* ============================================================================
   OnTheRota — app pages styles (signup, login, dashboards)
   Layered on top of styles.css. Keep brand-consistent.
   ============================================================================ */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--slate-50);
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ----- Auth pages (centered card layout) ----- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(180deg, var(--white) 0%, var(--slate-50) 100%);
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  width: 100%;
  max-width: 460px;
}

.auth-card .brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-decoration: none;
}
.auth-card .brand .accent { color: var(--teal); }

.auth-card h1 {
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.auth-card .subtitle {
  font-size: 0.96rem;
  color: var(--slate-500);
  margin: 0 0 28px;
}

.auth-card .form-field { margin-bottom: 16px; }
.auth-card .form-field label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}
.auth-card .form-field input,
.auth-card .form-field select,
.auth-card .form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.96rem;
  color: var(--slate-900);
  background: var(--white);
  transition: border-color 0.15s ease;
}
.auth-card .form-field input:focus,
.auth-card .form-field select:focus,
.auth-card .form-field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.auth-card .form-field .hint {
  font-size: 0.82rem;
  color: var(--slate-500);
  margin-top: 4px;
}

.auth-card .form-submit {
  width: 100%;
  margin-top: 8px;
  padding: 13px 22px;
}

.auth-card .auth-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--slate-200);
  font-size: 0.9rem;
  color: var(--slate-500);
  text-align: center;
}
.auth-card .auth-foot a { color: var(--teal); font-weight: 600; }

.auth-message {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  margin-bottom: 16px;
}
.auth-message.error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}
.auth-message.success {
  background: var(--teal-tint);
  color: var(--teal-deep);
  border: 1px solid var(--teal);
}
.auth-message.info {
  background: #EFF6FF;
  color: #1E3A8A;
  border: 1px solid #BFDBFE;
}

/* ----- App nav (logged-in pages) ----- */
.app-nav {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  padding: 14px 24px;
}
.app-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
}
.app-nav .brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--navy);
  text-decoration: none;
}
.app-nav .brand .accent { color: var(--teal); }
.app-nav .links {
  display: flex;
  gap: 22px;
  align-items: center;
}
.app-nav .links a {
  color: var(--slate-700);
  font-weight: 500;
  font-size: 0.94rem;
  text-decoration: none;
}
.app-nav .links a.active { color: var(--navy); font-weight: 600; }
.app-nav .links a:hover { color: var(--navy); }
.app-nav .signout {
  background: none;
  border: 1px solid var(--slate-300);
  color: var(--slate-700);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
}
.app-nav .signout:hover { border-color: var(--navy); color: var(--navy); }

/* ----- App content cards ----- */
.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 28px 28px;
  margin-bottom: 18px;
}
.card h2 { font-size: 1.2rem; margin: 0 0 6px; }
.card .card-sub { color: var(--slate-500); font-size: 0.94rem; margin: 0 0 18px; }

/* ----- Availability calendar ----- */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.calendar .dow {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0;
}
.calendar .day {
  aspect-ratio: 1 / 1;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.86rem;
  color: var(--slate-700);
  transition: all 0.12s ease;
  user-select: none;
}
.calendar .day:hover { border-color: var(--teal); }

/* Day available (default `.available` styling) — strong mint/teal for visibility */
.calendar .day.available {
  background: #5EEAD4;            /* teal-300, much more readable than tint */
  border-color: var(--teal-deep);
  color: var(--teal-deep);
  font-weight: 700;
}
.calendar .day.past {
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent;
}

/* Night available — dark indigo with white text */
.calendar .day.available.night,
.calendar .day.night-only {
  background: #312E81;            /* indigo-900 */
  border-color: #1E1B4B;          /* indigo-950 */
  color: #ffffff !important;
  font-weight: 700;
}
.calendar .day.available.night > div,
.calendar .day.night-only > div {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Hirer profile (read-only) — day-only is same as the edit-side day-available */
.calendar .day.day-only {
  background: #5EEAD4;
  border-color: var(--teal-deep);
  color: var(--teal-deep);
  font-weight: 700;
}

/* Both shifts — split cell: top half teal, bottom half indigo */
.calendar .day.both-shifts {
  background: linear-gradient(to bottom, #5EEAD4 50%, #312E81 50%);
  border-color: var(--teal-deep);
  color: var(--teal-deep);
  font-weight: 700;
}
.calendar .day.both-shifts > div:first-child {
  color: var(--teal-deep);
}
.calendar .day.both-shifts > div:last-child {
  color: #ffffff !important;
  opacity: 1 !important;
}
.calendar .day.empty { background: transparent; border: none; cursor: default; }

.calendar-month-label {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  margin: 18px 0 6px;
  font-size: 1.05rem;
}

/* ===== Trial / demo banner ===== */
.trial-banner {
  background: #FEF3C7;
  border-bottom: 1px solid #FCD34D;
  padding: 10px 0;
  font-size: 0.92rem;
  color: #78350F;
}
.trial-banner strong { color: #78350F; }
@media (max-width: 720px) {
  .trial-banner { padding: 8px 0; font-size: 0.84rem; line-height: 1.45; }
  .trial-banner .container { padding: 0 16px; }
}

/* ===== Unlocks pill ===== */
.unlocks-pill {
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--teal-tint);
  color: var(--teal-deep);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ===== Search page layout ===== */
.search-shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
}
@media (max-width: 880px) {
  .search-shell { grid-template-columns: 1fr; }

  /* Compact, tighter filters drawer on mobile */
  .filters { padding: 0; border: none; background: transparent; }

  .filters-collapsible > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--navy);
  }
  .filters-collapsible[open] > summary {
    margin-bottom: 12px;
  }
  .filters-collapsible > summary:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
  }
  .filters-summary-label { flex: 1; }
  .filters-summary-count {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--teal-tint);
    color: var(--teal-deep);
    padding: 3px 9px;
    border-radius: 999px;
  }
  .filters-summary-chev {
    color: var(--slate-500);
    font-size: 0.86rem;
    transition: transform 0.15s ease;
  }
  .filters-collapsible[open] > summary .filters-summary-chev {
    transform: rotate(180deg);
  }

  /* When the drawer is open on mobile, surround the filter blocks in the
     same card chrome the desktop sidebar uses */
  .filters-collapsible[open] {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 4px 18px 18px;
  }
  .filters-collapsible[open] > summary {
    margin: 0 -18px 8px;
    border: none;
    border-bottom: 1px solid var(--slate-100);
    border-radius: 0;
  }
}

.filters {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  align-self: start;
  position: sticky;
  top: 90px;
}
.filters h3 { font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate-500); margin: 0 0 14px; }

/* Collapsible filters container — visible content always renders on desktop;
   on mobile the <summary> becomes a tappable bar that toggles the drawer.
   The desktop "hide summary" rule is gated behind a min-width media query so
   it doesn't override the mobile styling defined earlier in this file. */
.filters-collapsible > summary::-webkit-details-marker { display: none; }
.filters-collapsible > summary::marker { display: none; content: ''; }
@media (min-width: 881px) {
  /* Desktop: keep only the "Filters" label visible, styled like the old h3.
     The chevron, active-count, and "Show results" CTA are mobile-only. */
  .filters-collapsible > summary {
    display: block;
    list-style: none;
    cursor: default;
    pointer-events: none;
  }
  .filters-collapsible > summary .filters-summary-label {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-500);
    margin: 0 0 14px;
  }
  .filters-collapsible > summary .filters-summary-count,
  .filters-collapsible > summary .filters-summary-chev,
  .filters-apply-btn { display: none; }
}

.filters-apply-btn {
  width: 100%;
  margin-top: 10px;
  padding: 13px 18px;
  font-size: 1rem;
  min-height: 48px;
}
.filter-block { padding: 12px 0; border-top: 1px solid var(--slate-100); }
.filter-block:first-of-type { border-top: none; padding-top: 0; }
.filter-block h4 { font-size: 0.86rem; color: var(--navy); margin: 0 0 8px; font-weight: 700; }
.filter-block input[type="text"],
.filter-block input[type="number"],
.filter-block input[type="date"] {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--slate-200); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.92rem;
  color: var(--slate-900); background: var(--white);
}
.filter-block input:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15,118,110,0.12);
}

.results-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.results-head select {
  padding: 8px 12px; border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 0.92rem;
  background: var(--white);
}

/* ===== Trade card ===== */
.trade-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  align-items: center;
}
.trade-card-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; }
.trade-card-name a { color: var(--navy); text-decoration: none; }
.trade-card-name a:hover { color: var(--teal); }
.trade-card-meta { font-size: 0.92rem; color: var(--slate-700); margin-top: 2px; }
.trade-card-region { font-size: 0.92rem; color: var(--slate-700); margin-top: 4px; }
.trade-card-accreds { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.trade-card-avail { margin-top: 6px; font-size: 0.9rem; color: var(--teal-deep); font-weight: 500; }
.trade-card-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 160px; }
.trade-card-actions .btn { padding: 9px 14px; font-size: 0.88rem; }

@media (max-width: 720px) {
  .trade-card { grid-template-columns: 56px 1fr; }
  .trade-card-actions { grid-column: 1 / -1; flex-direction: row; }
}

.contact-revealed {
  margin-top: 10px; padding: 10px 14px;
  background: var(--teal-tint); border: 1px solid var(--teal);
  border-radius: var(--radius-md);
  font-size: 0.92rem; color: var(--teal-deep); font-weight: 500;
}
.contact-revealed-large p { margin: 6px 0; font-size: 1.05rem; color: var(--slate-900); }

/* Accreditation pill badge */
.accred-badge {
  display: inline-block; padding: 3px 8px;
  background: var(--slate-100); color: var(--slate-700);
  border-radius: 4px; font-size: 0.78rem; font-weight: 600;
}

/* Shift type pill badges shown on trade cards */
.shift-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 999px; font-size: 0.74rem; font-weight: 700;
  margin-left: 4px; vertical-align: middle;
  border: 1px solid transparent;
}
.shift-badge.shift-day   { background: #5EEAD4; color: var(--teal-deep); border-color: var(--teal-deep); }
.shift-badge.shift-night { background: #312E81; color: #ffffff;          border-color: #1E1B4B; }
.shift-badge.shift-both  { background: linear-gradient(90deg, #5EEAD4 0%, #312E81 100%); color: #ffffff; border-color: var(--teal-deep); }

/* Avatar */
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.05rem;
  flex-shrink: 0;
}
.avatar-large {
  width: 88px; height: 88px;
  font-size: 1.5rem;
}

/* Unlock state */
.unlock-done {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  background: var(--teal-tint); color: var(--teal-deep);
  border: 1px solid var(--teal);
  border-radius: var(--radius-md);
  font-size: 0.88rem; font-weight: 600;
}

/* ===== Profile detail page ===== */
.profile-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 28px;
}
.profile-header h2 { font-size: 1.6rem; margin: 0 0 4px; }
.profile-trade { color: var(--slate-700); margin: 0 0 4px; font-size: 1rem; }
.profile-region { color: var(--slate-700); margin: 0 0 4px; font-size: 0.94rem; }
.profile-rate { color: var(--navy); font-weight: 700; font-size: 1.05rem; margin: 0; }
@media (max-width: 720px) {
  .profile-header { grid-template-columns: auto 1fr; }
  .profile-action { grid-column: 1 / -1; }
}

.profile-facts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
  margin-top: 18px; padding: 16px 0 0; border-top: 1px solid var(--slate-100);
}
.profile-facts > div { padding: 4px 0; }
.profile-facts dt {
  font-size: 0.78rem; color: var(--slate-500);
  text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
  margin-bottom: 4px;
}
.profile-facts dd { margin: 0; color: var(--slate-900); font-size: 0.96rem; }

.accred-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 12px 14px; background: var(--slate-50);
  border-radius: var(--radius-md); margin-bottom: 8px;
}
.accred-row-main strong { color: var(--navy); margin-right: 6px; }
.verify-link {
  font-size: 0.86rem; font-weight: 600;
  color: var(--teal); text-decoration: none;
  white-space: nowrap;
}
.verify-link:hover { color: var(--teal-deep); text-decoration: underline; }
@media (max-width: 600px) { .accred-row { flex-direction: column; align-items: flex-start; } }

/* ===== Accreditation badge tweaks (search-card) ===== */
.accred-badge-num { color: var(--slate-500); font-weight: 500; }
.accred-photo-dot { margin-right: 4px; font-size: 0.74rem; }
.verify-accreds-link {
  font-size: 0.8rem; font-weight: 600;
  color: var(--teal); text-decoration: none;
  margin-left: 4px; white-space: nowrap;
}
.verify-accreds-link:hover { color: var(--teal-deep); text-decoration: underline; }

/* ===== Card photo thumbnail (used on hirer profile + trade editor) ===== */
.card-photo-thumb {
  display: inline-block;
  width: 64px; height: 44px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  background: #fff; padding: 0; cursor: pointer;
  flex-shrink: 0;
}
.card-photo-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.card-photo-thumb:hover { border-color: var(--teal); }

.card-photo-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 44px;
  border-radius: 6px;
  border: 1px dashed var(--slate-300);
  color: var(--slate-500);
  font-size: 0.74rem; font-weight: 600;
  cursor: pointer; flex-shrink: 0;
  background: #fff;
}
.card-photo-add:hover { border-color: var(--teal); color: var(--teal-deep); }

/* Trade-side editor: row layout with photo on the left */
.accred-edit-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--slate-50);
  border-radius: var(--radius-md); margin-bottom: 8px;
}
.accred-edit-meta { flex: 1; min-width: 0; font-size: 0.94rem; }

/* Lightbox overlay for card photos */
.card-photo-lightbox {
  position: fixed; inset: 0;
  background: rgba(11, 27, 43, 0.88);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; cursor: zoom-out;
  padding: 24px;
}
.card-photo-lightbox img {
  max-width: 96%; max-height: 92%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.card-photo-close {
  position: absolute; top: 16px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff;
  border: none; font-size: 1.6rem; line-height: 1;
  cursor: pointer;
}
.card-photo-close:hover { background: rgba(255,255,255,0.25); }

/* ===== Trade references ===== */
.ref-row {
  padding: 12px 14px; background: var(--slate-50);
  border-radius: var(--radius-md); margin-bottom: 8px;
}
.ref-row-main strong { color: var(--navy); }
.ref-project { color: var(--slate-700); font-size: 0.88rem; margin-top: 4px; }

.ref-edit-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px; background: var(--slate-50);
  border-radius: var(--radius-md); margin-bottom: 8px;
}
.ref-edit-meta { flex: 1; min-width: 0; font-size: 0.94rem; }

/* ============================================================================
   MOBILE — phone-friendly app shell (trades + hirers using their mobile)
   ========================================================================= */
@media (max-width: 720px) {
  /* iOS zoom-on-focus prevention: every input must be ≥16px */
  .auth-card .form-field input,
  .auth-card .form-field select,
  .auth-card .form-field textarea,
  .filter-block input[type="text"],
  .filter-block input[type="number"],
  .filter-block input[type="date"],
  .results-head select { font-size: 16px; }

  /* Drop sticky filters on mobile so they don't pin to the top of the search */
  .filters { position: static; }

  /* App-nav: two rows on mobile.
     Row 1: brand (left) + sign-out (right).
     Row 2: nav links + unlocks pill spanning full width. */
  .app-nav { padding: 10px 0; }
  .app-nav .container {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 0 16px;
  }
  .app-nav .brand { font-size: 1.1rem; }
  .app-nav .links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 14px;
    overflow-x: auto;
    padding-top: 8px;
    border-top: 1px solid var(--slate-100);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .app-nav .links::-webkit-scrollbar { display: none; }
  .app-nav .links a {
    font-size: 0.94rem;
    padding: 4px 0;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .app-nav .signout {
    padding: 7px 12px;
    font-size: 0.86rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .app-nav .unlocks-pill {
    font-size: 0.78rem;
    padding: 4px 10px;
    margin-left: auto;
    flex-shrink: 0;
  }

  /* Calendar: bigger date numbers + readable shift labels */
  .calendar { gap: 4px; }
  .calendar .day { font-size: 1rem; }

  /* Cards a bit tighter on mobile so more fits on screen */
  .card { padding: 22px 18px; }

  /* Trade card spacing */
  .trade-card { padding: 16px; gap: 12px; }
  .trade-card-actions .btn { padding: 11px 14px; font-size: 0.92rem; min-height: 44px; }
}

@media (max-width: 480px) {
  /* On the smallest phones, drop the avatar on trade cards to maximise text */
  .trade-card { grid-template-columns: 1fr; }
  .trade-card-actions { flex-direction: column; }
  .trade-card-actions .btn { width: 100%; }
}
