/* WCS Zürich — Simplified Scoped Agenda Styles */

.wcs-agenda, .wcs-modal-backdrop {
  --wcs-border: #e5e7eb;
  --wcs-soft: #f8fafc;
  --wcs-text: #111827;
  --wcs-muted: #6b7280;
  --wcs-primary: #3a4b9d;
  --wcs-link: #2563eb;
  color: var(--wcs-text);
}
.wcs-agenda, .wcs-agenda *, .wcs-modal-backdrop, .wcs-modal-backdrop * { box-sizing: border-box; }
.wcs-agenda { max-width: 1140px; margin: 0 auto 24px; }

/* Shared Layout Primitives */
.wcs-rel { position: relative; }
.wcs-flex-1 { flex: 1; }
.wcs-grid { display: grid; }
.wcs-grid-7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wcs-flex-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wcs-row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.wcs-bold { font-weight: 700; color: var(--wcs-text); }
.wcs-dot { width: 8px; height: 8px; border-radius: 9999px; flex-shrink: 0; }
.wcs-mono-xs { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 600; color: var(--wcs-muted); }
.wcs-mono-sm { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; }
.wcs-muted-xs { font-size: 10px; color: var(--wcs-muted); }
.wcs-muted-sm { font-size: 12px; color: var(--wcs-muted); margin-top: 2px; }
.wcs-mobile-only { display: none; }

/* Header & Navigation */
.wcs-header { background: #fff; border: 1px solid var(--wcs-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.wcs-month-nav { position: relative; display: inline-flex; align-items: center; border: 1px solid var(--wcs-border); border-radius: 8px; background: var(--wcs-soft); }
.wcs-nav-btn, .wcs-month-label { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--wcs-text); cursor: pointer; }
.wcs-nav-btn { padding: 6px 8px; line-height: 1; }
.wcs-nav-btn:hover:not(:disabled), .wcs-month-label:hover { background: #fff; }
.wcs-nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.wcs-month-label { gap: 4px; min-width: 148px; padding: 6px 10px; font-size: 14px; font-weight: 700; }
.wcs-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--wcs-border); border-radius: 8px; background: #fff; color: var(--wcs-text); font-size: 12px; font-weight: 500; cursor: pointer; }
.wcs-btn:hover { background: var(--wcs-soft); }
.wcs-link-btn { background: none; border: none; padding: 4px 6px; color: var(--wcs-link); font-size: 12px; font-weight: 600; cursor: pointer; }
.wcs-link-btn:hover { text-decoration: underline; }

/* Popovers */
.wcs-popover { position: absolute; left: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--wcs-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); z-index: 60; padding: 10px; }
.wcs-month-popover { width: 240px; }
.wcs-year-switcher { display: flex; align-items: center; justify-content: space-between; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--wcs-border); font-size: 12px; font-weight: 700; }
.wcs-month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.wcs-month-btn { padding: 6px 4px; border-radius: 8px; border: none; background: transparent; font-size: 12px; font-weight: 600; color: var(--wcs-text); cursor: pointer; }
.wcs-month-btn:hover:not(:disabled):not(.is-active) { background: #f3f4f6; }
.wcs-month-btn.is-active { background: var(--wcs-primary); color: #fff; }
.wcs-month-btn:disabled { color: #9ca3af; opacity: .4; cursor: not-allowed; }
.wcs-level-popover { width: 224px; }
.wcs-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--wcs-border); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--wcs-muted); }
.wcs-level-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 500; margin: 0; user-select: none; }
.wcs-level-opt:hover { background: #f3f4f6; }
.wcs-level-opt input { margin: 0; accent-color: var(--wcs-primary); cursor: pointer; }

/* Filters */
.wcs-filters { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--wcs-border); display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.wcs-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wcs-filter-lbl { font-weight: 600; color: var(--wcs-muted); }
.wcs-pill, .wcs-level-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 9999px; border: 1px solid var(--wcs-border); background: #fff; color: var(--wcs-muted); font-size: 12px; font-weight: 500; cursor: pointer; line-height: 1.3; }
.wcs-pill.is-off { opacity: .5; }
.wcs-pill.is-off:hover { opacity: .9; }
.wcs-pill.is-loc-on { background: var(--wcs-soft); color: var(--wcs-text); border-color: #d1d5db; }
.wcs-pill.is-loc-off { opacity: .45; text-decoration: line-through; }
.wcs-level-btn { background: var(--wcs-soft); color: var(--wcs-text); border-color: #d1d5db; font-weight: 600; }
.wcs-level-btn.is-filtered { background: rgba(58,75,157,.12); border-color: rgba(58,75,157,.45); color: var(--wcs-primary); }

/* Calendar Grid */
.wcs-cal { background: #fff; border: 1px solid var(--wcs-border); border-radius: 12px; overflow: hidden; touch-action: pan-y; overscroll-behavior-x: contain; user-select: none; -webkit-user-select: none; }
.wcs-cal-viewport { position: relative; overflow: hidden; touch-action: pan-y; }
.wcs-cal-track { position: relative; background: #fff; will-change: transform; touch-action: pan-y; }
.wcs-month-toast { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.96); z-index: 5; pointer-events: none; padding: 8px 18px; border-radius: 9999px; background: rgba(17, 24, 39, .86); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .01em; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); opacity: 0; transition: opacity 220ms ease, transform 220ms ease; white-space: nowrap; }
.wcs-month-toast.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wcs-weekdays { border-bottom: 1px solid var(--wcs-border); background: var(--wcs-soft); }
.wcs-weekday { padding: 8px 4px; font-size: 12px; font-weight: 600; text-align: center; }
.wcs-weekday.is-muted { color: var(--wcs-muted); }
.wcs-week { position: relative; min-height: 108px; display: flex; flex-direction: column; border-bottom: 1px solid var(--wcs-border); }
.wcs-week:last-child { border-bottom: none; }
.wcs-col-lines { position: absolute; inset: 0; pointer-events: none; }
.wcs-col-lines > div { border-right: 1px solid var(--wcs-border); }
.wcs-col-lines > div:last-child { border-right: none; }
.wcs-col-lines > .is-out { background: #f9fafb; }
.wcs-day-num { padding: 6px 6px 4px; cursor: pointer; }
.wcs-day-num:hover, .wcs-day-body:hover { background: rgba(248,250,252,.7); }
.wcs-day-num.is-out, .wcs-day-body.is-out { opacity: .4; }
.wcs-day-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 9999px; font-size: 12px; font-weight: 600; }
.wcs-day-badge.is-today { background: var(--wcs-primary); color: #fff; }
.wcs-spans { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; }
.wcs-span-bar { margin: 0 4px; padding: 2px 7px; border-radius: 4px; border: 1px solid transparent; font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.wcs-span-bar:hover { opacity: .9; }
.wcs-span-bar.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.wcs-span-bar.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.wcs-day-body { padding: 0 6px 6px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; min-width: 0; }
.wcs-day-items { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wcs-event-pill { padding: 2px 6px; border-radius: 4px; border: 1px solid transparent; font-size: 11px; font-weight: 500; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcs-loc-card { border: 1px solid var(--wcs-border); border-left-width: 3px; border-radius: 5px; background: #fafafa; overflow: hidden; }
.wcs-loc-head { padding: 2px 6px; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcs-loc-body { padding: 3px 6px; display: flex; flex-direction: column; gap: 2px; }
.wcs-new-tag { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #dc2626; color: #fff; font-size: 9px; font-weight: 700; line-height: 1.2; }
.wcs-levels-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.wcs-levels { font-size: 11px; font-weight: 600; line-height: 1.2; }
.wcs-tech-tag { display: inline-block; padding: 1px 5px; border-radius: 3px; background: #0d9488; color: #fff; font-size: 10px; font-weight: 600; line-height: 1.2; }
.wcs-hidden-note { padding-top: 4px; font-size: 10px; color: #9ca3af; line-height: 1; user-select: none; }

/* Day Detail Modal */
.wcs-modal-backdrop { position: fixed; inset: 0; z-index: 1060; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; padding: 12px; }
.wcs-modal-backdrop.is-open { display: flex; }
.wcs-modal { background: #fff; border: 1px solid var(--wcs-border); border-radius: 16px; width: 100%; max-width: 1024px; max-height: 94vh; box-shadow: 0 24px 60px rgba(0,0,0,.22); display: flex; flex-direction: column; overflow: hidden; }
.wcs-modal-head { position: relative; padding: 12px 64px 12px 16px; border-bottom: 1px solid var(--wcs-border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; touch-action: pan-y; overscroll-behavior-x: contain; user-select: none; -webkit-user-select: none; }
.wcs-modal-title-wrap { min-width: 0; }
.wcs-modal-title { margin: 0; font-size: 17px; font-weight: 700; }
.wcs-modal-sub { margin: 2px 0 0; font-size: 12px; color: var(--wcs-muted); display: none; }
.wcs-seg { display: inline-flex; padding: 2px; border: 1px solid var(--wcs-border); border-radius: 8px; background: var(--wcs-soft); }
.wcs-seg-btn { padding: 4px 10px; border: none; border-radius: 6px; background: transparent; color: var(--wcs-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.wcs-seg-btn.is-active { background: var(--wcs-primary); color: #fff; }
.wcs-icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 6px; border: 1px solid var(--wcs-border); border-radius: 8px; background: #fff; color: #374151; cursor: pointer; }
.wcs-icon-btn:hover:not(:disabled) { background: #f3f4f6; }
.wcs-icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.wcs-icon-btn.is-close { position: absolute; top: 10px; right: 12px; border-color: transparent; color: var(--wcs-muted); }
.wcs-modal-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.wcs-modal-body { position: relative; padding: 14px 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; background: #fff; will-change: transform; }
.wcs-slide-ghost { position: absolute; top: 0; left: 0; width: 100%; background: #fff; pointer-events: none; z-index: 1; }
.wcs-modal-stage > .wcs-slide-ghost { bottom: 0; overflow-y: auto; }
.wcs-crowded-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 6px 12px; background: var(--wcs-soft); border: 1px solid var(--wcs-border); border-radius: 8px; font-size: 11px; color: var(--wcs-muted); flex-shrink: 0; }
.wcs-crowded-item { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }

/* Schedule Timeline */
.wcs-sched-wrap { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--wcs-border); border-radius: 12px; background: #f9fafb; flex-shrink: 0; }
.wcs-sched-head { display: flex; border-bottom: 1px solid var(--wcs-border); background: #fff; }
.wcs-time-col, .wcs-time-axis { width: 44px; flex-shrink: 0; border-right: 1px solid var(--wcs-border); background: #fff; }
.wcs-time-col { text-align: center; font-size: 10px; font-weight: 600; color: var(--wcs-muted); padding: 8px 4px; }
.wcs-col-head { padding: 6px 8px; min-width: 0; }
.wcs-col-head + .wcs-col-head, .wcs-track + .wcs-track { border-left: 1px solid var(--wcs-border); }
.wcs-col-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.wcs-col-title span:last-child, .wcs-col-addr, .wcs-teachers { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcs-col-addr { display: inline-block; margin-top: 2px; font-size: 11px; color: var(--wcs-muted); text-decoration: none; max-width: 100%; }
.wcs-col-addr:hover, .wcs-card-title:hover, .wcs-link-xs:hover, .wcs-link-muted:hover { color: var(--wcs-link); text-decoration: underline; }
.wcs-sched-body { display: flex; position: relative; overflow: hidden; }
.wcs-time-axis { position: relative; }
.wcs-tick { position: absolute; left: 0; right: 0; text-align: center; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--wcs-muted); transform: translateY(-50%); }
.wcs-hlines { position: absolute; inset: 0; pointer-events: none; }
.wcs-hlines > div { position: absolute; left: 0; right: 0; border-top: 1px solid rgba(229,231,235,.8); }
.wcs-track { position: relative; }
.wcs-card { position: absolute; left: 4px; right: 4px; border: 1px solid var(--wcs-border); border-left-width: 4px; border-radius: 8px; background: #fff; padding: 5px 8px; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.wcs-card.is-new { background: rgba(220,38,38,.06); border-color: rgba(220,38,38,.45); }
.wcs-card-top { min-width: 0; overflow: hidden; }
.wcs-logo-md { height: 18px; width: auto; object-fit: contain; flex-shrink: 0; display: inline-block; }
.wcs-logo-lg { height: 24px; width: auto; object-fit: contain; flex-shrink: 0; display: inline-block; }
.wcs-logo-xl { height: 30px; width: auto; object-fit: contain; flex-shrink: 0; display: inline-block; }
.wcs-badge { padding: 1px 5px; border-radius: 4px; border: 1px solid transparent; font-size: 9px; font-weight: 700; flex-shrink: 0; }
.wcs-badge.is-pill { border-radius: 9999px; padding: 2px 8px; font-size: 11px; }
.wcs-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 2px; font-size: 12px; font-weight: 700; line-height: 1.25; color: var(--wcs-text); text-decoration: none; white-space: normal; overflow-wrap: break-word; }
.wcs-card-desc { margin: 4px 0 0; font-size: 11px; line-height: 15px; color: var(--wcs-muted); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; }
.wcs-card-bot { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: 6px; padding-top: 2px; flex-shrink: 0; }
.wcs-card-bot .wcs-flex-gap { flex-wrap: nowrap; gap: 4px; flex-shrink: 0; }
.wcs-teachers { font-size: 10px; color: var(--wcs-muted); min-width: 0; }
.wcs-reg-sm, .wcs-reg-btn { display: inline-block; background: var(--wcs-primary); color: #fff !important; font-weight: 600; text-decoration: none !important; }
.wcs-reg-sm { padding: 2px 8px; border-radius: 5px; font-size: 10px; }
.wcs-reg-btn { padding: 6px 12px; border-radius: 8px; font-size: 12px; }
.wcs-reg-sm:hover, .wcs-reg-btn:hover { opacity: .9; }
.wcs-link-xs { font-size: 11px; font-weight: 600; color: var(--wcs-link); text-decoration: none; }
.wcs-link-muted { font-size: 11px; color: var(--wcs-muted); text-decoration: none; }

/* List View */
.wcs-sec-title { margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--wcs-muted); }
.wcs-list-card { border: 1px solid var(--wcs-border); border-left-width: 4px; border-radius: 10px; background: #f9fafb; padding: 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.wcs-list-title { display: inline-block; font-size: 14px; font-weight: 700; color: var(--wcs-text); text-decoration: none; }
.wcs-list-title:hover { color: var(--wcs-link); text-decoration: underline; }
.wcs-list-desc { margin: 4px 0; font-size: 12px; color: var(--wcs-muted); }
.wcs-room-card { border: 1px solid var(--wcs-border); border-radius: 10px; overflow: hidden; background: #fff; margin-bottom: 10px; }
.wcs-room-head { padding: 8px 14px; border-bottom: 1px solid var(--wcs-border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; }
.wcs-class-row { padding: 10px 14px; border-top: 1px solid var(--wcs-border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wcs-class-row:first-child { border-top: none; }
.wcs-class-main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.wcs-class-time { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--wcs-muted); width: 92px; flex-shrink: 0; padding-top: 2px; }
.wcs-wk-pill { font-size: 10px; color: var(--wcs-muted); border: 1px solid var(--wcs-border); border-radius: 9999px; padding: 1px 7px; }
.wcs-empty { padding: 36px 16px; text-align: center; color: var(--wcs-muted); font-size: 13px; }

/* Mobile Responsive */
@media (max-width: 640px) {
  .wcs-header { padding: 10px; }
  .wcs-mobile-only { display: inline-flex; }
  .wcs-filter-lbl { display: none; }
  .wcs-month-label { min-width: 118px; font-size: 13px; padding: 6px; }
  .wcs-weekday { padding: 6px 2px; font-size: 11px; }
  .wcs-week { min-height: 76px; }
  .wcs-day-num { padding: 4px 3px 2px; }
  .wcs-day-badge { width: 20px; height: 20px; font-size: 11px; }
  .wcs-span-bar { margin: 0 2px; padding: 1px 4px; font-size: 9px; }
  .wcs-day-body { padding: 0 2px 4px; }
  .wcs-day-items { gap: 2px; }
  .wcs-event-pill, .wcs-loc-head, .wcs-levels { font-size: 9px; }
  .wcs-event-pill { padding: 1px 3px; }
  .wcs-loc-card { border-left-width: 2px; }
  .wcs-loc-head { padding: 1px 3px; }
  .wcs-loc-body { padding: 2px 3px; }
  .wcs-new-tag, .wcs-tech-tag, .wcs-hidden-note { font-size: 8px; }
  .wcs-new-tag, .wcs-tech-tag { padding: 0 3px; }
  .wcs-hidden-note { padding-top: 2px; }
  .wcs-class-time { width: auto; }
  .wcs-modal-head { padding: 12px 16px; }
  .wcs-modal-title-wrap { width: 100%; padding-right: 36px; }
  .wcs-modal-controls { width: 100%; justify-content: space-between; }
  .wcs-icon-btn.is-close { right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .wcs-cal-track, .wcs-modal-body, .wcs-slide-ghost, .wcs-month-toast { transition: none !important; }
}

