/* Local Font Definitions (100% Offline Compatible) */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/PlusJakartaSans-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/PlusJakartaSans-500.ttf') format('truetype');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/PlusJakartaSans-600.ttf') format('truetype');
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/PlusJakartaSans-700.ttf') format('truetype');
}

:root {
  --dtp-primary: #0d9488;
  --dtp-primary-hover: #0f766e;
  --dtp-primary-light: #ccfbf1;
  --dtp-primary-glow: rgba(13, 148, 136, 0.2);
  --dtp-text-main: #1e293b;
  --dtp-text-muted: #64748b;
  --dtp-bg-card: #ffffff;
  --dtp-bg-secondary: #f8fafc;
  --dtp-border-color: #e2e8f0;
  --dtp-border-active: #cbd5e1;
  --dtp-shadow-popup: 0 20px 40px rgba(15, 118, 110, 0.14), 0 8px 16px rgba(0, 0, 0, 0.04);
  --dtp-radius-lg: 20px;
  --dtp-radius-md: 12px;
  --dtp-radius-sm: 8px;
}

/* ========================================================
   DATE TIME PICKER COMPONENT STYLES (SCOPED ONLY)
   ======================================================== */

.datetime-picker-wrapper {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  margin-bottom: 10px;
}

.datetime-picker-wrapper.has-badge {
  margin-top: 0;
}

/* Field Container with floating badge */
.dtp-input-box {
  position: relative;
  background: var(--dtp-bg-card);
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  min-height: 48px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  user-select: none;
  width: 100%;
  box-sizing: border-box;
}

.dtp-input-box:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.dtp-input-box.active {
  box-shadow: 0 0 0 3px var(--dtp-primary-glow);
  border-color: var(--dtp-primary);
}

.dtp-input-box.dtp-readonly {
  cursor: not-allowed !important;
  background-color: #f1f5f9 !important;
  opacity: 0.75;
  pointer-events: none !important;
  border-color: #cbd5e1 !important;
}

.dtp-input-box.dtp-readonly:hover {
  box-shadow: none !important;
}


/* Floating badge tag on top border */
.dtp-badge {
  position: absolute;
  top: -12px;
  left: 16px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--dtp-primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.dtp-input-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--dtp-text-main);
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dtp-input-content.dtp-stacked {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding-top: 4px;
  padding-bottom: 2px;
}

.dtp-row-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
}

.dtp-row-item .dtp-icon,
.dtp-icon {
  color: var(--dtp-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.dtp-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.dtp-date-text,
.dtp-time-text {
  white-space: nowrap;
  font-size: 0.84rem;
  letter-spacing: -0.1px;
}

.dtp-divider {
  color: var(--dtp-border-color);
  font-weight: 400;
  margin: 0 2px;
  flex-shrink: 0;
}

.dtp-icon-end {
  color: var(--dtp-primary);
  background: var(--dtp-primary-light);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.dtp-input-box:hover .dtp-icon-end {
  background: var(--dtp-primary);
  color: #ffffff;
}

/* POPUP PICKER PANEL */
.dtp-picker-popup {
  position: fixed;
  z-index: 99999999 !important;
  background: #ffffff;
  border-radius: var(--dtp-radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(108, 92, 231, 0.15);
  border: 1px solid rgba(226, 228, 237, 0.9);
  padding: 20px;
  display: none;
  gap: 20px;
  width: max-content;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  box-sizing: border-box;
  animation: dtpFadeIn 0.15s ease-out;
}

.dtp-picker-popup.open {
  display: flex;
}

@keyframes dtpFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}


/* LEFT SECTION: CALENDAR */
.dtp-calendar-section {
  width: 260px;
  max-width: 100%;
}

.dtp-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dtp-nav-btn {
  background: var(--dtp-bg-secondary);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--dtp-text-main);
  transition: all 0.2s ease;
}

.dtp-nav-btn:hover {
  background: var(--dtp-primary-light);
  color: var(--dtp-primary);
}

.dtp-select-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dtp-select {
  background: var(--dtp-bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--dtp-radius-sm);
  padding: 4px 6px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--dtp-text-main);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.dtp-select:hover,
.dtp-select:focus {
  border-color: var(--dtp-primary);
  background: #ffffff;
}

/* Weekday header */
.dtp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dtp-text-muted);
  margin-bottom: 10px;
}

/* Days grid */
.dtp-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dtp-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--dtp-radius-sm);
  cursor: pointer;
  color: var(--dtp-text-main);
  background: #ffffff;
  border: 1px solid #f1f5f9;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.dtp-day-cell.other-month {
  color: #cbd5e1 !important;
  pointer-events: none;
  background: transparent !important;
  border: none !important;
}

/* Hover Tanggal Biasa (jika ada) */
.dtp-day-cell:not(.other-month):not(.dtp-day-disabled):not(.dtp-scheduled-day):not(.selected):hover {
  background: #ccfbf1 !important;
  color: #0f766e !important;
  border-color: #99f6e4 !important;
}

/* Tanggal Non-Aktif / Terkunci (Disabled / Tidak ada pertemuan) */
.dtp-day-cell.dtp-day-disabled {
  background: #f8fafc !important;
  color: #cbd5e1 !important;
  cursor: not-allowed !important;
  pointer-events: none;
  border: 1px solid #f1f5f9 !important;
  opacity: 0.5;
}

/* TANGGAL PERTEMUAN JURNAL (SCHEDULED MEETING DAYS - UNFILLED) */
.dtp-day-cell.dtp-scheduled-day:not(.dtp-completed-day):not(.selected) {
  background: #e0f2fe !important; /* Soft Ice Blue (Belum Diisi) */
  color: #0284c7 !important;     /* Teks Biru Kontras */
  font-weight: 700 !important;
  border: 1.5px solid #7dd3fc !important;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.08) !important;
}

.dtp-day-cell.dtp-scheduled-day:not(.dtp-completed-day):not(.selected):hover {
  background: #bae6fd !important;
  color: #0369a1 !important;
  border-color: #38bdf8 !important;
}

/* TANGGAL PERTEMUAN JURNAL YANG SUDAH DIISI (COMPLETED / FILLED) */
.dtp-day-cell.dtp-completed-day:not(.selected) {
  background: #dcfce7 !important; /* Soft Emerald Green (Sudah Diisi) */
  color: #15803d !important;     /* Teks Hijau Kontras */
  font-weight: 700 !important;
  border: 1.5px solid #86efac !important;
  box-shadow: 0 2px 4px rgba(21, 128, 61, 0.08) !important;
  position: relative;
}

.dtp-day-cell.dtp-completed-day:not(.selected):hover {
  background: #bbf7d0 !important;
  color: #166534 !important;
  border-color: #4ade80 !important;
}

/* Indikator titik hijau di pojok atas untuk penanda sudah diisi */
.dtp-day-cell.dtp-completed-day:not(.selected)::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  background-color: #16a34a;
  border-radius: 50%;
}

/* Hari Ini (Today) - ketika TIDAK dipilih */
.dtp-day-cell.today:not(.selected) {
  border: 2px solid var(--dtp-primary) !important;
  color: var(--dtp-primary) !important;
  font-weight: 700;
  background: #f0fdf4 !important;
}

/* TANGGAL YANG DIPILIH / AKTIF (SELECTED) - HIGHEST PRIORITY */
.dtp-day-cell.selected,
.dtp-day-cell.dtp-scheduled-day.selected {
  background: var(--dtp-primary) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.45) !important;
  border-radius: 8px !important;
  border: none !important;
  transform: scale(1.05);
}

.dtp-day-cell.selected:hover {
  background: var(--dtp-primary-hover) !important;
  color: #ffffff !important;
}

/* RIGHT SECTION: TIME PICKER */
.dtp-time-section {
  width: 200px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--dtp-border-color);
  padding-left: 20px;
}

.dtp-time-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--dtp-text-main);
  margin-bottom: 12px;
}

.dtp-time-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dtp-text-muted);
  margin-bottom: 8px;
}

.dtp-spinners-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
}

.dtp-spinner-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dtp-spin-btn {
  background: var(--dtp-bg-secondary);
  border: none;
  width: 100%;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--dtp-text-muted);
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.dtp-spin-btn:hover {
  background: var(--dtp-primary-light);
  color: var(--dtp-primary);
}

.dtp-spin-val {
  background: var(--dtp-bg-secondary);
  border: 1px solid var(--dtp-border-color);
  width: 100%;
  height: 38px;
  border-radius: var(--dtp-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dtp-text-main);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.dtp-spin-input {
  text-align: center;
  outline: none;
  font-family: inherit;
}

.dtp-spin-val:hover,
.dtp-spin-input:focus {
  border-color: var(--dtp-primary-hover);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--dtp-primary-glow);
}


/* Bottom Action Buttons */
.dtp-bottom-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dtp-quick-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dtp-quick-btn {
  background: transparent;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--dtp-text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.dtp-quick-btn:hover {
  color: var(--dtp-primary);
  background: var(--dtp-primary-light);
}

.dtp-done-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--dtp-primary) 0%, var(--dtp-primary-hover) 100%);
  color: #ffffff;
  border: none;
  padding: 8px 0;
  border-radius: var(--dtp-radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
  transition: all 0.2s ease;
}

.dtp-done-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.45);
}

/* Ultra Responsiveness for Tablets & Mobile Devices */
@media (max-width: 640px) {
  .dtp-picker-popup {
    flex-direction: column;
    width: min(100vw - 32px, 300px);
    padding: 16px;
    gap: 14px;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto;
  }

  .dtp-calendar-section {
    width: 100%;
  }

  .dtp-time-section {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--dtp-border-color);
    padding-left: 0;
    padding-top: 14px;
  }

  .dtp-input-content {
    font-size: 0.8rem;
  }
}

/* Premium Fieldset Seamless Integration */
.premium-fieldset .datetime-picker-wrapper {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.premium-fieldset .dtp-input-box {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  height: 36px !important;
  min-height: 36px !important;
}

.premium-fieldset .dtp-badge {
  display: none !important;
}

.premium-fieldset .dtp-input-content {
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: #1e293b !important;
}