/* ============================================================
   YouAİBOOKS — Calendar Grid
   React'e geçişte: <CalendarView>, <StaffHeader>, <TimeColumn>
============================================================ */

/* ----------------------------------------------------------
   Calendar Wrapper
---------------------------------------------------------- */
.calendar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ----------------------------------------------------------
   Staff Header Row — sticky, sits above scroll area
---------------------------------------------------------- */
.staff-header-row {
  display: flex;
  flex-shrink: 0;
  height: var(--staff-header-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-subtle);
  -webkit-backdrop-filter: var(--glass-blur-subtle);
  border-bottom: 1px solid var(--border-default);
  position: relative;
  z-index: 30;
  min-width: max-content;  /* prevents shrink on tablet */
}

.time-gutter-spacer {
  width: var(--time-gutter-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
}

.staff-col-header {
  flex: 1;
  min-width: var(--staff-col-min);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 8px 10px;
  border-left: 1px solid var(--border-subtle);
  position: relative;
}

/* Staff avatar with gradient ring */
.staff-avatar-ring {
  padding: 2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
  box-shadow: 0 0 12px var(--accent-primary-glow);
  flex-shrink: 0;
}

.staff-avatar-inner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  user-select: none;
}

.staff-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  text-align: center;
  white-space: nowrap;
}

.staff-role-badge {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 20px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-primary-lt);
  border: 1px solid rgba(124, 58, 237, 0.2);
  white-space: nowrap;
}

.staff-appt-count {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.staff-settings-btn {
  position: absolute;
  top: 6px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
}

.staff-col-header:hover .staff-settings-btn,
.staff-settings-btn:focus {
  opacity: 1;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-primary);
}

.staff-settings-btn:hover {
  background: rgba(124, 58, 237, 0.2);
  color: var(--accent-primary);
}

/* Sürükle-bırak: personel sütun sıralama */
.staff-col-header {
  cursor: grab;
  user-select: none;
}
.staff-col-header:active {
  cursor: grabbing;
}
.staff-col-header.col-dragging {
  opacity: 0.6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.staff-col-header.col-drag-over {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  background: rgba(124, 58, 237, 0.08);
}

/* ----------------------------------------------------------
   Calendar Scroll Area
---------------------------------------------------------- */
.calendar-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
}

/* ----------------------------------------------------------
   Grid Body — the main time grid
---------------------------------------------------------- */
.grid-body {
  display: flex;
  min-height: var(--grid-total-height);
  position: relative;
  min-width: max-content;
}

/* ----------------------------------------------------------
   Time Column — sticky left
---------------------------------------------------------- */
.time-column {
  width: var(--time-gutter-width);
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 20;
  background: var(--color-base);
  border-right: 1px solid var(--border-subtle);
}

.time-slot-label {
  height: var(--hour-height);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-ultra-muted);
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
}

/* ----------------------------------------------------------
   Staff Columns Grid
---------------------------------------------------------- */
.staff-cols-grid {
  display: flex;
  flex: 1;
  position: relative;
}

.staff-col {
  flex: 1;
  min-width: var(--staff-col-min);
  position: relative;
  border-left: 1px solid var(--border-subtle);
}

/* Randevu kartı sürükle-bırak: bırakılacak sütun vurgusu */
.staff-col.staff-col-drag-over {
  background: rgba(124, 58, 237, 0.06);
  outline: 2px dashed var(--accent-primary);
  outline-offset: -2px;
}

/* Grid lines — hourly (stronger) and half-hourly (subtle) */
.staff-col::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 39px,
      rgba(255, 255, 255, 0.05) 39px,  /* 30-min line */
      rgba(255, 255, 255, 0.05) 40px,
      transparent 40px,
      transparent 79px,
      rgba(255, 255, 255, 0.09) 79px,  /* 60-min line */
      rgba(255, 255, 255, 0.09) 80px
    );
  background-size: 100% 80px;
}

/* ----------------------------------------------------------
   Current Time Indicator — Türkiye saatine göre, görseldeki gibi sarı çizgi
   Konum: calendar.js (getTurkeyNow + _updateTimeLine)
---------------------------------------------------------- */
.current-time-line-el {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: #facc15; /* solid yellow, görseldeki gibi */
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.6);
  z-index: 15;
  pointer-events: none;
  transition: top 120s linear;
}

.current-time-dot-el {
  position: absolute;
  left: -6px;
  top: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.8), 0 0 4px rgba(250, 204, 21, 0.5);
}

.current-time-label-el {
  position: absolute;
  left: 8px;
  font-size: 9.5px;
  font-weight: 800;
  color: #facc15;
  background: var(--color-surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(250, 204, 21, 0.4);
  white-space: nowrap;
  pointer-events: none;
}
