/* QueueMe - Merchant Style (Apple Design System) */
/* 建立時間：2026-02-12 08:26 */
/* 作者：Alex (ai01) */

/* ============================================
   Import Customer Base Styles
   ============================================ */
/* 使用與 Customer 相同的設計系統 */

/* CSS Variables (Apple Design System) */
:root {
  /* Brand Colors */
  --primary: #2563EB;      /* 藍訊藍 */
  --primary-dark: #1E40AF;
  --primary-light: #DBEAFE;
  --accent: #F59E0B;       /* 活力橙 */
  --accent-dark: #D97706;
  
  /* Semantic Colors */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;
  
  /* Neutral Colors */
  --bg: #F8FAFC;
  --bg-white: #FFFFFF;
  --bg-gray: #F1F5F9;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-light: #94A3B8;
  --border: #E2E8F0;
  --shadow: rgba(0, 0, 0, 0.1);
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  
  /* Typography */
  --font-base: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-base);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* ============================================
   Merchant Layout (Desktop-Optimized)
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md);
  min-height: 100vh;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--primary);
}

.store-name {
  font-size: var(--font-size-xl);
  color: var(--text);
  font-weight: 600;
}

.dashboard-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ============================================
   Register Form
   ============================================ */
.register-container {
  max-width: 600px;
  margin: var(--space-xl) auto;
}

.form-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.form-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-md);
  text-align: center;
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-sm);
  font-size: var(--font-size-base);
  font-family: var(--font-base);
  color: var(--text);
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* ============================================
   Queue List
   ============================================ */
.queue-section {
  margin-bottom: var(--space-xl);
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.queue-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text);
}

.queue-count {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  background: var(--bg-gray);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.queue-item {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.queue-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.queue-item.serving {
  border-left: 4px solid var(--success);
  background: #F0FDF4;
}

.queue-item-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.queue-number {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--primary);
  min-width: 80px;
}

.queue-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.queue-status {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.queue-time {
  font-size: var(--font-size-xs);
  color: var(--text-light);
}

.queue-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  font-family: var(--font-base);
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #059669;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: var(--accent-dark);
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #DC2626;
}

.btn-secondary {
  background: var(--bg-gray);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.btn-large {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-base);
}

.btn-block {
  width: 100%;
}

/* ============================================
   Counter Control
   ============================================ */
.counter-control {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.counter-label {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.counter-buttons {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.counter-btn {
  flex: 1;
  min-width: 120px;
  max-width: 200px;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-lg);
  font-weight: 600;
  font-family: var(--font-base);
  color: var(--text-secondary);
  background: var(--bg-white);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
}

.counter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.counter-btn.active {
  background: linear-gradient(135deg, var(--primary), #3B82F6);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.counter-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.4);
}

.call-next-btn {
  font-size: var(--font-size-xl);
  padding: var(--space-lg) var(--space-xl);
}

/* ============================================
   Alerts
   ============================================ */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-md);
}

.alert-success {
  background: #DCFCE7;
  color: #166534;
  border-left: 4px solid var(--success);
}

.alert-warning {
  background: #FEF3C7;
  color: #92400E;
  border-left: 4px solid var(--warning);
}

.alert-error {
  background: #FEE2E2;
  color: #991B1B;
  border-left: 4px solid var(--error);
}

.alert-info {
  background: #DBEAFE;
  color: #1E40AF;
  border-left: 4px solid var(--info);
}

/* ============================================
   Loading & Empty States
   ============================================ */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-xl);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

/* ============================================
   QR Code Display
   ============================================ */
.qr-section {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  text-align: center;
  margin-top: var(--space-lg);
}

.qr-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.qr-code {
  display: inline-block;
  padding: var(--space-md);
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.qr-code img {
  display: block;
  width: 200px;
  height: 200px;
}

.qr-url {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  word-break: break-all;
  margin-bottom: var(--space-sm);
}

/* ============================================
   Utilities
   ============================================ */
.hidden { display: none; }
.text-center { text-align: center; }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .queue-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  .queue-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}
