/* Minimal theme: Tailwind (CDN) ทำ layout/สี ส่วนไฟล์นี้เหลือเฉพาะ FullCalendar, อนิเมชัน และหุ่นยนต์ DH
   ดีไซน์เหลี่ยมทั้งระบบ (ไม่ใช้ rounded) ตามเดิม */
:root {
  --c-primary: #4338ca;
  --c-primary-dark: #312e81;
  --c-primary-soft: #eef2ff;
  --c-busy: #fde68a;
  --c-full: #fca5a5;
}

/* ---------- Components ---------- */
.card-ui {
  background: #fff;
  border: 1px solid #e4e4e7;
  padding: 1.25rem;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-ui:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 24px -12px rgba(67, 56, 202, 0.25);
}
.dot {
  width: 12px;
  height: 12px;
  display: inline-block;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  animation: fade-up 0.4s ease both;
}

.meeting-card {
  border: 1px solid #e4e4e7;
  border-left: 3px solid var(--c-primary);
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
  background: #fff;
  animation: fade-up 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 50ms);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.meeting-card:hover {
  transform: translateX(3px);
  box-shadow: 0 4px 14px -8px rgba(67, 56, 202, 0.4);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.55rem 0.75rem;
  margin: 0.25rem 0 0.6rem;
  background: #fffbeb;
  color: #78350f;
  border-left: 3px solid #f59e0b;
  animation: fade-up 0.35s ease both;
}
.notice.full {
  background: #fef2f2;
  color: #7f1d1d;
  border-left-color: #ef4444;
}

#detail-content {
  max-height: calc(100vh - 9rem);
  overflow-y: auto;
  padding-right: 4px;
}
#detail-content { scrollbar-width: none; }
#detail-content::-webkit-scrollbar { display: none; }

/* ---------- FullCalendar ---------- */
.fc {
  --fc-border-color: #f0f0f2;
  --fc-today-bg-color: transparent;
  --fc-button-bg-color: transparent;
  --fc-button-border-color: #e4e4e7;
  --fc-button-text-color: #3f3f46;
  --fc-button-hover-bg-color: var(--c-primary-soft);
  --fc-button-hover-border-color: #c7d2fe;
  --fc-button-active-bg-color: var(--c-primary-soft);
  --fc-button-active-border-color: #c7d2fe;
  --fc-button-active-text-color: var(--c-primary-dark);
}
.fc .fc-toolbar-title { font-size: 1.1rem !important; font-weight: 700; color: #18181b; }
.fc .fc-button { padding: 0.3rem 0.7rem !important; font-size: 0.8rem !important; box-shadow: none !important; transition: all 0.2s ease; }
.fc .fc-button-primary:disabled { opacity: 0.4; }
.fc .fc-scrollgrid { border: 0; }
.fc .fc-col-header-cell { background: transparent; border-width: 0 0 1px; }
.fc .fc-col-header-cell-cushion { font-size: 0.75rem; font-weight: 500; color: #71717a; text-decoration: none !important; padding: 8px 0; }
.fc .fc-daygrid-day-frame { min-height: 96px !important; cursor: pointer; transition: background-color 0.2s ease; }
.fc .fc-daygrid-day:hover .fc-daygrid-day-frame { background: rgba(238, 242, 255, 0.7); }
.fc .fc-daygrid-day-number { font-size: 0.85rem; color: #3f3f46; text-decoration: none !important; padding: 6px 8px; }
.fc .fc-day-other .fc-daygrid-day-number { color: #d4d4d8; }
.fc .fc-day-today .fc-daygrid-day-number {
  background: var(--c-primary);
  color: #fff;
  min-width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 4px;
  padding: 0;
}
.fc-day-active { outline: 2px solid var(--c-primary); outline-offset: -2px; }
.fc-day-active .fc-daygrid-day-number { font-weight: 700; }
.fc-bg-event { opacity: 0.9 !important; }

/* ---------- Animations ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { outline-offset: 4px; } 100% { outline-offset: -2px; } }
@keyframes dh-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes dh-blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }
@keyframes dh-wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-35deg); } 80% { transform: rotate(8deg); } 90% { transform: rotate(-30deg); } }
@keyframes dh-ping { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes dh-think { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.animate-fade-up { animation: fade-up 0.5s ease both; }

/* หุ่นยนต์ DH: ใช้ <use> จึงกำหนดอนิเมชันผ่านคลาสภายใน symbol */
.dh-robot { overflow: visible; }
.dh-float { animation: dh-float 3.2s ease-in-out infinite; }
.dh-eye { transform-box: fill-box; transform-origin: center; animation: dh-blink 4.5s infinite; }
.dh-ping { transform-box: fill-box; transform-origin: center; animation: dh-ping 2s ease-out infinite; }
.dh-arm { transform-box: view-box; transform-origin: 100px 84px; }
.dh-wave .dh-arm { animation: dh-wave 4s ease-in-out infinite; }
.dh-thinking .dh-float { animation: dh-think 1.2s ease-in-out infinite; }

.spinner { width: 28px; height: 28px; border: 3px solid #e0e7ff; border-top-color: var(--c-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Flat: ไม่มีการ์ด */
.card-ui { background: transparent; border: 0; padding: 0; box-shadow: none; }
.card-ui:hover { border-color: transparent; box-shadow: none; }
.meeting-card { position: relative; border: 0; border-bottom: 1px solid #f0f0f2; background: transparent; margin: 0; padding: .9rem .25rem .9rem 1rem; }
.meeting-card::before { content: ""; position: absolute; left: 0; top: .9rem; bottom: .9rem; width: 3px; background: var(--c-primary); }
.meeting-card:hover { transform: none; box-shadow: none; background: #fafaff; }
.meeting-card:last-child { border-bottom: 0; }
.fc .fc-button { border-color: transparent; background: #f4f4f5; }
.fc .fc-daygrid-day-frame:hover { background: #f5f7ff; }

/* พื้นหลังปฏิทิน: ไล่สีอ่อน + ลายจุดบางๆ + แสงเรืองมุมขวาบน */
section.card-ui:first-of-type {
  background:
    radial-gradient(420px 260px at 100% 0%, rgba(165, 180, 252, .28), transparent 70%),
    radial-gradient(360px 240px at 0% 100%, rgba(253, 230, 138, .22), transparent 70%),
    radial-gradient(rgba(99, 102, 241, .13) 1px, transparent 1.2px) 0 0 / 18px 18px,
    linear-gradient(180deg, #fafaff 0%, #f3f5ff 100%) !important;
}
section.card-ui:first-of-type { padding: 1.25rem; }
.fc .fc-daygrid-day { background: rgba(255, 255, 255, .6); }
.fc .fc-daygrid-day.fc-day-other { background: transparent; }

.empty-state { padding: 3rem 1rem; }

/* กัน scrollbar กะพริบตอนคลิกวัน: ปฏิทินไม่ต้องมี scroll ภายใน */
.fc .fc-scroller, .fc .fc-scroller-liquid-absolute { overflow: hidden !important; }
#detail-content { overflow-x: hidden; }

/* ขนาดเท่ากับ booking (:3000) */
.fc .fc-daygrid-day-frame { min-height: 88px !important; }
.fc .fc-daygrid-day-number { font-size: 1.1rem; padding: 8px 10px; }
.fc .fc-col-header-cell-cushion { font-size: .9rem; padding: 10px 0; }
.fc .fc-toolbar-title { font-size: 1.25rem !important; }
.fc .fc-button { font-size: .9rem !important; padding: .4rem .9rem !important; }
.meeting-card { padding: 1.25rem .25rem 1.25rem 1.25rem; }
.meeting-card::before { top: 1.25rem; bottom: 1.25rem; width: 4px; }
.notice { font-size: .9rem; }
.dot { width: 14px; height: 14px; }

/* สรุปประจำวัน */
.seg { display: block; height: 6px; flex: 1; background: #e4e4e7; transition: background .3s; }
.day-summary { animation: fade-up .35s ease both; }
.empty-state { padding: 2rem 1rem; }
