/* ==========================================================================
   หลับครบจบเพลีย (LabKrob) - Stylesheet
   Theme: Low Blue-Light Night Palette & Frosted Glassmorphism
   ========================================================================== */

:root {
  /* Warm Night Palette (Low Blue Light / Soothing Ambiance) */
  --bg-deep: #070a12;
  --bg-surface: #0e1424;
  --bg-card: rgba(20, 27, 45, 0.65);
  --bg-card-hover: rgba(28, 38, 65, 0.75);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-focus: rgba(245, 158, 11, 0.4);
  
  /* Accent Colors (Warm Amber / Moonlight / Soft Lavender / Calming Emerald) */
  --amber-warm: #f59e0b;
  --amber-light: #fbbf24;
  --amber-glow: rgba(245, 158, 11, 0.25);
  --moon-indigo: #818cf8;
  --moon-purple: #c084fc;
  --calm-emerald: #34d399;
  --rose-gentle: #fb7185;
  
  /* Text */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Blur standard */
  --glass-blur: blur(16px);
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Lighting & Twinkling Stars */
.ambient-bg,
.ambient-bg *,
#starfieldCanvas,
.ambient-blob-1,
.ambient-blob-2,
.ambient-blob-3 {
  pointer-events: none !important;
  user-select: none !important;
}

.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -10 !important;
  overflow: hidden;
}

#starfieldCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ambient-blob-1 {
  position: absolute;
  top: -10%;
  left: 15%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.12) 0%, rgba(129, 140, 248, 0) 70%);
  filter: blur(60px);
  animation: floatSlow 18s ease-in-out infinite alternate;
}

.ambient-blob-2 {
  position: absolute;
  top: 40%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0) 70%);
  filter: blur(70px);
  animation: floatSlow 22s ease-in-out infinite alternate-reverse;
}

.ambient-blob-3 {
  position: absolute;
  bottom: -10%;
  left: 30%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.09) 0%, rgba(192, 132, 252, 0) 70%);
  filter: blur(60px);
  animation: floatSlow 20s ease-in-out infinite alternate;
}

@keyframes floatSlow {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, 20px) scale(1.05); }
  100% { transform: translate(-20px, -25px) scale(0.95); }
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: 1.25rem;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel-hover:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.5),
              0 0 15px rgba(245, 158, 11, 0.08);
}

.glass-input {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-radius: 0.75rem;
  padding: 0.65rem 1rem;
  transition: all 0.2s ease;
  outline: none;
}

.glass-input:focus {
  background: rgba(15, 23, 42, 0.85);
  border-color: var(--amber-warm);
  box-shadow: 0 0 0 3px var(--amber-glow);
}

.glass-btn {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: 0.75rem;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.glass-btn-primary {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fff;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}

.glass-btn-primary:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
}

/* Star Rating */
.star-rating button {
  transition: transform 0.15s ease, color 0.15s ease;
}
.star-rating button:hover {
  transform: scale(1.2);
}

/* Breathing Circle Animation (4-7-8 Relaxation) */
.breathing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.breathing-circle {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  padding: 1.25rem;
  text-align: center;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.35) 0%, rgba(245, 158, 11, 0.1) 70%);
  border: 2px solid rgba(129, 140, 248, 0.4);
  box-shadow: 0 0 35px rgba(129, 140, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease-out;
}

.breathing-circle.inhale {
  transform: scale(1.35);
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.4);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, rgba(129, 140, 248, 0.2) 70%);
}

.breathing-circle.hold {
  transform: scale(1.35);
  border-color: rgba(192, 132, 252, 0.7);
  box-shadow: 0 0 50px rgba(192, 132, 252, 0.4);
}

.breathing-circle.exhale {
  transform: scale(0.95);
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 25px rgba(52, 211, 153, 0.2);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.4);
}

/* Tag / Chip Pills */
.name-chip {
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.name-chip:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--amber-warm);
  color: #fff;
  transform: scale(1.05);
}

.name-chip.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: var(--amber-warm);
  color: var(--amber-light);
  font-weight: 600;
}

/* Modal Transitions & Safeguard against click blocking */
.modal-backdrop {
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-backdrop.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.modal-backdrop:not(.hidden) {
  display: flex !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Tooltip / Badges */
.badge-success {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(251, 113, 133, 0.15);
  color: #fb7185;
  border: 1px solid rgba(251, 113, 133, 0.3);
}

.badge-info {
  background: rgba(129, 140, 248, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.3);
}

/* ==========================================================================
   Rolling Member Marquee ("สิบคนโอบ") - Infinite Smooth Scroll
   ========================================================================== */
@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.marquee-container {
  overflow: hidden;
  position: relative;
  width: 100%;
  padding: 0.5rem 0;
  mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}

.marquee-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: marqueeScroll 30s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

.member-rolling-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(20, 27, 45, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
  cursor: default;
}

.member-rolling-card:hover {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(30, 41, 68, 0.85);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.2);
  transform: translateY(-2px) scale(1.03);
}

/* Hide default calendar/clock icons in WebKit (Safari/iOS) to prevent overlapping centered text */
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  display: none !important;
  -webkit-appearance: none !important;
}
