/* Dinkoko ERP Demo Styles - DeepFlow Theme */

/* === CSS Variables === */
:root {
  --primary: #1B578D;
  --primary-light: #306DA6;
  --primary-dark: #194A73;
  --secondary: #2A76B5;

  --background: #EEF3F8;
  --surface: #FFFFFF;
  --surface-hover: #F8FAFC;
  --border: #E8EDF2;
  --border-light: #DBE2E8;

  --success: #16A34A;
  --success-light: #DCFCE7;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-light: #F8FAFC;

  --line-green: #06C755;
  --line-light: #E8FBF0;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* === Base Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === Typography === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;600;700&display=swap');

body {
  font-family: 'Inter', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Container === */
.demo-container {
  width: 900px;
  max-width: 100%;
  margin: 0 auto;
  padding: 24px;
  background: var(--background);
}

/* === Page Header === */
.demo-header {
  text-align: center;
  margin-bottom: 32px;
}

.demo-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.demo-header p {
  font-size: 15px;
  color: var(--text-secondary);
}

/* === Cards === */
.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

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

.demo-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.demo-card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.demo-card-header .icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

/* === Buttons === */
.demo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.demo-btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--text-light);
  box-shadow: var(--shadow-sm);
}

.demo-btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.demo-btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.demo-btn-secondary:hover {
  background: var(--primary);
  color: var(--text-light);
}

.demo-btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
  color: var(--text-light);
}

.demo-btn-success:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.demo-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* === Badges === */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9999px;
}

.demo-badge-success {
  background: var(--success-light);
  color: var(--success);
}

.demo-badge-warning {
  background: var(--warning-light);
  color: #B45309;
}

.demo-badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.demo-badge-info {
  background: var(--info-light);
  color: var(--info);
}

.demo-badge-primary {
  background: #DBEAFE;
  color: var(--primary);
}

/* === Tables === */
.demo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.demo-table thead {
  background: var(--surface-hover);
}

.demo-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

.demo-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.demo-table tbody tr:hover {
  background: var(--surface-hover);
}

.demo-table .text-right {
  text-align: right;
}

.demo-table .text-center {
  text-align: center;
}

.demo-table tfoot {
  background: var(--surface-hover);
  font-weight: 600;
}

.demo-table tfoot td {
  border-top: 2px solid var(--primary);
  border-bottom: none;
}

/* === Flow Steps === */
.demo-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}

.demo-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 140px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.demo-flow-step:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.demo-flow-step.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.demo-flow-step.active .step-label,
.demo-flow-step.active .step-sublabel {
  color: white;
}

.demo-flow-step .step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.demo-flow-step.active .step-icon {
  background: white;
  color: var(--primary);
}

.demo-flow-step .step-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.demo-flow-step .step-sublabel {
  font-size: 12px;
  color: var(--text-secondary);
}

.demo-flow-arrow {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--border) 0%, var(--primary) 100%);
  position: relative;
}

.demo-flow-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--primary);
}

/* === Info Grid === */
.demo-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.demo-info-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-info-item .info-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--info-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-info-item .info-content {
  flex: 1;
}

.demo-info-item .info-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.demo-info-item .info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* === Chat Bubbles === */
.demo-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.demo-chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.5;
  animation: fadeInUp 0.3s ease;
}

.demo-chat-bubble.user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.demo-chat-bubble.bot {
  align-self: flex-start;
  background: var(--surface-hover);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

.demo-chat-bubble.line-user {
  align-self: flex-end;
  background: var(--line-green);
  color: white;
  border-bottom-right-radius: 4px;
}

.demo-chat-bubble.line-bot {
  align-self: flex-start;
  background: white;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

/* === Timeline === */
.demo-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.demo-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  position: relative;
}

.demo-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.demo-timeline-item .timeline-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.demo-timeline-item .timeline-icon.success {
  background: var(--success-light);
  color: var(--success);
}

.demo-timeline-item .timeline-icon.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.demo-timeline-item .timeline-icon.pending {
  background: var(--info-light);
  color: var(--info);
}

.demo-timeline-item .timeline-icon.processing {
  background: var(--primary);
  color: white;
  animation: pulse 1.5s ease infinite;
}

.demo-timeline-item .timeline-content {
  flex: 1;
}

.demo-timeline-item .timeline-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.demo-timeline-item .timeline-text {
  font-size: 14px;
  color: var(--text-primary);
}

/* === Recommendation Cards === */
.demo-reco-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.demo-reco-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

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

.demo-reco-card .reco-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.demo-reco-card .reco-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.demo-reco-card .reco-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.demo-reco-card .reco-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  background: var(--success-light);
  color: var(--success);
  font-size: 11px;
  font-weight: 500;
  border-radius: 9999px;
}

/* === Feature Icons === */
.demo-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.demo-feature {
  text-align: center;
  padding: 16px;
}

.demo-feature .feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.demo-feature .feature-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.demo-feature .feature-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* === Stat Cards === */
.demo-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface-hover);
  border-radius: var(--radius-md);
}

.demo-stat .stat-icon {
  font-size: 20px;
}

.demo-stat .stat-content {
  flex: 1;
}

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

.demo-stat .stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* === AI Analysis Panel === */
.demo-analysis {
  background: var(--success-light);
  border: 1px solid #86EFAC;
  border-radius: var(--radius-md);
  padding: 16px;
}

.demo-analysis-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.demo-analysis-item:not(:last-child) {
  border-bottom: 1px solid #BBF7D0;
}

.demo-analysis-item .check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.demo-analysis-item .text {
  font-size: 14px;
  color: #166534;
}

/* === LINE Interface === */
.demo-line-interface {
  background: #F5F5F5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.demo-line-header {
  background: var(--line-green);
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-line-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  color: var(--line-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.demo-line-header .name {
  font-weight: 600;
}

.demo-line-body {
  padding: 16px;
  min-height: 300px;
}

.demo-line-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.demo-line-action-btn {
  padding: 10px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--line-green);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.demo-line-action-btn:hover {
  background: var(--line-light);
  border-color: var(--line-green);
}

/* === Notifications === */
.demo-notification {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  animation: slideInRight 0.4s ease;
}

.demo-notification.new {
  border-left-color: var(--success);
  animation: slideInRight 0.4s ease, pulseGlow 2s ease infinite;
}

.demo-notification .notif-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.demo-notification .notif-icon {
  color: var(--primary);
}

.demo-notification .notif-title {
  font-weight: 600;
  color: var(--text-primary);
}

.demo-notification .notif-badge {
  margin-left: auto;
}

.demo-notification .notif-body {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.demo-notification .notif-actions {
  display: flex;
  gap: 8px;
}

/* === Two Column Layout === */
.demo-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* === Utility Classes === */
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.font-mono { font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(22, 163, 74, 0);
  }
}

@keyframes typing {
  0%, 60%, 100% {
    opacity: 1;
  }
  30% {
    opacity: 0.3;
  }
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s ease infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}
