/* ========================================
   Kemparu Availability Calendar
   ======================================== */

.kemparu-calendar {
  font-family: inherit;
  user-select: none;
  width: 100%;
}

/* Header: month/year + nav arrows */
.kemparu-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kemparu-calendar__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.kemparu-calendar__nav {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  color: inherit;
  padding: 0;
  line-height: 1;
}

.kemparu-calendar__nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.kemparu-calendar__nav:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Weekday labels */
.kemparu-calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.kemparu-calendar__weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.4;
  padding: 6px 0;
  letter-spacing: 0.05em;
}

/* Days grid */
.kemparu-calendar__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.kemparu-calendar__day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 6px;
  transition: all 0.15s ease;
  position: relative;
  border: 1px solid transparent;
}

.kemparu-calendar__day--empty {
  pointer-events: none;
}

.kemparu-calendar__day--past {
  opacity: 0.2;
  pointer-events: none;
}

.kemparu-calendar__day--today {
  border-color: #c9a96e;
  font-weight: 700;
}

.kemparu-calendar__day--occupied {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Edit mode: clickable days */
.kemparu-calendar--editable .kemparu-calendar__day:not(.kemparu-calendar__day--empty):not(.kemparu-calendar__day--past) {
  cursor: pointer;
}

.kemparu-calendar--editable .kemparu-calendar__day:not(.kemparu-calendar__day--empty):not(.kemparu-calendar__day--past):hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.kemparu-calendar--editable .kemparu-calendar__day--occupied:hover {
  background: rgba(239, 68, 68, 0.35) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

/* View mode: no pointer */
.kemparu-calendar--readonly .kemparu-calendar__day {
  cursor: default;
}

/* Legend */
.kemparu-calendar__legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.6;
}

.kemparu-calendar__legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kemparu-calendar__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kemparu-calendar__legend-dot--free {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.kemparu-calendar__legend-dot--occupied {
  background: rgba(239, 68, 68, 0.4);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.kemparu-calendar__legend-dot--today {
  background: transparent;
  border: 1px solid #c9a96e;
}

/* Save feedback */
.kemparu-calendar__status {
  margin-top: 8px;
  font-size: 12px;
  min-height: 18px;
  transition: opacity 0.3s ease;
}

.kemparu-calendar__status--success {
  color: #86efac;
}

.kemparu-calendar__status--error {
  color: #fca5a5;
}

/* ========================================
   Dark Theme (default — frontend)
   ======================================== */

.kemparu-calendar--dark {
  color: #e5e5e5;
}

.kemparu-calendar--dark .kemparu-calendar__day {
  background: transparent;
}

.kemparu-calendar--dark .kemparu-calendar__day--occupied {
  background: rgba(239, 68, 68, 0.2);
}

/* ========================================
   Light Theme (wp-admin)
   ======================================== */

.kemparu-calendar--light {
  color: #1e1e1e;
}

.kemparu-calendar--light .kemparu-calendar__nav {
  border-color: #c3c4c7;
  color: #1e1e1e;
}

.kemparu-calendar--light .kemparu-calendar__nav:not(:disabled):hover {
  background: #f0f0f1;
  border-color: #8c8f94;
}

.kemparu-calendar--light .kemparu-calendar__day {
  background: #f6f7f7;
}

.kemparu-calendar--light .kemparu-calendar__day--today {
  border-color: #c9a96e;
  background: rgba(201, 169, 110, 0.08);
}

.kemparu-calendar--light .kemparu-calendar__day--occupied {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.25);
}

.kemparu-calendar--light .kemparu-calendar__day:not(.kemparu-calendar__day--empty):not(.kemparu-calendar__day--past):hover {
  background: #e8e8e8;
  border-color: #c3c4c7;
}

.kemparu-calendar--light .kemparu-calendar__day--occupied:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.kemparu-calendar--light .kemparu-calendar__legend-dot--free {
  background: #f6f7f7;
  border-color: #c3c4c7;
}

.kemparu-calendar--light .kemparu-calendar__status--success {
  color: #16a34a;
}

.kemparu-calendar--light .kemparu-calendar__status--error {
  color: #dc2626;
}
