@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  font-family: 'Prompt', sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  overflow: hidden;
}

body {
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 188, 140, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 123, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255, 193, 7, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

main, .container, [role="main"] {
  position: relative;
  z-index: 1;
}

.footer {
  background: linear-gradient(90deg, #00bc8c, #00a376) !important;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 4s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(50%); }
}

iframe {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.marquee,
.marquee-with-options,
.marquee-vert-before,
.marquee-vert {
  width: 100%;
  overflow: hidden;
}

.card {
  border: none !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card .card-header {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.2) !important;
}

.card.bg-success {
  background: linear-gradient(145deg, #00bc8c, #009a73) !important;
}

.card.bg-warning {
  background: linear-gradient(145deg, #f39c12, #e67e22) !important;
}

.card.bg-danger {
  background: linear-gradient(145deg, #e74c3c, #c0392b) !important;
}

.card.bg-info {
  background: linear-gradient(145deg, #3498db, #2980b9) !important;
}

.card-body {
  padding: 0.75rem 1rem;
}

.queue-number {
  font-size: 4.8vh;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.queue-number-sm {
  font-size: 3vh;
  font-weight: 500;
  letter-spacing: 1px;
}

.list-group-item.active {
  background-color: #00bc8c;
  color: white;
  border-color: #00bc8c;
}

.box {
  min-height: 48vh;
}

.box-head {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.box-head::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 188, 140, 0.1) 0%, transparent 60%);
  animation: rotateGlow 10s linear infinite;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.box-detail {
  font-size: 2.5vh;
  font-weight: 600;
  position: absolute;
  top: 50%;
  left: 50%;
  text-align: center;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Queue row styles */
#currentList .row,
#nextQueueList .row {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.3s ease;
}

#currentList .row:last-child,
#nextQueueList .row:last-child {
  border-bottom: none;
}

#currentList .row.bg-danger {
  background: linear-gradient(90deg, rgba(231, 76, 60, 0.9), rgba(192, 57, 43, 0.9)) !important;
  border-radius: 10px;
  margin: 0.3rem 0;
  padding: 0.5rem 0.75rem !important;
  animation: pulseGlow 2s ease-in-out infinite;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 35px rgba(231, 76, 60, 0.7);
    border-color: rgba(255, 255, 255, 0.6);
  }
}

/* Alert/Error styles */
#alertErrorMqtt {
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Button styling */
.btn-lg {
  border-radius: 12px !important;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: linear-gradient(135deg, #6c757d, #495057) !important;
  border: none !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Transition for queue updates */
#currentList, #nextQueueList {
  transition: opacity 0.3s ease;
}

.row {
  transition: all 0.3s ease;
}

/* Marquee footer text */
.marquee span {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Modal styling */
.modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: linear-gradient(135deg, #2c3e50, #34495e);
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px 16px 0 0;
}

.modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 16px 16px;
}

/* Service point name tag */
#txtServicePointName,
#txtDepartmentName {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #2c3e50, #34495e) !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  padding: 0.75rem !important;
}

/* Queue number animation on new */
@keyframes queueSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#currentList .row,
#nextQueueList .row {
  animation: queueSlideIn 0.4s ease-out;
}

/* Special style for the main queue number (current) */
.current-queue-display {
  font-size: 8vh;
  font-weight: 900;
  text-shadow: 0 4px 20px rgba(0, 188, 140, 0.5);
  color: #00bc8c;
  animation: none;
}

/* Time display */
.time-display {
  font-size: 1.2rem;
  font-weight: 300;
  opacity: 0.7;
}

/* Decorative corners for cards */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  opacity: 0.5;
}
