/* ================================
   Goodstream Calendar Layout
================================ */

.calendar-page-shell {
  display: grid;
  grid-template-columns: 280px minmax(520px, 1fr) 340px;
  gap: 18px;
  padding: 28px;
  align-items: start;
}

.calendar-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calendar-panel-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.calendar-panel-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text, #111827);
}

.calendar-stat,
.calendar-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.calendar-stat:last-child,
.calendar-detail-row:last-child {
  border-bottom: none;
}

.calendar-stat span,
.calendar-detail-row span,
.calendar-detail-section span {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-stat strong,
.calendar-detail-row strong {
  font-size: 14px;
  color: var(--text, #111827);
}

.calendar-main-panel .calendar-container {
  max-width: none;
  margin: 0;
}

.calendar-event-title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 14px;
  color: var(--text, #111827);
}

.calendar-detail-section {
  margin-top: 14px;
}

.calendar-detail-section p {
  margin: 6px 0 0;
  color: var(--text, #111827);
  line-height: 1.45;
}

.calendar-detail-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 18px;
}

.calendar-detail-actions button,
#saveEventBtn {
  border: 1px solid var(--gs-charcoal);
  background: var(--gs-navy);
  color: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
}

.calendar-detail-actions button.danger {
  background: var(--gs-coral);
  border-color: rgba(220, 38, 38, 0.35);
}

.calendar-empty-state,
.calendar-empty-small,
.calendar-selected-date {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.calendar-mini-list {
  display: grid;
  gap: 8px;
}

.calendar-mini-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.calendar-mini-item:last-child {
  border-bottom: none;
}

.calendar-event-details.hidden {
  display: none;
}

.calendar-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.calendar-panel-card textarea,
.calendar-panel-card input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  background: #ffffff;
}

.calendar-cell.has-events {
  border-color: var(--gs-navy);
}

.calendar-event-preview {
  display: block;
  margin-top: 6px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--gs-charcoal);
  color: var(--gs-white);
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 1200px) {
  .calendar-page-shell {
    grid-template-columns: 1fr;
  }

  .calendar-left-panel,
  .calendar-right-panel {
    order: 2;
  }

  .calendar-main-panel {
    order: 1;
  }
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-header h2 {
  margin: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.calendar-day, .calendar-cell {
  text-align: center;
  padding: 10px;
  font-weight: bold;
}

.calendar-day {
  background-color: #eee;
}

.calendar-cell {
  height: 80px;
  background: #fafafa;
  border: 1px solid #ccc;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}

.calendar-cell .event-dot {
  width: 6px;
  height: 6px;
  background: var(--gs-navy);
  border-radius: 50%;
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
}

/* ✅ Current day highlight */
.calendar-cell.today {
  background: var(--gs-mist);
  border: 2px solid var(--gs-coral);
  color: var(--gs-coral);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.calendar-cell.today::after {
  content: "Today";
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gs-navy);
  background: #ffffff;
  border-radius: 999px;
  padding: 2px 6px;
}

.event-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  width: 300px;
  z-index: 999;
}

.event-modal input,
.event-modal textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
}

.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.close-modal {
  float: right;
  cursor: pointer;
  font-weight: bold;
}

.calendar-location-field {
  position: relative;
}

.calendar-location-suggestions {
  display: none;
  position: absolute;
  top: calc(100% - 8px);
  left: 0;
  right: 0;
  z-index: 50;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.calendar-location-suggestion {
  display: block;
  width: 100%;
  border: none;
  background: #ffffff;
  color: var(--text, #111827);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.calendar-location-suggestion:hover {
  background: rgba(37, 99, 235, 0.08);
}

.calendar-event-preview {
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.calendar-event-previews {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.calendar-more-events {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  margin-top: 2px;
}

.calendar-day-number {
  text-align: left;
}

.calendar-cell-empty {
  opacity: 0.35;
  cursor: default;
}

.calendar-detail-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.calendar-assigned-users {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.calendar-assigned-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.9);
}

.calendar-assigned-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.calendar-assigned-avatar-fallback {
  display: grid;
  place-items: center;
  background: #e0f2fe;
  color: #075985;
  font-size: 12px;
  font-weight: 900;
}

.calendar-assigned-user-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.calendar-assigned-user-info strong {
  font-size: 13px;
  color: var(--text, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-assigned-user-info small {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-assigned-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 3px 6px 3px 0;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 13px;
  font-weight: 800;
  color: var(--text, #111827);
}

.calendar-assigned-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
}

.calendar-assigned-empty {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.calendar-assigned-users-wrap {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: var(--gs-card-bg, #ffffff);
}

.calendar-assigned-users-picker {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.calendar-assign-user-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.035);
}

.calendar-assign-user-option:hover {
  background: rgba(0, 0, 0, 0.07);
}

.calendar-assign-user-option input {
  width: 16px;
  height: 16px;
}

.calendar-assign-user-option span {
  font-weight: 700;
}