body {
  font-family:
    "Prompt",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: #f5f5f7;
  color: #1d1d1f;
}
/* 🪐 บังคับสีพื้นหลังของ body ให้เป็นสีมืดใน Dark Mode */
.dark body {
  background-color: #121212 !important;
}
@font-face {
  font-family: "Sukhumvit Set";
  src: url("SukhumvitSet-Medium") format("Medium");
  font-weight: normal;
  font-style: normal;
}
.apple-blur {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-color: rgba(255, 255, 255, 0.8);
}
.drag-over {
  border: 2px dashed #0066cc !important;
  background-color: rgba(0, 102, 204, 0.04) !important;
  transform: scale(1.01);
  transition: all 0.2s ease;
}
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #f5f5f7;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #d2d2d7;
  border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #86868b;
}
/* 🟢 CSS แก้ไขใหม่: ล็อกพื้นที่ปฏิทินให้อยู่เฉพาะไอคอนขวาสุดของช่องตัวเอง */
input[type="date"]::-webkit-calendar-picker-indicator {
  position: relative;
  width: auto;
  height: auto;
  opacity: 1;
  cursor: pointer;
  filter: invert(0.5); /* ปรับสีไอคอนปฏิทินให้อ่านง่ายทั้ง Light/Dark Mode */
}

/* 🟢 แอนิเมชันการ์ดร่อนขึ้นจากด้านล่าง */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-card-in {
  opacity: 0;
  /* ปรับเป็น 0.6s เพื่อให้มีเวลาเยื้องนุ่มๆ และใช้กราฟความเร็วช่วงท้ายแบบสมูทสุดๆ */
  animation: fadeInUp 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* 🟢 อัปเดต: สไตล์เงาจำลองช่องว่างตอนลากย้ายสไลด์ (Ghost/Placeholder) */
.sortable-ghost {
  opacity: 0.3 !important;
  background-color: #f1f5f9 !important; /* เปลี่ยนเป็นสีเทาพาสเทลซอฟต์จาง */
  border: 2px dashed #0066cc !important; /* ใส่เส้นประสีน้ำเงิน Apple นุ่มๆ */
  transform: scale(0.96);
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1) !important; /* ใช้ Curve ฟิสิกส์ไหลลื่น */
}

/* 🟢 อัปเดต: ตัวการ์ดจริงที่กำลังถูกเมาส์คลิกลาก (Chosen Card) */
.sortable-chosen {
  box-shadow:
    0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 8px 10px -6px rgb(0 0 0 / 0.1) !important; /* เงาลอยนุ่มนวลความลึกสูง */
  transform: rotate(1deg) scale(1.02) !important; /* เติม !important ล็อกองศาเอียง 2 องศาเบาๆ */
  cursor: grabbing !important;
}

/* 🟢 อัปเดต: จังหวะขยับหลบทางของการ์ดใบอื่นในกระดาน */
.sortable-drag {
  opacity: 0.95 !important;
}

/* 🟢 อนิเมชันไอเดียที่ 4: เคลียร์ปัญหาซ้อนทับ ใช้แสงวิ่งนุ่มนวลแบบไม่กวนการร่อนการ์ด */
@keyframes shimmerGlow {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* 🟢 ป้ายสถานะสีนุ่มนวลแบบไม่มีแสงวิ่ง */
.shimmer-badge-done {
  background-color: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
}

.shimmer-badge-archived {
  background-color: rgba(168, 85, 247, 0.12) !important;
  border-color: rgba(168, 85, 247, 0.9) !important;
}

/* ตัวการ์ดเรืองแสงทอง/เขียวจางๆ แบบปลอยภัย */
.final-card-glow {
  position: relative !important;
  overflow: hidden !important;
}
/* 🟢 2. ส่วนของขอบการ์ดงาน (Card Border) */
.final-card-glow::after {
  content: "";
  position: absolute;
  top: 0;
  left: -150%;
  width: 60%;
  height: 100%;
  /* 💡 โหมดสว่างใช้สีขาวบางๆ 0.25 (25%) */
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  animation: shimmerGlowCard 15s ease-in-out infinite;
  pointer-events: none;
}

/* 🌙 สำหรับ Dark Mode: ปรับแสงปาดให้ซอฟต์ลงเหลือแค่ 8% หรือเปลี่ยนเป็นโทนฟ้า-น้ำเงินเข้มจางๆ */
.dark .final-card-glow::after {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    /* 👈 ปรับความสว่างเหลือแค่ 8% แสงจะซอฟต์นุ่มสวย ไม่จ้าแสบตา */
    rgba(255, 255, 255, 0) 100%
  );
}

@keyframes shimmerGlowCard {
  0% {
    left: -150%;
  }
  25% {
    left: 150%;
  }
  100% {
    left: 150%;
  }
}

/* 🟢 อนิเมชันไอเดีย C: คลาสควบคุมมิติ 3D และทรานซิชันช่วงเมาส์ขยับ */
[id^="card-"] {
  transform-style: preserve-3d !important;
  will-change: transform !important;
  /* คุมจังหวะคืนตัวปกติและการเอียงตามเมาส์ให้อ่อนช้อย ไม่แข็งกระด้าง */
  transition:
    transform 0.15s ease-out,
    box-shadow 0.2s ease,
    border-color 0.2s ease !important;
}

/* 🎬 อนิเมชันไอเดีย B: สเลทหนังขยับได้ */
.clapperboard {
  width: 60px;
  height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

/* ฝาสเลทด้านบน */
.clapper-top {
  width: 60px;
  height: 12px;
  background: repeating-linear-gradient(
    -45deg,
    #363636,
    #363636 8px,
    #ffffff 8px,
    #ffffff 16px
  );
  border-radius: 4px 4px 0 0;
  transform-origin: bottom left;
  /* สั่งแอนิเมชันสับสเลทขึ้นลงกึ่งกลาง */
  animation: clapCut 1.2s ease-in-out infinite;
}

/* ตัวสเลทด้านล่าง */
.clapper-bottom {
  width: 60px;
  height: 38px;
  background-color: #363636;
  border-radius: 0 0 4px 4px;
}

/* คีย์เฟรมคำนวณองศาการสับฝาสเลทแป๊กๆ */
@keyframes clapCut {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-18deg); /* อ้าปากสเลทออก */
  }
  70% {
    transform: rotate(0deg); /* สับลงมาดัง แป๊ก! */
  }
}

/* 🌟 อนิเมชันไอเดียที่ 2: การ์ดระเบิดพลังซูเปอร์ไซย่า */

/* 🌟 เอฟเฟกต์การ์ดระเบิดพลังซูเปอร์ไซย่า */

/* 1. ตัวการ์ดเด้งดึ๋งกระแทกพื้น */
@keyframes cardPopImpact {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(0.92) rotate(-1.5deg);
  }
  50% {
    transform: scale(1.08) rotate(1.5deg);
  }
  80% {
    transform: scale(0.97);
  }
  100% {
    transform: scale(1);
  }
}

.card-burst-active {
  animation: cardPopImpact 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
  border-color: #10b981 !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.45) !important;
}

@keyframes shockwaveBurst {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* 🌟 อนิเมชันไอเดีย 3: กลิตเตอร์อิโมจิลอยฟุ้ง */
.floating-emoji {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 20px;
  animation: emojiFloatUp 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  will-change: transform, opacity;
}

@keyframes emojiFloatUp {
  0% {
    transform: translate(0, 0) scale(0.9);
    opacity: 1;
  }
  100% {
    /* ลอยเฉียงขึ้นไปข้างบนตามค่าที่คำนวณจาก JavaScript และเฟดจางออก */
    transform: translate(var(--x-move), var(--y-move)) scale(1.8);
    opacity: 0;
  }
}

/* 🏷️ ไอเดียที่ 2: เอฟเฟกต์หัวข้อบอร์ดเรืองแสงหายใจได้ */
@keyframes headerGlowBreathing {
  0%,
  100% {
    box-shadow:
      0 1px 3px 0 rgba(0, 0, 0, 0.05),
      0 0 4px var(--glow-color);
    border-color: var(--border-color);
  }
  50% {
    box-shadow:
      0 4px 8px 0 rgba(0, 0, 0, 0.02),
      0 0 4px var(--glow-color);
    border-color: var(--border-active-color);
  }
}

/* คลาสสั่งเรืองแสงที่จะเอาไปครอบหัวบอร์ด */
.zone-header-glow {
  animation: headerGlowBreathing 3s ease-in-out infinite;
  transition: all 0.3s ease;
}

/* ซ่อนปุ่มสลับบอร์ดเดิมในส่วนของ Header และ Sidebar บนจอมือถือ */
@media (max-width: 768px) {
  /* ซ่อนปุ่มแฮมเบอร์เกอร์เมนูที่มุมขวาบนของ Header เดิม */
  #menuBtn {
    display: none !important;
  }

  /* บังคับปิด Sidebar ไม่ให้แสดงผลบนมือถือเด็ดขาด */
  #sidebar {
    display: none !important;
    transform: translateX(-100%) !important;
  }

  /* เว้นระยะขอบล่างของหน้าจอหลักไว้ 80px เสมอ เพื่อไม่ให้ Bottom Bar ไปบังเนื้อหาบอร์ด */
  main,
  .container,
  #boardContainer {
    padding-bottom: 85px !important;
  }
}

/* ตกแต่งแถบปุ่มสไลด์แนวนอนด้านบน (Scrollable Top Tab) ให้ไม่มีแถบสกรอลล์บาร์โผล่มากวนสายตา */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* 🌟 แอนิเมชันสำหรับตอนสลับบอร์ด (ให้กระดานเฟดสว่างและเด้งขึ้นมานุ่มๆ) */
@keyframes boardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.animate-board-active {
  animation: boardFadeIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* ==========================================
         🌟 CineFlow Live Status Animations
         ========================================== */

/* 📋 1. งานที่ต้องทำ (ลอยขึ้นลงเบาๆ นุ่มนวล) */
@keyframes float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}
.anim-todo {
  animation: float-soft 3s ease-in-out infinite;
}

/* 🎬 2. ถ่ายทำแล้ว (สเลทหนังสับ/โยกเป็นจังหวะ) */
@keyframes clapper-snap {
  0%,
  80%,
  100% {
    transform: rotate(0deg);
  }
  85% {
    transform: rotate(-15deg);
  }
  90% {
    transform: rotate(5deg);
  }
  95% {
    transform: rotate(-2deg);
  }
}
.anim-brief {
  animation: clapper-snap 4s ease-in-out infinite;
  transform-origin: bottom left;
}

/* ✂️ 3. กำลังตัดต่อ (กรรไกรขยับตัดไปมา) */
@keyframes snip-cut {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-15deg);
  }
  75% {
    transform: rotate(10deg);
  }
}
.anim-editing {
  animation: snip-cut 2.5s ease-in-out infinite;
  transform-origin: center;
}

/* 👁️ 4. ส่งตรวจสอบ (ตากะพริบเป็นระยะ) */
@keyframes eye-blink {
  0%,
  90%,
  100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}
.anim-review {
  animation: eye-blink 5s infinite;
  transform-origin: center;
}

/* 🚀 5. พร้อมเผยแพร่ (จรวดลอยสั่นๆ เตรียมปล่อยตัว) */
@keyframes rocket-hover {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-4px) rotate(3deg);
  }
}
.anim-done {
  animation: rocket-hover 2s ease-in-out infinite;
}

/* ==========================================
         🌟 เอฟเฟกต์พื้นหลัง Gradient ไหลไปมา (Hero Banner)
         ========================================== */
@keyframes gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 🌟 1. Apple Light Ambient Background (พื้นหลังขาวสะอาดไล่เฉดสีนุ่มนวล) */
@keyframes lightAmbient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
/* 🌟 Apple Light Ambient Background */
.apple-light-bg {
  background: linear-gradient(135deg, #ffffff 0%, #fbfbfd 50%, #f5f5f7 100%);
  background-size: 200% 200%;
  animation: lightAmbient 20s ease infinite;
}

/* 🪐 สไตล์ Dark Mode สำหรับหน้า Home Portal */
.dark .apple-light-bg {
  background: linear-gradient(
    135deg,
    #121212 0%,
    #1b1b1c 50%,
    #121212 100%
  ) !important;
}

.dark .apple-light-card {
  background: rgba(27, 27, 28, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5) !important;
}

.dark .apple-light-card:hover {
  background: rgba(44, 44, 46, 0.95) !important;
  border-color: rgba(0, 113, 227, 0.5) !important;
}

/* 🪐 2. แสงสีฟ้า-ม่วงพาสเทล เรืองแสงเบาๆ ด้านหลังกระจกขาว */
.light-orb-blue {
  background: radial-gradient(
    circle,
    rgba(0, 113, 227, 0.08) 0%,
    rgba(255, 255, 255, 0) 70%
  );
}
.light-orb-indigo {
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.06) 0%,
    rgba(255, 255, 255, 0) 70%
  );
}

/* 💎 3. Apple White Glass Card (การ์ดกระจกขาวใส ขอบเนียน นุ่มตา) */
.apple-light-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 30px -5px rgba(0, 0, 0, 0.05),
    0 0 1px 1px rgba(0, 0, 0, 0.03);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-light-card:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 113, 227, 0.3);
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.08),
    0 0 25px rgba(0, 113, 227, 0.1);
}

/* 🎬 1. ตารางสตูดิโอจางๆ ด้านหลัง (Studio Minimal Grid) */
.prod-grid-bg {
  background-image:
    linear-gradient(to right, rgba(0, 113, 227, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 113, 227, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* 📷 2. แอนิเมชันวงแหวนโฟกัสกล้องหมุนสโลว์โมชัน (Camera Focus Rings) */
@keyframes spinSlow {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
@keyframes spinSlowReverse {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}
@keyframes prodScanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(1000%);
  }
}

.focus-ring-1 {
  animation: spinSlow 50s linear infinite;
}
.focus-ring-2 {
  animation: spinSlowReverse 70s linear infinite;
}
.focus-ring-3 {
  animation: spinSlow 100s linear infinite;
}

/* 🎞️ 3. เส้นแสงสแกนภาพนุ่มนวล (Viewfinder Scanner) */
.prod-scanner-line {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 113, 227, 0.06),
    transparent
  );
  animation: prodScanline 15s ease-in-out infinite;
}

/* 💧 Liquid Glass เมนูด้านล่าง (Apple Style) */
.mobile-nav-btn {
  -webkit-tap-highlight-color: transparent;
}
.nav-glass-active {
  background: rgba(0, 113, 227, 0.1) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(0, 113, 227, 0.15) !important;
  color: #0071e3 !important;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.7),
    0 4px 12px rgba(0, 113, 227, 0.08) !important;
  transform: translateY(-3px) scale(1.02) !important;
}
.nav-glass-active i {
  color: #0071e3 !important;
  transform: scale(1.1);
}
.nav-glass-active span {
  font-weight: 700 !important;
}

/* 🍏 Desktop Nav Active Highlight (Apple Blue Style) */
.desktop-nav-btn {
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}
.desktop-nav-btn.active-nav {
  color: #0071e3 !important;
  font-weight: 600;
}

/* 🌌 Apple Space Dark Aurora Animation (เฉพาะ Dark Mode) */
@keyframes auroraMove {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  33% {
    transform: translate(60px, -40px) scale(1.15);
  }
  66% {
    transform: translate(-40px, 50px) scale(0.9);
  }
  100% {
    transform: translate(0px, 0px) scale(1);
  }
}

.dark .aurora-orb-1 {
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.25) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  animation: auroraMove 18s ease-in-out infinite;
}

.dark .aurora-orb-2 {
  background: radial-gradient(
    circle,
    rgba(168, 85, 247, 0.22) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  animation: auroraMove 22s ease-in-out infinite reverse;
}

.dark .aurora-orb-3 {
  background: radial-gradient(
    circle,
    rgba(45, 212, 191, 0.2) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  animation: auroraMove 26s ease-in-out infinite 3s;
}

/* 🟢 CSS สำหรับพื้นหลัง Gradient ตารางงาน */
.table-gradient-bg {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f1f5f9 100%);
}

/* รองรับ Dark Mode */
.dark .table-gradient-bg {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #090d16 100%);
}

/* 💧 Apple Liquid Glass Container & Cards (หน้าหลัก) */
.apple-liquid-glass {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(30px) saturate(190%) contrast(105%);
  -webkit-backdrop-filter: blur(30px) saturate(190%) contrast(105%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 20px 50px -10px rgba(0, 0, 0, 0.1),
    0 10px 20px -5px rgba(0, 0, 0, 0.05),
    inset 0 1px 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 3px 0 rgba(0, 0, 0, 0.05),
    inset 0 0 15px 2px rgba(255, 255, 255, 0.35);
}

.dark .apple-liquid-glass {
  background: rgba(28, 28, 30, 0.55);
  backdrop-filter: blur(3px) saturate(200%) brightness(110%);
  -webkit-backdrop-filter: blur(3px) saturate(200%) brightness(110%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 25px 60px -15px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 2px 0 rgba(0, 0, 0, 0.5),
    inset 0 0 20px 1px rgba(255, 255, 255, 0.06);
}

/* 💧 Liquid Glass Card (Interactive Hover) */
.apple-liquid-glass-card {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(5px) saturate(180%);
  -webkit-backdrop-filter: blur(5px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 10px 30px -5px rgba(0, 0, 0, 0.05),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark .apple-liquid-glass-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(5px) saturate(190%);
  -webkit-backdrop-filter: blur(5px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 15px 35px -10px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 2px 0 rgba(0, 0, 0, 0.4);
}

.apple-liquid-glass-card:hover {
  transform: translateY(-4px) scale(1.01);
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 25px 45px -10px rgba(0, 113, 227, 0.15),
    inset 0 1px 2px 0 rgba(255, 255, 255, 1),
    inset 0 0 15px 0 rgba(255, 255, 255, 0.5);
}

.dark .apple-liquid-glass-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow:
    0 25px 50px -10px rgba(0, 0, 0, 0.6),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.4),
    inset 0 0 20px 0 rgba(255, 255, 255, 0.08);
}

/* 💧 Apple Dark Liquid Glass Card (หน้าตารางงาน) */
.banner-liquid-glass-card {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow:
    0 15px 35px -10px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 2px 0 rgba(0, 0, 0, 0.4),
    inset 0 0 15px 0 rgba(255, 255, 255, 0.05) !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.banner-liquid-glass-card:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  box-shadow:
    0 20px 40px -10px rgba(0, 0, 0, 0.6),
    inset 0 1px 1.5px 0 rgba(255, 255, 255, 0.45),
    inset 0 0 20px 0 rgba(255, 255, 255, 0.1) !important;
}

/* 💧 ส่วนกรอกรหัสผ่านเข้าสู่ระบบ */
/* 💧 True Liquid Glass (ตัวกล่องป๊อบอัพ) */
.true-liquid-glass {
  background: rgba(255, 255, 255, 0.15); /* สว่าง: กระจกใส */
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 30px 60px -10px rgba(0, 0, 0, 0.15),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.3);
}

.dark .true-liquid-glass {
  background: rgba(30, 30, 32, 0.4); /* มืด: กระจกสโมก */
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 30px 60px -10px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 2px 0 rgba(0, 0, 0, 0.5);
}

/* 💧 Glass Input (ช่องใส่รหัสผ่าน) */
.glass-input {
  background: rgba(255, 255, 255, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05) !important;
  color: #1d1d1f !important;
}
.dark .glass-input {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3) !important;
  color: #ffffff !important;
}
.glass-input:focus {
  background: rgba(255, 255, 255, 0.6) !important;
  border-color: #3b82f6 !important;
}
.dark .glass-input:focus {
  background: rgba(0, 0, 0, 0.4) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3) !important;
}

/* 💧 Liquid Glass สไตล์ป๊อบอัพประกาศ */
.chat-liquid-glass-modal {
  background: rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(40px) saturate(190%);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow:
    0 30px 60px -10px rgba(0, 0, 0, 0.15),
    inset 0 1px 2px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.dark .chat-liquid-glass-modal {
  background: rgba(24, 24, 26, 0.5) !important;
  backdrop-filter: blur(40px) saturate(200%) brightness(110%);
  -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(110%);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow:
    0 35px 70px -15px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 2px 0 rgba(0, 0, 0, 0.5) !important;
}

/* 💧 Glass Textarea (ช่องพิมพ์ข้อความทรงแก้วใส) */
.chat-glass-textarea {
  background: rgba(245, 245, 247, 0.6) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03) !important;
  transition: all 0.25s ease !important;
}

.dark .chat-glass-textarea {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.chat-glass-textarea:focus {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: #0066cc !important;
  box-shadow: 0 0 15px rgba(0, 102, 204, 0.2) !important;
}

.dark .chat-glass-textarea:focus {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(59, 130, 246, 0.8) !important;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3) !important;
}

/* ล็อคการสกรอลล์หน้าบอร์ดหลักเมื่อเปิด Modal ซ้อนทับ */
body.modal-open {
  overflow: hidden !important;
}

/* 🎞️ อนิเมชัน ไอเดียที่ 2: Audio Waveform & Vintage Film Track */
@keyframes waveBarPulse {
  0%,
  100% {
    transform: scaleY(0.25);
    opacity: 0.3;
  }
  50% {
    transform: scaleY(1);
    opacity: 0.85;
  }
}

@keyframes filmTrackMove {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

@keyframes ambientFilmGlow {
  0%,
  100% {
    opacity: 0.04;
    transform: scale(1);
  }
  50% {
    opacity: 0.09;
    transform: scale(1.02);
  }
}

.animate-wave-bar {
  animation: waveBarPulse 2s ease-in-out infinite;
  transform-origin: bottom;
}

.film-track-anim {
  animation: filmTrackMove 25s linear infinite;
}

.film-ambient-glow {
  animation: ambientFilmGlow 0.2s infinite;
}

/* 📅 Custom Style สำหรับ FullCalendar ให้ดูมินิมอล ไม่ใหญ่เกินไป */
#calendar {
  max-height: none !important; /* ปลดล็อกความสูงให้ปฏิทินยืดลงมาได้จนสุดแถวสุดท้าย */
  height: auto;
}

/* ปรับหัวปฏิทินและปุ่มกด */
.fc .fc-toolbar-title {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: inherit;
}

.fc .fc-button-primary {
  background-color: rgba(0, 113, 227, 0.1) !important;
  border: 1px solid rgba(0, 113, 227, 0.2) !important;
  color: #0071e3 !important;
  border-radius: 9999px !important;
  padding: 0.35rem 0.8rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transition: all 0.2s ease !important;
}

.dark .fc .fc-button-primary {
  background-color: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #38bdf8 !important;
}

.fc .fc-button-primary:hover {
  background-color: #0071e3 !important;
  color: #ffffff !important;
}

.dark .fc .fc-button-primary:hover {
  background-color: #38bdf8 !important;
  color: #000000 !important;
}

/* ปรับแต่งเส้นตารางและป้ายงานภายในช่องวัน */
.fc .fc-scrollgrid {
  border-radius: 1rem !important;
  overflow: hidden !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.dark .fc .fc-scrollgrid {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.fc-daygrid-event {
  border-radius: 0.5rem !important;
  padding: 2px 6px !important;
  font-size: 0.7rem !important;
  margin-top: 2px !important;
  cursor: pointer !important;
}

/* ช่องวันปัจจุบัน */
.fc .fc-day-today {
  background-color: rgba(0, 113, 227, 0.04) !important;
}
.dark .fc .fc-day-today {
  background-color: rgba(56, 189, 248, 0.06) !important;
}

/* 📱 ปรับแต่งปฏิทินสำหรับหน้าจอมือถือ (Mobile Responsive) */
@media (max-width: 768px) {
  #calendar {
    max-height: none !important;
  }
  /* เปลี่ยนจากแถวแนวนอน เป็นการพับบรรทัดแนวตั้ง */
  .fc .fc-scroller-liquid-absolute {
    position: relative !important;
    overflow: visible !important;
  }

  /* จัดกลุ่มปุ่มและหัวข้อให้อยู่กึ่งกลางเสมอ */
  .fc .fc-toolbar-chunk {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
  }

  /* ขยายขนาดชื่อเดือนให้อ่านง่ายขึ้นเมื่ออยู่บรรทัดเดี่ยวๆ */
  .fc .fc-toolbar-title {
    font-size: 1.15rem !important;
  }

  /* ย่อขนาดปุ่มกดลงนิดหน่อยให้พอดีจอมือถือ */
  .fc .fc-button-primary {
    font-size: 0.7rem !important;
    padding: 0.35rem 0.6rem !important;
  }

  /* ย่อขนาดตัวอักษรหัวตาราง (จันทร์, อังคาร...) ป้องกันข้อความล้นเบียดกัน */
  .fc .fc-col-header-cell-cushion {
    font-size: 0.7rem !important;
  }

  /* ย่อตัวเลขวันที่ */
  .fc .fc-daygrid-day-number {
    font-size: 0.75rem !important;
    padding: 4px !important;
  }
}

/* ==========================================
         📅 แปลงร่าง FullCalendar ให้เป็นสไตล์ SCSS แบบต้นฉบับ
         ========================================== */

/* 1. เส้นขอบตาราง (สีเทาอ่อนแบบในโค้ด) */
.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
  border-color: rgba(166, 168, 179, 0.2) !important;
}

/* 2. หัวตาราง (จันทร์, อังคาร...) - ตัวพิมพ์ใหญ่, สีเทา, จัดกึ่งกลาง */
.fc .fc-col-header-cell-cushion {
  color: #232323 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  padding: 14px 0 !important;
  letter-spacing: 1px;
}

/* 3. ตัวเลขวันที่ - สีเทา, มี Padding */
.fc .fc-daygrid-day-number {
  color: #232323 !important;
  font-size: 12px !important;
  padding: 10px 14px !important;
  letter-spacing: 1px;
  font-weight: 500 !important;
}

/* โหมดมืดสำหรับตัวอักษรและตัวเลขวันที่ */
.dark .fc .fc-daygrid-day-number,
.dark .fc .fc-col-header-cell-cushion {
  color: #e4e5e8 !important;
}

/* 4. วันที่ไม่ได้อยู่ในเดือนนี้ (Disabled Day) - ใส่ลายเส้น SVG แบบต้นฉบับ */
.fc .fc-day-other {
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f9f9fa' fill-opacity='1' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E") !important;
}

/* โหมดมืดสำหรับลายเส้น */
.dark .fc .fc-day-other {
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.02' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E") !important;
}

/* 5. สไตล์ของการ์ดงาน (Task Events) - เน้นเส้นขอบซ้ายหนาๆ แบบในโค้ด */
.fc-daygrid-event {
  border-radius: 2px 6px 6px 2px !important; /* เหลี่ยมฝั่งซ้าย มนฝั่งขวา */
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-left-width: 4px !important;
  border-left-style: solid !important;
  padding: 4px 8px !important;
  margin: 4px 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  opacity: 0.95; /* ปรับโปร่งแสงนิดหน่อยให้ดูสมูท */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

/* 🎬 เอฟเฟกต์ซูมภาพพื้นหลังเข้า-ออกช้าๆ สไตล์ Cinematic */
@keyframes cinematicZoom {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.animate-cinematic-bg {
  animation: cinematicZoom 30s ease-in-out infinite;
  will-change: transform;
}

/* 🌟 ขั้นตอนที่ 4: เอฟเฟกต์ไฮไลต์การ์ดหลังจากปิดพรีวิววิดีโอ */
@keyframes cardHighlightGlow {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 113, 227, 0);
  }
  50% {
    box-shadow: 0 0 35px rgba(0, 113, 227, 0.6);
    border-color: rgba(0, 113, 227, 1);
    transform: scale(1.03);
  }
}
.dark .card-highlight-active {
  animation: cardHighlightGlowDark 2s ease-in-out;
  z-index: 50;
}
@keyframes cardHighlightGlowDark {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.4);
    border-color: rgba(56, 189, 248, 0.8);
    transform: scale(1.03);
  }
}
.card-highlight-active {
  animation: cardHighlightGlow 2s ease-in-out;
  z-index: 50;
}

/* ไฟปุ่มส่งตรวจสอบ */
/* ✨ แอนิเมชันแสงปาด (Shine Effect) วนลูปทุก 5 วินาที */
@keyframes shine-sweep {
  0% {
    transform: translateX(-150%) skewX(-45deg);
  }
  65% {
    /* ปาดแสงให้เสร็จภายในเวลาประมาณ 0.75 วินาที (15% ของ 5 วิ) */
    transform: translateX(250%) skewX(-45deg);
  }
  100% {
    /* หยุดรอแสงอยู่ขวาขอบจอจนครบ 5 วินาทีแล้วค่อยเริ่มใหม่ */
    transform: translateX(250%) skewX(-45deg);
  }
}

.animate-shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  /* สร้างเส้นแสงสีขาวตรงกลาง และไล่สีให้ขอบจางลง */
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shine-sweep 5s infinite;
  pointer-events: none; /* ป้องกันไม่ให้เลเยอร์แสงไปบล็อกการคลิกของกล่อง */
  z-index: 10;
}

/* ==========================================
   📅 FULLCALENDAR: GOOGLE CALENDAR THEME
   ========================================== */

/* ------------------------------------------
   1. ส่วนควบคุมหลัก (Toolbar & Buttons)
   ------------------------------------------ */
/* ปรับข้อความวันที่ตรงกลางหัวปฏิทินหลัก */
#calendar .fc-toolbar-title {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  color: #3c4043 !important;
}
.dark #calendar .fc-toolbar-title {
  color: #e8eaed !important;
}

/* ดีไซน์ปุ่มทั่วไป และปุ่ม "วันนี้" */
.fc .fc-button-primary {
  background-color: #ffffff !important;
  border: 1px solid #dadce0 !important;
  color: #303030 !important;
  border-radius: 9999px !important; /* ทรงแคปซูล/โค้งมน */
  padding: 6px 16px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  text-transform: capitalize;
  transition: all 0.2s ease;
}
.fc .fc-button-primary:hover {
  background-color: #d9d9d9 !important;
  color: #303030 !important;
  border-color: #dadce0 !important;
}
.fc .fc-button-primary:focus,
.fc .fc-button-primary:not(:disabled):active:focus {
  box-shadow: none !important; /* เอาเส้นขอบโฟกัสออก */
}

/* ดีไซน์เฉพาะปุ่มลูกศร < > (วงกลม) */
.fc .fc-prev-button,
.fc .fc-next-button {
  background-color: transparent !important;
  border: none !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-left: 8px !important;
}
.fc .fc-prev-button:hover,
.fc .fc-next-button:hover {
  background-color: rgba(60, 64, 67, 0.08) !important;
}

/* 🌙 ปุ่มใน Dark Mode */
.dark .fc .fc-button-primary {
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #e8eaed !important;
}
.dark .fc .fc-button-primary:hover,
.dark .fc .fc-prev-button:hover,
.dark .fc .fc-next-button:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* ------------------------------------------
   2. มุมมองปฏิทินหลัก (Main Grid & Days)
   ------------------------------------------ */
/* เส้นตาราง (Grid) */
.fc .fc-scrollgrid,
.fc .fc-scrollgrid td,
.fc .fc-scrollgrid th {
  border-color: #dadce0 !important;
}
.dark .fc .fc-scrollgrid,
.dark .fc .fc-scrollgrid td,
.dark .fc .fc-scrollgrid th {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* หัวตาราง (จันทร์, อังคาร...) */
.fc .fc-col-header-cell-cushion {
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: #70757a !important;
  text-decoration: none !important;
  padding: 8px 0 !important;
}
.dark .fc .fc-col-header-cell-cushion {
  color: #9aa0a6 !important;
}

/* ตัวเลขวันที่ปกติ */
.fc .fc-daygrid-day-top {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.fc .fc-daygrid-day-number {
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  color: #3c4043;
  text-decoration: none !important;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  margin: 0 auto;
  transition: background-color 0.2s;
}
.dark .fc .fc-daygrid-day-number {
  color: #e8eaed;
}

/* วันที่นอกเดือนปัจจุบัน (จางลง) */
.fc .fc-day-other {
  background: transparent !important;
}
.fc .fc-day-other .fc-daygrid-day-top {
  opacity: 0.4;
}

/* ไฮไลต์ "วันนี้" */
.fc .fc-day-today {
  background-color: transparent !important;
}
.fc .fc-day-today .fc-daygrid-day-number {
  background-color: #1a73e8 !important;
  color: #ffffff !important;
  font-weight: bold !important;
}
.dark .fc .fc-day-today .fc-daygrid-day-number {
  background-color: #8ab4f8 !important;
  color: #202124 !important;
}

/* ป้ายงาน (Event Pills) */
.fc .fc-daygrid-event {
  border-radius: 4px !important;
  padding: 2px 6px !important;
  margin: 1px 6px !important;
  border: none !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.fc .fc-event-title {
  font-weight: 500 !important;
}

/* ------------------------------------------
   3. มุมมอง "กำหนดการ" (List View)
   ------------------------------------------ */
/* จัดการกรอบตารางโดยรวม */
.dark .fc .fc-list {
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* แถบหัวข้อวันที่ */
.fc .fc-list-day-cushion {
  padding: 8px 16px !important;
  background-color: #f8f9fa !important;
}
.fc .fc-list-day-text,
.fc .fc-list-day-side-text {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #3c4043 !important;
}
.dark .fc .fc-list-day-cushion {
  background-color: #2c2c2e !important;
}
.dark .fc .fc-list-day-text,
.dark .fc .fc-list-day-side-text {
  color: #e8eaed !important;
}

/* แถวรายการงาน (Events) */
.fc .fc-list-event {
  cursor: pointer !important;
}
.fc .fc-list-event td {
  padding: 10px 16px !important;
}
.dark .fc .fc-list-event td {
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* รายละเอียดงาน (เวลา และ ชื่องาน) */
.fc .fc-list-event-time {
  font-size: 0.8rem !important;
  color: #70757a !important;
}
.fc .fc-list-event-title {
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  color: #202124 !important;
}
.dark .fc .fc-list-event-time {
  color: #9aa0a6 !important;
}
.dark .fc .fc-list-event-title {
  color: #e8eaed !important;
}

/* เอฟเฟกต์ Hover รายการงาน */
.fc .fc-list-event:hover td {
  background-color: #e7e9ea !important;
  transition: background-color 0.2s ease;
}
.dark .fc .fc-list-event:hover td {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* สีข้อความตอนไม่มีงาน (Empty State) */
.dark .fc .fc-list-empty {
  background-color: transparent !important;
  color: #9aa0a6 !important;
}

/* ------------------------------------------
   4. มุมมองรายสัปดาห์/วัน (Time Grid Axis)
   ------------------------------------------ */
.fc .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-axis-cushion {
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  color: #3a3c3f !important;
  padding: 4px 8px !important;
}
.dark .fc .fc-timegrid-slot-label-cushion,
.dark .fc .fc-timegrid-axis-cushion {
  color: #b3bac1 !important;
}

/* ------------------------------------------
   5. ปฏิทินจิ๋วแถบซ้าย (Mini Calendar)
   ------------------------------------------ */
/* เคลียร์ขอบและซ่อนการ์ดงาน */
#miniCalendar .fc-theme-standard td,
#miniCalendar .fc-theme-standard th,
#miniCalendar .fc-theme-standard .fc-scrollgrid {
  border: none !important;
}
#miniCalendar .fc-daygrid-event-harness {
  display: none !important;
}

/* หัวปฏิทินและปุ่ม */
#miniCalendar .fc-toolbar-title {
  font-size: 0.9rem !important;
  font-weight: 600;
  color: #3c4043;
}
.dark #miniCalendar .fc-toolbar-title {
  color: #e8eaed;
}
#miniCalendar .fc-button {
  padding: 0.2em 0.4em !important;
  background: transparent !important;
  border: none !important;
  color: #5f6368 !important;
  box-shadow: none !important;
}
#miniCalendar .fc-button:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

/* หัวตาราง (อา, จ, อ...) */
#miniCalendar .fc-col-header-cell-cushion {
  font-size: 0.7rem !important;
  font-weight: normal !important;
  color: #70757a !important;
  padding: 4px 0 !important;
}
.dark #miniCalendar .fc-col-header-cell-cushion {
  color: #9aa0a6 !important;
}

/* กรอบช่องและตัวเลขวันที่ */
#miniCalendar .fc-daygrid-day-frame {
  min-height: 30px !important;
  height: 50px !important; /* ถ้าใช้ความสูงนี้ทรงอาจจะยาวลงมา ปรับเป็น 30px ได้ถ้าต้องการให้เป็นสี่เหลี่ยมจัตุรัส */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#miniCalendar .fc-daygrid-day-number {
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  margin: 2px auto !important;
}

/* ไฮไลต์ "วันนี้" ของปฏิทินเล็ก */
#miniCalendar .fc-day-today .fc-daygrid-day-number {
  background-color: #1a73e8 !important;
  color: white !important;
  border-radius: 50% !important;
}

/* จัดกรอบที่ครอบตัวเลขให้กว้าง 100% และดันเนื้อหาให้อยู่กึ่งกลางเสมอ */
#miniCalendar .fc-daygrid-day-top {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  padding: 0 !important; /* ล้างระยะขอบที่อาจดันให้เบี้ยว */
}

/* ล้างระยะ Margin เดิม และบังคับให้ข้อความอยู่กลางวงกลม */
#miniCalendar .fc-daygrid-day-number {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ==========================================
   🎨 เพิ่มลูกเล่นสีสันและแอนิเมชันให้ปฏิทิน
   ========================================== */

/* ------------------------------------------
   1. แยกสีพื้นหลังวันหยุด (เสาร์-อาทิตย์)
   ------------------------------------------ */
/* โหมดสว่าง: ใช้สีเทาอมฟ้าสว่างๆ สบายตา */
#calendar .fc-day-sat,
#calendar .fc-day-sun {
  background-color: #ffeaea !important;
}

/* โหมดมืด: ใช้สีเทาสว่างขึ้นมานิดนึงจากพื้นหลังเดิม */
.dark #calendar .fc-day-sat,
.dark #calendar .fc-day-sun {
  background-color: rgba(131, 47, 47, 0.26) !important;
}

#miniCalendar .fc-day-sat,
#miniCalendar .fc-day-sun {
  background-color: #ffeaea !important;
}

/* โหมดมืด: ใช้สีเทาสว่างขึ้นมานิดนึงจากพื้นหลังเดิม */
.dark #miniCalendar .fc-day-sat,
.dark #miniCalendar .fc-day-sun {
  background-color: rgba(131, 47, 47, 0.26) !important;
}

/* ------------------------------------------
   2. แอนิเมชัน Hover การ์ดงาน (Motion UI)
   ------------------------------------------ */
/* ตั้งค่าความสมูท (Transition) ให้การ์ดงานทุกตัว */
.fc .fc-daygrid-event {
  transition:
    transform 0.2s ease,
    filter 0.2s ease,
    box-shadow 0.2s ease !important;
  cursor: pointer !important;
  position: relative; /* เผื่อให้ Z-index ทำงาน */
}

/* เอฟเฟกต์ตอนเอาเมาส์ไปชี้ (Hover) */
.fc .fc-daygrid-event:hover {
  transform: scale(1.04) translateY(-1px) !important; /* ขยายขนาดขึ้น 4% และลอยขึ้นนิดนึง */
  filter: brightness(1.15) !important; /* ดันสีให้สว่างเรืองแสงขึ้น 15% */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important; /* เพิ่มเงาให้ดูมีมิติเด้งออกมา */
  z-index: 10 !important; /* ดันการ์ดให้อยู่หน้าสุด จะได้ไม่โดนการ์ดอื่นบังตอนขยาย */
}

/* ปรับเงาสำหรับโหมดมืดให้เข้ากับธีม */
.dark .fc .fc-daygrid-event:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4) !important;
}

/* ==========================================
   📊 สถิติคิวงานประจำเดือน (Monthly Stats)
   ========================================== */
.monthly-stats-container {
  margin-top: 24px;
  padding: 16px;
  background-color: #f8f9fa; /* สีเทาอ่อนสบายตา แยกสัดส่วนจากปฏิทิน */
  border-radius: 12px;
  border: 1px solid #dadce0;
}
.dark .monthly-stats-container {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.1);
}
.stats-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #5f6368;
  margin: 0 0 8px 0;
}
.dark .stats-title {
  color: #9aa0a6;
}

.stats-total {
  font-size: 1rem;
  font-weight: 500;
  color: #1a73e8; /* สีน้ำเงินไฮไลต์ของ Google */
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.stats-total span {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}
.dark .stats-total {
  color: #8ab4f8;
}

.stats-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8rem;
  color: #3c4043;
}
.dark .stats-list {
  color: #e8eaed;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #dadce0;
}
.dark .stats-list li {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.stats-list li:last-child {
  border-bottom: none;
}

/* ==========================================
   🟢 ซ่อนพื้นที่สำหรับใส่ Event ในปฏิทินเล็กให้หมดเกลี้ยง
   ========================================== */
/* ซ่อนกล่องคอนเทนเนอร์งานและกล่องด้านล่างทิ้ง เพื่อไม่ให้แย่งพื้นที่ตัวเลข */
#miniCalendar .fc-daygrid-day-events,
#miniCalendar .fc-daygrid-day-bottom {
  display: none !important;
}

/* บังคับให้กรอบตัวเลขขยายเต็มช่องและอยู่ตรงกลาง 100% */
#miniCalendar .fc-daygrid-day-top {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  height: 100% !important;
  flex-direction: column; /* กันข้อความเบี้ยวแกน Y */
}

/* ==========================================
   🎨 ตกแต่ง Scrollbar ฝั่งซ้ายให้ดูมินิมอล
   ========================================== */
.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1; /* สีเทาอ่อน */
  border-radius: 10px;
}
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: #475569; /* สีเทาเข้มสำหรับโหมดมืด */
}

/* ==========================================
   🚫 ซ่อน Scrollbar ส่วนเกินในช่อง "ตลอดวัน" (All-Day)
   ========================================== */
.fc .fc-timegrid-allday .fc-scroller {
  overflow-y: hidden !important;
}

/* 🎨 ปรับ Scrollbar ของตารางเวลาด้านล่างให้เป็นเส้นบางๆ สไตล์มินิมอล (เข้ากับแถบซ้าย) */
.fc .fc-scroller::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.fc .fc-scroller::-webkit-scrollbar-track {
  background: transparent;
}
.fc .fc-scroller::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}
.dark .fc .fc-scroller::-webkit-scrollbar-thumb {
  background-color: #475569;
}

/* ==========================================
   🎨 CSS Variables สำหรับสีประเภทงาน (รองรับ Dark Mode ในตัว)
   ========================================== */
:root {
  /* โทนฟ้า (คลิปวิดีโอ) */
  --job-video-bg: #edf4fd;
  --job-video-border: #c6ddfc;
  --job-video-text: #1446e2;
  /* โทนม่วง (Mahajak Academy) */
  --job-academy-bg: #f8f3fd;
  --job-academy-border: #ecdafe;
  --job-academy-text: #8100d9;
  /* โทนเหลือง/ส้ม (งานอีเวนต์/ระบบภาพ) */
  --job-event-bg: #fdf9e9;
  --job-event-border: #fce899;
  --job-event-text: #ba4c00;
  /* โทนเขียวมิ้นต์ (งานภายในบริษัท) */
  --job-internal-bg: #e8f9f1;
  --job-internal-border: #aff2d4;
  --job-internal-text: #007854;
  /* โทนเทา (Default) */
  --job-default-bg: #f8fafc;
  --job-default-border: #e2e8f0;
  --job-default-text: #475569;
}

.dark {
  /* โทนฟ้า (คลิปวิดีโอ) */
  --job-video-bg: #172554;
  --job-video-border: #1e3a8a;
  --job-video-text: #93c5fd;
  /* โทนม่วง (Mahajak Academy) */
  --job-academy-bg: #3b0764;
  --job-academy-border: #581c87;
  --job-academy-text: #d8b4fe;
  /* โทนเหลือง/ส้ม (งานอีเวนต์/ระบบภาพ) */
  --job-event-bg: #422006;
  --job-event-border: #713f12;
  --job-event-text: #fcd34d;
  /* โทนเขียวมิ้นต์ (งานภายในบริษัท) */
  --job-internal-bg: #022c22;
  --job-internal-border: #064e3b;
  --job-internal-text: #6ee7b7;
  /* โทนเทา (Default) */
  --job-default-bg: #1e293b;
  --job-default-border: #334155;
  --job-default-text: #cbd5e1;
}

/* ==========================================
   🖱️ ปรับแต่งปฏิทินเล็ก (Mini Calendar) ให้เป็น Date Picker
   ========================================== */

/* 1. เปลี่ยนเมาส์เป็นรูปมือ และทำเอฟเฟกต์ Hover เมื่อชี้ช่องวันที่ */
#miniCalendar .fc-daygrid-day {
  cursor: pointer !important;
  transition: background-color 0.2s ease;
}

#miniCalendar .fc-daygrid-day:hover {
  background-color: rgba(0, 113, 227, 0.08) !important;
}
.dark #miniCalendar .fc-daygrid-day:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* 2. ดีไซน์ไฮไลต์ "วันที่ถูกคลิก" (Selected Date) */
#miniCalendar .fc-daygrid-day.selected-date .fc-daygrid-day-number {
  background-color: #b3dbf5 !important; /* สีน้ำเงิน Apple */
  color: #383838 !important;
  border-radius: 50% !important;
  transform: scale(1.1); /* เด้งขยายขึ้นนิดนึง */
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark #miniCalendar .fc-daygrid-day.selected-date .fc-daygrid-day-number {
  background-color: #38bdf8 !important; /* สีฟ้าสว่าง สำหรับโหมดมืด */
  color: #000000 !important;
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.4) !important;
}

/* ==========================================
   📦 ตกแต่งกล่อง Pop-up ดูงานที่ซ่อนไว้ (+X งาน)
   ========================================== */
.fc-theme-standard .fc-popover {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 16px !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
  overflow: hidden;
}
.dark .fc-theme-standard .fc-popover {
  background-color: rgba(28, 28, 30, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6) !important;
}
.fc-theme-standard .fc-popover-header {
  background-color: transparent !important;
  padding: 12px 16px !important;
  font-weight: bold !important;
  font-size: 0.85rem;
}
.fc-theme-standard .fc-popover-body {
  padding: 8px 12px 12px 12px !important;
}
/* เปลี่ยนสีลิงก์ +X งาน และจัดให้อยู่กึ่งกลาง */
.fc-daygrid-more-link {
  display: block !important;
  text-align: center !important;
  width: 100% !important;
  color: #1a73e8 !important;
  font-weight: 800 !important;
  font-size: 0.75rem;
  transition: opacity 0.2s;
  margin-top: 2px !important; /* เพิ่มระยะห่างจากการ์ดด้านบนนิดนึง */
}

.fc-daygrid-more-link:hover {
  opacity: 0.7;
}

.dark .fc-daygrid-more-link {
  color: #38bdf8 !important;
}

/* ==========================================
   🖱️ สไตล์แถบไฮไลต์ตอนลากคลุมวันที่ (Drag Select)
   ========================================== */
#miniCalendar .fc-highlight {
  background-color: rgba(0, 113, 227, 0.2) !important; /* สีน้ำเงิน Apple */
  border-radius: 50px !important; /* บังคับทรงแคปซูล */

  /* 🟢 บีบความสูงให้เล็กลง และให้อยู่กึ่งกลางแนวตั้ง */
  top: 10px !important;
  bottom: 10px !important;

  /* 🟢 หดความกว้างหัว-ท้าย เข้ามานิดนึง จะได้ไม่ชนขอบตาราง */
  margin-left: 5px !important;
  margin-right: 5px !important;
}

.dark #miniCalendar .fc-highlight {
  background-color: rgba(
    56,
    189,
    248,
    0.3
  ) !important; /* สีฟ้าสว่างสำหรับโหมดมืด */
}

/* ลบเส้นขอบสีเทาของระบบเก่าออก */
#miniCalendar .fc-theme-standard .fc-highlight {
  border: none !important;
}

/* Preview left panel scrollbar */
.preview-auto-scroll {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.preview-auto-scroll::-webkit-scrollbar {
  width: 6px;
}

.preview-auto-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.preview-auto-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.preview-auto-scroll:hover {
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

.preview-auto-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
}

.preview-auto-scroll:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.65);
}

.preview-hidden-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.preview-hidden-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ==========================================
   🔘 Edit Modal Tabs: ลบกรอบ Focus สีดำ
   ========================================== */
#editTabNav button:focus,
#editTabNav button:focus-visible,
#editTabNav button:active {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}
