/* css/calendar-panel.css
   Drop-in replacement aligning the Calendar pop-up with the shared overlay panel style.
   Includes:
   1) Overlay container + header styles (same as compendium/journal)
   2) Calendar UI styles (#calendar, controls, grid, cells)
*/

/* ===== Overlay Panel (container) ===== */
.overlay-panel {
  position: absolute;
  top: 60px;
  left: 60px;

  width: 500px;
  height: 800px;
  min-width: 360px;
  min-height: 180px;

  z-index: 9999;

  display: flex;
  flex-direction: column;

  border: 3px solid #000;
  border-radius: 10px;
  overflow: hidden;
  resize: both;

  background: #0b0b0b url('../assets/img/background.png') center/cover no-repeat;

  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
}

/* IFrame fills remaining space beneath header (when calendar is in an iframe) */
.overlay-panel iframe {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

/* ===== Header bar (drag handle) ===== */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  height: 40px;               /* IMPORTANT: matches minimize logic in JS */
  padding: 4px 10px 4px 12px;

  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);

  font-family: 'Jim Nightshade', cursive;
  user-select: none;
  cursor: move;
}

.panel-title {
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-header > div {
  display: flex;
  gap: 6px;
}

.panel-header button {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease-in-out, color 120ms ease-in-out, border-color 120ms ease-in-out;
}

.panel-header button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
}

.panel-header button:active {
  transform: translateY(1px);
}

.panel-header button:focus-visible {
  outline: 2px solid #e0c080;
  outline-offset: 2px;
}

/* ===== Responsive tuning ===== */
@media (max-width: 900px) {
  .overlay-panel {
    top: 4vw;
    left: 4vw;
    width: min(92vw, 560px);
    height: 70vh;
  }
  .panel-title {
    font-size: 1.1rem;
  }
}

/* ======================================================================= */
/* ======================= Calendar UI (inside panel) ===================== */
/* ======================================================================= */

#calendar {
  font-family: 'Quattrocento', serif;
  padding: 1rem;
  background: url('../assets/img/background.png') no-repeat center center;
  background-size: cover;
  color: #000;
}

.calendar-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

#calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.calendar-cell {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #000;
  padding: 10px;
  text-align: center;
  border-radius: 4px;
}

.calendar-cell.today {
  background: #ffd700;
  font-weight: bold;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}
