/* QueueMe Display - 叫號顯示系統 */

:root {
  --primary: #2563EB;
  --primary-dark: #1E40AF;
  --success: #10B981;
  --warning: #F59E0B;
  --bg: #F8FAFC;
  --bg-white: #FFFFFF;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* ===== Main Container ===== */
.display-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  position: relative;
}

/* ===== Header ===== */
.display-header {
  padding: 24px 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.store-name {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.current-time {
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  opacity: 0.95;
}

/* ===== Main Display Area ===== */
.display-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

/* ===== Single Counter Display ===== */
.single-counter-display {
  text-align: center;
  width: 100%;
  max-width: 900px;
}

.service-label {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 4px;
}

.current-number {
  font-size: 280px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  text-shadow: 0 8px 32px rgba(37, 99, 235, 0.2);
  margin: 20px 0;
  animation: pulse 2s ease-in-out infinite;
  font-variant-numeric: tabular-nums;
}

.current-number.flash {
  animation: flash 0.5s ease-in-out 3;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

@keyframes flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.counter-info {
  font-size: 42px;
  font-weight: 600;
  color: var(--text);
  margin-top: 20px;
}

/* ===== Multi Counter Display ===== */
.multi-counter-display {
  width: 100%;
  max-width: 1400px;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  padding: 20px;
}

.counter-card {
  background: white;
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 3px solid var(--border);
  transition: all 0.3s ease;
}

.counter-card.active {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15);
  transform: scale(1.02);
}

.counter-card.flash {
  animation: cardFlash 0.5s ease-in-out 3;
}

@keyframes cardFlash {
  0%, 100% { 
    border-color: var(--primary); 
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15);
  }
  50% { 
    border-color: var(--warning); 
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3);
  }
}

.counter-label {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.counter-number {
  font-size: 140px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin: 15px 0;
  font-variant-numeric: tabular-nums;
}

.counter-status {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-light);
  margin-top: 10px;
}

/* ===== Waiting Section ===== */
.waiting-section {
  padding: 30px 40px;
  background: white;
  border-top: 3px solid var(--border);
}

.waiting-label {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.waiting-numbers {
  font-size: 36px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-variant-numeric: tabular-nums;
}

.waiting-number {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  padding: 12px 28px;
  border-radius: 16px;
  border: 2px solid var(--border);
  transition: all 0.2s ease;
}

.waiting-number:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== Footer ===== */
.display-footer {
  padding: 20px 40px;
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
}

.powered-by {
  font-size: 18px;
  color: var(--text-light);
  font-weight: 500;
}

.footer-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--text-light);
  font-weight: 500;
}

.icon-btn {
  background: transparent;
  color: var(--text-light);
  border: none;
  padding: 0;
  margin: 0;
  font-size: 48px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Noto Sans TC', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.icon-btn:hover {
  transform: scale(1.05);
  opacity: 0.7;
}

.icon-btn:active {
  transform: scale(0.95);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  animation: blink 2s ease-in-out infinite;
}

.status-dot.disconnected {
  background: var(--warning);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== Settings Panel ===== */
.settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.settings-panel.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: all;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 2px solid var(--border);
}

.settings-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.settings-close {
  background: var(--bg);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-close:hover {
  background: var(--border);
  transform: rotate(90deg);
}

.settings-body {
  padding: 28px;
}

.setting-item {
  margin-bottom: 24px;
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-item > label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.setting-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  cursor: pointer;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.slider-container input[type="range"] {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.slider-container input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.slider-container input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.slider-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.setting-hint {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 8px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  color: var(--text-light);
  font-size: 32px;
  font-weight: 600;
  padding: 60px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .current-number {
    font-size: 200px;
  }
  
  .service-label {
    font-size: 36px;
  }
  
  .counter-info {
    font-size: 32px;
  }
  
  .waiting-numbers {
    font-size: 28px;
  }
  
  .counter-grid {
    grid-template-columns: 1fr;
  }
  
  .counter-number {
    font-size: 100px;
  }
}

@media (max-width: 768px) {
  .current-number {
    font-size: 150px;
  }
  
  .store-name {
    font-size: 24px;
  }
  
  .current-time {
    font-size: 20px;
  }
}

/* ===== Fullscreen Mode ===== */
.display-container:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
}

.display-container:-moz-full-screen {
  width: 100vw;
  height: 100vh;
}

.display-container:-ms-fullscreen {
  width: 100vw;
  height: 100vh;
}

.display-container:fullscreen {
  width: 100vw;
  height: 100vh;
}
