/* LineBuster Shared UI Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #e05d00);
  color: #ffffff;
  box-shadow: var(--shadow-orange);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-success {
  background: var(--accent-green);
  color: #ffffff;
}
.btn-success:hover {
  filter: brightness(1.1);
}

.btn-danger {
  background: var(--accent-red);
  color: #ffffff;
}
.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.875rem;
}

.btn-lg {
  min-height: 56px;
  padding: 16px 28px;
  font-size: 1.125rem;
}

/* Hamburger Side Panel Drawer (Opens from left side) */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.drawer-content {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 9995;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer-overlay.active .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.drawer-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 8px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.drawer-nav-item:hover {
  background: var(--bg-dark);
  border-color: var(--border-color);
  color: var(--primary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-waiting {
  background: rgba(47, 129, 247, 0.2);
  color: #58a6ff;
  border: 1px solid rgba(47, 129, 247, 0.4);
}

.badge-called {
  background: rgba(255, 107, 0, 0.25);
  color: #ff944d;
  border: 1px solid rgba(255, 107, 0, 0.5);
  animation: pulse-orange 2s infinite;
}

.badge-preparing {
  background: rgba(210, 153, 34, 0.2);
  color: #f2cc60;
  border: 1px solid rgba(210, 153, 34, 0.4);
}

.badge-ready {
  background: rgba(35, 134, 54, 0.25);
  color: #56d364;
  border: 1px solid rgba(35, 134, 54, 0.5);
  animation: pulse-green 1.5s infinite;
}

.badge-served {
  background: rgba(139, 148, 158, 0.2);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  width: 100%;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Documentation Modal Large Screen Expansion */
.docs-modal-card {
  width: 94vw !important;
  max-width: 1400px !important;
  height: 90vh !important;
  max-height: 90vh !important;
}

@media (max-width: 768px) {
  .docs-modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 96vh !important;
    max-height: 96vh !important;
  }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}
.close-btn:hover {
  color: var(--text-main);
}

/* Animations */
@keyframes pulse-orange {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 107, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 0, 0); }
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(35, 134, 54, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(35, 134, 54, 0); }
  100% { box-shadow: 0 0 0 0 rgba(35, 134, 54, 0); }
}

/* PeerSudoku-Inspired Modern Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: 90vw;
  width: max-content;
}

.toast-notification {
  background: rgba(22, 27, 34, 0.94);
  color: var(--text-main, #ffffff);
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 0.9375rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  text-align: center;
  line-height: 1.4;
  white-space: pre-wrap;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-notification.success {
  background: rgba(35, 134, 54, 0.95);
  border-color: #56d364;
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(35, 134, 54, 0.4);
}

.toast-notification.warning {
  background: rgba(210, 153, 34, 0.95);
  border-color: #f1c40f;
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(210, 153, 34, 0.4);
}

.toast-notification.error {
  background: rgba(218, 54, 51, 0.95);
  border-color: #da3633;
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(218, 54, 51, 0.4);
}

.toast-notification.info {
  background: rgba(22, 27, 34, 0.95);
  border-color: var(--primary, #ff6b00);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(255, 107, 0, 0.3);
}

/* Printable Window Sign @media print Optimization */
@media print {
  body * {
    visibility: hidden !important;
  }
  #linebuster-print-area, #linebuster-print-area * {
    visibility: visible !important;
  }
  #linebuster-print-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }
  @page {
    size: letter portrait;
    margin: 0.4in;
  }
}

/* Single Checkbox Toggle Switch Component */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--border-color);
  transition: .25s ease;
  border-radius: 24px;
}
.switch-toggle .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .25s ease;
  border-radius: 50%;
}
.switch-toggle input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary);
}
.switch-toggle input:checked + .slider:before {
  transform: translateX(18px);
}

