/* ============================================================
   Schedule — Google Calendar View (ADR-035 colour protocol)
   Azia Light Theme — white/aqua palette
   ============================================================ */

/* When Schedule is active, hide other elements */
body.schedule-active #expanded-title,
body.schedule-active #detail-panel,
body.schedule-active #bg-layer,
body.schedule-active #c4-link { display: none !important; }

/* ---- Container ---- */
#schedule-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #EFF6FF;
  color: #475569;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
}

#schedule-view::before {
  content: none;
}



/* ---- Header ---- */
.sch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  z-index: 250;
  flex-shrink: 0;
  border-bottom: 2px solid #3B82F6;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sch-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sch-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #172351;
}

.sch-subtitle {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(71, 85, 105, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 4px;
}

.sch-header-right {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  padding: 3px;
}


/* ---- Filter Bar ---- */
.sch-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 28px;
  flex-shrink: 0;
  z-index: 5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.95);
}

.sch-filter-pills {
  display: flex;
  gap: 6px;
}

.sch-filter-pill {
  padding: 5px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  color: rgba(71, 85, 105, 0.6);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sch-filter-pill:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #475569;
  border-color: rgba(0, 0, 0, 0.12);
}

.sch-filter-active {
  background: rgba(6, 147, 227, 0.1);
  color: #0693E3;
  border-color: rgba(6, 147, 227, 0.3);
}

.sch-summary-info {
  margin-left: auto;
  font-size: 0.7rem;
  color: rgba(71, 85, 105, 0.5);
}


/* ---- Table Container ---- */
.sch-table-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  z-index: 2;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}


/* ---- Table ---- */
.sch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.sch-table thead th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(71, 85, 105, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 3;
}

.sch-table tbody tr.sch-row {
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.sch-table tbody tr.sch-row:hover {
  filter: brightness(0.97);
}

.sch-table tbody tr.sch-row-expanded {
  background: rgba(0, 0, 0, 0.04);
}

.sch-table td {
  padding: 10px 12px;
  vertical-align: middle;
}


/* ---- Colour-Coded Row Accents (ADR-035) ---- */
.sch-row-tomato {
  border-left: 3px solid #ef4444;
}

.sch-row-banana {
  border-left: 3px solid #f59e0b;
}

.sch-row-default {
  border-left: 3px solid rgba(148, 163, 184, 0.2);
}

.sch-row-killian {
  border-left: 3px solid #38bdf8;
}

.sch-row-bins {
  border-left: 3px solid #22c55e;
}

.sch-row-hellofresh {
  border-left: 3px solid #a3e635;
}

.sch-row-sports {
  border-left: 3px solid #4ade80;
}

/* ---- Cell Styles ---- */
.sch-cell-date {
  white-space: nowrap;
  font-weight: 500;
  color: #172351;
  min-width: 120px;
}

.sch-cell-time {
  white-space: nowrap;
  font-size: 0.78rem;
  color: rgba(71, 85, 105, 0.7);
  min-width: 70px;
}

.sch-cell-event {
  color: rgba(71, 85, 105, 0.85);
  line-height: 1.4;
  max-width: 350px;
}

.sch-cell-location {
  font-size: 0.78rem;
  color: rgba(71, 85, 105, 0.5);
  max-width: 200px;
}

.sch-cell-worker {
  font-size: 0.78rem;
  color: rgba(71, 85, 105, 0.6);
  white-space: nowrap;
}

.sch-cell-type {
  white-space: nowrap;
}

/* ---- Done Column ---- */
.sch-th-done {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
}

.sch-cell-done {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  text-align: center;
  padding: 4px !important;
}

.sch-done-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #FFFFFF;
  color: rgba(71, 85, 105, 0.3);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sch-done-btn:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: rgba(74, 222, 128, 0.8);
}

.sch-done-btn.sch-done-active {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: rgba(74, 222, 128, 0.95);
}

/* Row dismiss animation: strikethrough → collapse → gone */
.sch-row-dismissing {
  animation: sch-dismiss 0.55s ease forwards;
}
@keyframes sch-dismiss {
  0%   { opacity: 1; max-height: 60px; }
  40%  { opacity: 0.5; }
  100% { opacity: 0; max-height: 0; overflow: hidden; padding: 0; border: none; }
}

/* Event text strikethrough when done */
.sch-event-done {
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.5);
  opacity: 0.55;
}

/* Killian-at-home + bin + HF indicator column */
.sch-th-k {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  padding: 0 !important;
}

.sch-cell-k {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  padding: 4px 2px !important;
  text-align: center;
  vertical-align: middle;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: nowrap;
}

.sch-k-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  position: relative;
}

/* Changeover Friday — enlarged K with swap icon */
.sch-k-changeover {
  width: 28px;
  height: 28px;
  font-size: 0.65rem;
  background: rgba(239, 68, 68, 0.95);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.sch-k-swap {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-radius: 50%;
  padding: 1px;
  color: #38bdf8;
}


/* ---- Bin Collection Circles ---- */
.sch-bin-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sch-bin-svg {
  width: 12px;
  height: 12px;
}

.sch-bin-recycle {
  background: #22c55e;
  color: #fff;
}

.sch-bin-compost {
  background: #92400e;
  color: #fde68a;
}

.sch-bin-waste {
  background: #374151;
  color: #d1d5db;
}


/* ---- HelloFresh Lemon Circles ---- */
.sch-hf-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.sch-hf-svg {
  width: 14px;
  height: 14px;
}

.sch-hf-cutoff {
  background: rgba(163, 230, 53, 0.85);
  color: #fff;
}

.sch-hf-delivery {
  background: rgba(163, 230, 53, 0.85);
  color: #fff;
}

.sch-hf-overlay {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 13px;
  height: 13px;
  background: #FFFFFF;
  border-radius: 50%;
  padding: 2px;
  color: #fde68a;
}


/* ---- Type Badges ---- */
.sch-type-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.sch-type-tomato {
  background: rgba(239, 68, 68, 0.15);
  color: rgba(248, 113, 113, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.sch-type-banana {
  background: rgba(245, 158, 11, 0.15);
  color: rgba(251, 191, 36, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.sch-type-killian {
  background: rgba(56, 189, 248, 0.15);
  color: rgba(125, 211, 252, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.sch-type-bins {
  background: rgba(34, 197, 94, 0.15);
  color: rgba(74, 222, 128, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.sch-type-hellofresh {
  background: rgba(163, 230, 53, 0.15);
  color: rgba(190, 242, 100, 0.95);
  border: 1px solid rgba(163, 230, 53, 0.3);
}

.sch-type-sports {
  background: rgba(74, 222, 128, 0.15);
  color: rgba(74, 222, 128, 0.95);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.sch-type-sport-sub {
  background: rgba(74, 222, 128, 0.08);
  color: rgba(74, 222, 128, 0.7);
  border: 1px solid rgba(74, 222, 128, 0.15);
  font-size: 0.55rem;
}

.sch-type-unverified {
  background: rgba(239, 68, 68, 0.15);
  color: rgba(252, 165, 165, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.3);
}


/* ---- Detail Row (expandable) ---- */
.sch-detail-row {
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sch-detail-row td {
  padding: 0;
}

.sch-detail-content {
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.sch-detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  max-width: 300px;
}

.sch-detail-wide {
  min-width: 300px;
  max-width: 600px;
}

.sch-detail-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(6, 147, 227, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sch-detail-field span {
  font-size: 0.82rem;
  color: rgba(71, 85, 105, 0.8);
  line-height: 1.4;
}


/* ---- Verify Button (HelloFresh) ---- */
.sch-verify-btn {
  padding: 5px 14px;
  border: 1px solid rgba(163, 230, 53, 0.4);
  background: rgba(163, 230, 53, 0.12);
  color: rgba(101, 163, 13, 0.95);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sch-verify-btn:hover {
  background: rgba(163, 230, 53, 0.25);
  border-color: rgba(163, 230, 53, 0.6);
}

.sch-verify-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.sch-verify-done {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: rgba(22, 163, 74, 0.95);
}


/* ---- Empty / Loading ---- */
.sch-empty,
.sch-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: rgba(71, 85, 105, 0.4);
  font-size: 0.9rem;
}

.sch-empty-text {
  font-size: 0.9rem;
}


/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sch-header { padding: 10px 16px; }
  .sch-filter-bar { padding: 8px 16px; flex-wrap: wrap; }
  .sch-table-container { padding: 14px 16px; overflow-x: auto; }
  .sch-table { min-width: 650px; }
  .sch-subtitle { display: none; }
  .sch-summary-info { display: none; }
}

@media (max-width: 480px) {
  .sch-header { padding: 8px 12px; }
  .sch-filter-bar { padding: 6px 12px; gap: 8px; }
  .sch-table-container { padding: 10px 12px; }
}

/* ---- Detail Panel Assign Row ---- */
.sch-assign-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sch-assign-label {
  font-size: 0.68rem;
  color: rgba(71, 85, 105, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.sch-assign-siobhan-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.08);
  color: rgba(99, 102, 241, 0.9);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.sch-assign-siobhan-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
}

.sch-assign-siobhan-btn.sch-assign-done {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: rgba(34, 197, 94, 0.9);
}

.sch-assign-instruct-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(71, 85, 105, 0.15);
  background: transparent;
  color: rgba(71, 85, 105, 0.6);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
}

.sch-assign-instruct-btn:hover {
  background: rgba(71, 85, 105, 0.06);
  color: rgba(71, 85, 105, 0.9);
}

.sch-assign-instruct-btn.sch-assign-done {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: rgba(34, 197, 94, 0.9);
}

.sch-instruct-box {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  width: 100%;
  padding: 6px 0;
}

.sch-instruct-textarea {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(71, 85, 105, 0.15);
  font-size: 0.78rem;
  font-family: inherit;
  color: rgba(51, 65, 85, 0.9);
  background: rgba(255, 255, 255, 0.8);
  resize: vertical;
  transition: border-color 0.15s;
}

.sch-instruct-textarea:focus {
  border-color: rgba(99, 102, 241, 0.5);
  outline: none;
}

.sch-instruct-send-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: rgba(99, 102, 241, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.sch-instruct-send-btn:hover {
  background: rgba(99, 102, 241, 1);
}
