/* ─────── Core Layout ───────────────────────────── */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  height: 100%;
  overflow: hidden;
}

#calendar {
  height: calc(100% - 50px);
  padding: 10px;
}

#main-header {
  background: #007bff;
  color: #fff;
  padding: 10px 20px;
  font-size: 0.8rem;
  height: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─────── FullCalendar Adjustments ─────────────── */
:root {
  --fc-timegrid-slot-height: 40px;
}

.fc-event.overrun-active {
  box-shadow: inset -5px 0 0 red;
}

.fc-timegrid-slot { height: 40px !important; }
.fc-timegrid-slot-label {
  font-size: 10px;
  color: grey;
}
.fc-col-header-cell-cushion {
  font-size: 10px !important;
  color: grey !important;
  padding: 2px 4px;
}
.fc-header-toolbar {
  padding: 4px 8px;
  font-size: 0.85rem;
}
.fc-toolbar-chunk { margin: 0 4px; }
.fc-button {
  padding: 2px 6px;
  font-size: 0.75rem;
  height: auto;
  line-height: 1.2;
}
.fc-button-primary {
  background-color: #007bff;
  border: none;
  border-radius: 4px;
  color: white;
}
.fc-button-primary:hover {
  background-color: #0056b3;
}
.timecard-bar {
  width: 6px;
  height: 100%;
  background-color: limegreen; /* will be updated dynamically */
  margin-right: 6px;
  border-radius: 3px 0 0 3px;
}


.fc-event {
  border: none;
  height: 100%;
  overflow: hidden;
}

/* ─────── Modal Layout ─────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  z-index: 999;
}
#edit-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  padding: 20px;
  display: none;
  z-index: 1000;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ccc;
  margin-bottom: 15px;
}
.modal-close {
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
}

/* ─────── Event Block Layout ───────────────────── */
.fc-custom-event {
  display: flex;
  flex-direction: row;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: inherit;
}

.fc-event-inner {
  flex: 1;
  overflow: hidden;
  padding: 4px;
  display: flex;
  flex-direction: column;
}

/* Font structure */
.title-line {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 1.05em;
  line-height: 1.3;
}

.middle-line {
  font-size: 0.9em;
  line-height: 1.2;
}

.sub-line,
.time-line,
.est-line {
  font-size: 0.75em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────── Progress Bar Styles ──────────────────── */
.progress-bar-container {
  height: 6px;
  background: #444;
  margin-top: 6px;
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: limegreen;
  transition: width 0.5s ease;
  min-width: 1px;
}

.countdown-line {
  font-size: 0.85em;
  font-weight: bold;
  margin-top: 4px;
  text-align: left;
  line-height: 1.3;
}

.left-timecard-bar {
  background-color: initial; /* ✅ Let JS set the color dynamically */
  transition: background-color 0.3s ease;
}

.countdown-line strong {
  font-weight: bold;
}

.countdown-inline {
  display: inline-block;
  color: limegreen;
  font-variant-numeric: tabular-nums;
}


.countdown-timer {
  font-variant-numeric: tabular-nums;
}

/* ─────── Thumbnail Layout ─────────────────────── */
.thumb-wrapper {
  margin-top: 6px;
  text-align: center;
}

.thumb-preview {
  max-height: 110px;
  max-width: 95%;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ─────── Modal Thumbnails ─────────────────────── */
#thumb-preview,
#thumb-preview-2 {
  max-height: 320px;
  width: auto;
  object-fit: contain;
}

/* ─────── State-Based Event Colors ─────────────── */
.fc-event.Started,
.fc-event.Delayed,
.fc-event.Finished {
  background-color: black !important;
  color: white !important;
  border: none !important;
}

.fc-event.Started .fc-custom-event,
.fc-event.Delayed .fc-custom-event,
.fc-event.Finished .fc-custom-event {
  background-color: black !important;
  color: white !important;
}


/* ─────── Template Style ───────────────────────── */
.fc-event.template-event {
  background-color: #999 !important;
  color: #000 !important;
  border: none !important;
}

/* ─────── Animation (Optional) ─────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
