/* ============================================================
   HTML Calendar Plugin — Frontend Styles
   Clean, minimal design inspired by freehtmlcalendar.com
   ============================================================ */

:root {
  --hcal-font:          'Segoe UI', system-ui, -apple-system, sans-serif;
  --hcal-bg:            #ffffff;
  --hcal-border:        #e0e0e0;
  --hcal-header-bg:     #2c3e50;
  --hcal-header-color:  #ffffff;
  --hcal-day-header-bg: #f4f6f8;
  --hcal-day-color:     #333333;
  --hcal-weekend-color: #c0392b;
  --hcal-today-bg:      #2980b9;
  --hcal-today-color:   #ffffff;
  --hcal-holiday-color: #90EE90; /* light green */
  --hcal-holiday-text:  #000000;  /* black */
  --hcal-empty-bg:      #fafafa;
  --hcal-gap:           16px;
  --hcal-radius:        6px;
  --hcal-shadow:        0 2px 8px rgba(0,0,0,.08);
}

/* Wrap + responsive grid */
.html-calendar-wrap {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--hcal-font);
}

.html-calendar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hcal-gap);
}

/* ── Single month card ── */
.hcal-month {
  flex: 1 1 0;
  min-width: 240px;
  max-width: 100%;
  background: var(--hcal-bg);
  border: 1px solid var(--hcal-border);
  border-radius: var(--hcal-radius);
  box-shadow: var(--hcal-shadow);
  overflow: hidden;
}

/* Header: Month name + year */
.hcal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--hcal-header-bg);
  color: var(--hcal-header-color);
  padding: 12px 16px;
}

.hcal-month-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.hcal-year {
  font-size: 14px;
  opacity: .75;
  font-weight: 400;
}

/* 7-column grid */
.hcal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

/* Day-of-week headers */
.hcal-day-header {
  background: var(--hcal-day-header-bg);
  color: #666;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  padding: 7px 0;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--hcal-border);
}

/* Individual day cell */
.hcal-day {
  position: relative;
  min-height: 36px;
  padding: 4px 3px 3px;
  text-align: center;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  cursor: default;
  transition: background .15s ease;
  overflow: hidden;
}

.hcal-day:hover {
  background: #f0f5fb;
}

.hcal-day-num {
  display: block;
  font-size: 18px;
  color: var(--hcal-day-color);
  line-height: 1.4;
  font-weight: 400;
}

/* Empty filler cells */
.hcal-day.hcal-empty {
  background: var(--hcal-empty-bg);
  cursor: default;
}

.hcal-day.hcal-empty:hover {
  background: var(--hcal-empty-bg);
}

/* Weekend */
.hcal-day.hcal-weekend .hcal-day-num {
  color: var(--hcal-weekend-color);
}

/* Today */
.hcal-day.hcal-today {
  background: var(--hcal-today-bg);
}

.hcal-day.hcal-today .hcal-day-num {
  color: var(--hcal-today-color);
  font-weight: 700;
}

/* ── Holiday highlight ── */
.hcal-day.hcal-holiday {
  background-color: #90EE90;
}

.hcal-day.hcal-holiday .hcal-day-num {
  color: #ff0000;
  font-weight: 600;
}

/* Holiday name label (small text below the number) */
.hcal-holiday-name {
  display: block;
  font-size: 8px;
  color: #ff0000;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  margin-top: 1px;
}

/* ── Tooltip ── */
.hcal-day[data-holiday]:hover::after {
  content: attr(data-holiday);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e50;
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.hcal-day[data-holiday]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #2c3e50;
  z-index: 101;
  pointer-events: none;
}

/* ── Responsive ── */
/* Mobile: single column, centered */
@media (max-width: 640px) {
  .hcal-month {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 400px;
  }

  .html-calendar-grid {
    justify-content: center;
  }
}

/* Tablet: two columns */
@media (min-width: 641px) and (max-width: 900px) {
  .hcal-month {
    flex: 1 1 calc(50% - var(--hcal-gap) / 2);
    min-width: 240px;
  }
}

/* Desktop: fill width, max 3-4 per row, no empty space */
@media (min-width: 901px) {
  .hcal-month {
    flex: 1 1 0;
    min-width: 280px;
  }
}
