/* ===== Display Page — ระบบบริหารคิว ===== */

body {
  background: #1a202c;
  color: #fff;
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

.container {
  max-width: 1400px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* ---- Header ---- */
header {
  text-align: center;
  padding: 16px 0 24px;
}

header h1 {
  font-size: 32px;
  color: #fff;
  letter-spacing: 2px;
}

header p {
  color: #a0aec0;
  font-size: 16px;
  margin-top: 4px;
}

/* ---- Queue Grid ---- */
.queue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.queue-section {
  background: #2d3748;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.queue-section-header {
  padding: 20px 24px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.section-domestic .queue-section-header {
  background: linear-gradient(135deg, #2b6cb0, #3182ce);
  color: #fff;
}

.section-international .queue-section-header {
  background: linear-gradient(135deg, #b7791f, #d69e2e);
  color: #fff;
}

.section-foreign .queue-section-header {
  background: linear-gradient(135deg, #c53030, #e53e3e);
  color: #fff;
}

.queue-section-header .count {
  display: block;
  font-size: 20px;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 4px;
}

.queue-list {
  padding: 16px 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.queue-list::-webkit-scrollbar {
  width: 6px;
}
.queue-list::-webkit-scrollbar-track {
  background: transparent;
}
.queue-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}
.queue-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.35);
}

.queue-item {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 8px;
  border-radius: 12px;
  background: #4a5568;
  min-height: 80px;
}

.queue-item .number {
  font-size: 32px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  padding-left: 12px;
}

.btn-done {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #a0aec0;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-right: 4px;
  white-space: nowrap;
}

.btn-done:hover {
  background: #48bb78;
  color: #fff;
}

.queue-empty {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #718096;
  font-size: 18px;
}

.queue-empty .big {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #2d3748;
  border-radius: 16px;
  padding: 24px 32px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.modal-box h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #fff;
}

.modal-box .queue-label {
  font-size: 12px;
  color: #a0aec0;
  margin-bottom: 2px;
}

.modal-box .highlight {
  color: #fff;
  font-weight: 700;
  font-size: 52px;
  display: block;
  line-height: 1.4;
  padding: 8px 0;
  margin-bottom: 4px;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
}

.modal-box .queue-type {
  font-size: 14px;
  color: #a0aec0;
  display: block;
  margin-bottom: 16px;
}

.modal-box .warning-text {
  font-size: 12px;
  color: #fc8181;
  line-height: 1.4;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-cancel,
.btn-confirm {
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-weight: 600;
  min-width: 100px;
}

.btn-cancel:active,
.btn-confirm:active {
  transform: scale(0.97);
}

.btn-cancel {
  background: transparent;
  color: #a0aec0;
  border: 1px solid #4a5568;
}

.btn-cancel:hover {
  border-color: #718096;
  color: #cbd5e0;
}

.btn-confirm {
  background: linear-gradient(135deg, #2b6cb0, #3182ce);
  color: #fff;
}

.btn-confirm:hover {
  background: linear-gradient(135deg, #2c5282, #2b6cb0);
}

/* ---- Fullscreen Loading ---- */
.loading-overlay {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #4a5568;
  font-size: 18px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #4a5568;
  border-top-color: #4299e1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Status Bar ---- */
.status-bar {
  text-align: center;
  margin-top: 20px;
  padding: 12px;
  font-size: 13px;
  color: #4a5568;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .queue-grid { grid-template-columns: 1fr; }
  header h1 { font-size: 24px; }
  .queue-item .number { font-size: 22px; }
}
