/* ═══════════════════════════════════════════════════
   css/calendar.css  —  BUT IT Faculty
   Стили для calendar-view расписания.
   Дополняет schedule.css — не заменяет его.
═══════════════════════════════════════════════════ */

/* ── Calendar root container ── */
#calendar-root {
  margin: 32px 48px 64px;
  border-radius: var(--radius-lg, 10px);
  overflow: hidden;
  border: 1px solid var(--stone);
  box-shadow: 0 2px 14px rgba(74,55,40,.07);
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 600px;
}

/* ── Toggle bar (Неделя / День) ── */
.cal-view-toggle {
  display: flex;
  border: 1.5px solid var(--pebble);
  border-radius: 6px;
  overflow: hidden;
}
.cal-view-btn {
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  transition: all .15s;
  background: #fff;
  color: var(--ink2);
}
.cal-view-btn.active {
  background: var(--orange);
  color: #fff;
}

/* ── Group filter select ── */
.cal-group-select {
  font-family: var(--sans);
  font-size: 12px;
  padding: 5px 10px;
  border: 1.5px solid var(--pebble);
  border-radius: 6px;
  color: var(--ink2);
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a89d95'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px;
}
.cal-group-select:focus {
  outline: none;
  border-color: var(--orange);
}

/* ── Today button ── */
.cal-today-btn {
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background .15s;
}
.cal-today-btn:hover { background: var(--orange-dk); }

/* ── Nav arrow buttons ── */
.cal-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--pebble);
  background: #fff;
  font-size: 15px;
  cursor: pointer;
  color: var(--ink2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s;
}
.cal-nav-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* ── Date range label ── */
.cal-date-label {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border: 1.5px solid var(--pebble);
  border-radius: 6px;
  background: #fff;
  color: var(--ink2);
  cursor: pointer;
  font-family: var(--sans);
  position: relative;
  transition: border-color .15s;
}
.cal-date-label:hover { border-color: var(--orange); color: var(--orange); }

/* ── Time gutter ── */
.cal-gutter {
  width: 52px;
  min-width: 52px;
  border-right: 1px solid var(--stone);
  flex-shrink: 0;
  background: var(--cream);
}
.cal-gutter-cell {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 3px 6px 0;
  box-sizing: border-box;
}
.cal-gutter-time {
  font-size: 10px;
  color: var(--ink3);
  font-weight: 500;
}
.cal-gutter-now {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: #16A34A;
  border-radius: 4px;
  padding: 1px 4px;
}

/* ── Day header cell ── */
.cal-day-hdr {
  flex: 1;
  padding: 8px 10px;
  text-align: center;
  transition: background .15s;
}
.cal-day-hdr:hover { background: var(--cream); }
.cal-day-hdr.today { background: #FFFBF7; }
.cal-day-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.03em;
}
.cal-day-hdr.today .cal-day-num { color: var(--orange); }
.cal-day-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink3);
  margin-left: 4px;
  letter-spacing: .05em;
}
.cal-day-hdr.today .cal-day-name { color: var(--orange); }

/* ── Event block ── */
.cal-event {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 5px;
  padding: 4px 7px;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
  transition: box-shadow .15s;
  z-index: 2;
}
.cal-event:hover { box-shadow: 0 3px 12px rgba(0,0,0,.15); }

.cal-event-time {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 1px;
}
.cal-event-subject {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cal-event-teacher {
  font-size: 10px;
  color: var(--ink2);
  margin-top: 1px;
}
.cal-event-room {
  display: inline-block;
  background: rgba(74,55,40,.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  color: var(--ink2);
  margin-top: 2px;
  letter-spacing: .04em;
}

/* ── Current time line ── */
.cal-time-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #16A34A;
  z-index: 10;
  pointer-events: none;
}
.cal-time-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16A34A;
  margin-left: -4px;
  margin-top: -3px;
}

/* ── Empty state ── */
.cal-empty {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 3;
  width: 90%;
}
.cal-empty-icon { font-size: 36px; opacity: .15; }
.cal-empty-text  { font-size: 11px; color: var(--ink3); margin-top: 6px; }

/* ── Tooltip ── */
#cal-tooltip {
  position: fixed;
  width: 240px;
  background: #fff;
  border: 1px solid var(--stone);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(28,21,16,.14);
  z-index: 9999;
  overflow: hidden;
}

/* ── Legend ── */
.cal-legend {
  background: var(--cream);
  border-top: 1px solid var(--stone);
  padding: 7px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink2);
}
.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}
.cal-legend-hint {
  margin-left: auto;
  font-size: 10px;
  color: var(--ink3);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #calendar-root {
    margin: 16px 16px 48px;
    min-height: 500px;
  }
  .cal-legend-hint { display: none; }
}

@media (max-width: 480px) {
  #calendar-root { margin: 10px 10px 32px; }
}
