/* ===== SPLASH SCREEN ===== */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s ease;
}

#splash-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

#splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ========================= */

/* ซ่อน Splash บน PC (จอกว้างกว่า 768px) */
@media (min-width: 768px) {
  #splash-screen {
    display: none !important;
  }
}

html,
body {
  overflow-x: hidden;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE and Edge */
}

body::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

body {
  background: radial-gradient(circle at top left, #3b82f6 0, transparent 55%),
    radial-gradient(circle at bottom right, #a855f7 0, #020617 55%);
  color: #e5e7eb;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.glass-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 64, 175, 0.85));
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(18px);
}

.page-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 64, 175, 0.85));
  border-radius: 16px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.9);
}

/* Specific Light Card for History Page only */
.light-card {
  background: #ffffff !important;
  color: #1e293b !important;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.light-card .table {
  color: #1e293b !important;
}

.light-card .text-muted {
  color: #64748b !important;
}

.light-card .text-secondary {
  color: #475569 !important;
}

.light-card thead th {
  background-color: #f1f5f9;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.navbar {
  background-color: rgba(15, 23, 42, 0.8) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand,
.nav-link {
  color: #cbd5e1 !important;
}

.nav-link.active {
  color: #ffffff !important;
  font-weight: 600;
}

.form-control,
.form-select {
  background-color: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.8);
  color: #e5e7eb;
}

.form-control::placeholder {
  color: rgba(209, 213, 219, 0.8);
}

.form-label,
.form-check-label {
  color: #e5e7eb;
  font-weight: 500;
}

.form-control:focus,
.form-select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 0.15rem rgba(79, 70, 229, 0.5);
}

.btn-primary {
  background: linear-gradient(90deg, #6366f1, #ec4899);
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.alert {
  border-radius: 999px;
}

.text-muted {
  color: rgba(209, 213, 219, 0.7) !important;
}

.text-secondary {
  color: rgba(209, 213, 219, 0.9) !important;
}

.form-text {
  color: rgba(209, 213, 219, 0.75);
}

/* Image Thumbnails */
.thumb-16x9 {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.8);
}

.thumb-wrapper {
  position: relative;
}

.thumb-remove-btn {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.85);
  color: #f97373;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.9);
}

.thumb-remove-btn:hover {
  background: rgba(30, 64, 175, 0.95);
  color: #fecaca;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Floating Flash Notifications (Toasts) */
.flash-container {
  position: fixed;
  top: 85px;
  right: 20px;
  z-index: 10000;
  width: 100%;
  max-width: 380px;
  pointer-events: none;
}

.flash-container .alert {
  pointer-events: auto;
  margin-bottom: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 12px;
  background-color: rgba(15, 23, 42, 0.85);
  /* Dark base for better glass effect */
  color: #fff;
  overflow: hidden;
}

.flash-container .alert-success {
  border-left: 6px solid #22c55e;
}

.flash-container .alert-danger {
  border-left: 6px solid #ef4444;
}

.flash-container .alert-warning {
  border-left: 6px solid #f59e0b;
}

.flash-container .alert-info {
  border-left: 6px solid #3b82f6;
}

.flash-container .btn-close {
  filter: invert(1);
  /* Make close button white */
}