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

/* ===========================
   CSS Variables & Design Tokens
   =========================== */
:root {
  /* Dark Theme */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f35;
  --bg-glass: rgba(26, 31, 53, 0.6);
  --bg-input: #0d1224;

  /* Accent Colors */
  --accent-green: #25D366;
  --accent-green-glow: rgba(37, 211, 102, 0.3);
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.2);
  --accent-purple: #8b5cf6;
  --accent-yellow: #fbbf24;
  --accent-red: #ef4444;
  --accent-orange: #f97316;

  /* Gradient */
  --gradient-main: linear-gradient(135deg, #25D366 0%, #128C7E 50%, #075E54 100%);
  --gradient-card: linear-gradient(145deg, rgba(26, 31, 53, 0.9), rgba(17, 24, 39, 0.95));
  --gradient-shine: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(37, 211, 102, 0.3);

  /* Shadows */
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow-green: 0 0 30px rgba(37, 211, 102, 0.15);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 600px 400px at 10% 20%, rgba(37, 211, 102, 0.06), transparent),
    radial-gradient(ellipse 500px 500px at 90% 80%, rgba(59, 130, 246, 0.04), transparent),
    radial-gradient(ellipse 400px 300px at 50% 50%, rgba(139, 92, 246, 0.03), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ===========================
   Layout
   =========================== */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: var(--gradient-card);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  width: 44px;
  height: 44px;
  background: var(--gradient-main);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-glow-green);
  animation: pulse-logo 3s ease-in-out infinite;
}

@keyframes pulse-logo {
  0%, 100% { box-shadow: var(--shadow-glow-green); }
  50% { box-shadow: 0 0 40px rgba(37, 211, 102, 0.3); }
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-green);
}

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

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

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: start;
}

/* ===========================
   Chat Panel
   =========================== */
.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--gradient-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  height: calc(100vh - 130px);
  box-shadow: var(--shadow-lg);
}

.chat-header {
  background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chat-avatar {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.chat-header-info h3 {
  font-size: 15px;
  font-weight: 600;
}

.chat-header-info span {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(10, 14, 26, 0.95) 0%, rgba(10, 14, 26, 0.98) 100%);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

/* Messages */
.message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  animation: message-in 0.3s ease-out;
  word-wrap: break-word;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message-sent {
  align-self: flex-end;
  background: linear-gradient(135deg, #005c4b, #025144);
  border: 1px solid rgba(37, 211, 102, 0.15);
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}

.message-received {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.message-time {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Product Card inside chat */
.product-card-chat {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(26, 31, 53, 0.9));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 8px;
  max-width: 380px;
  animation: message-in 0.4s ease-out;
  align-self: flex-start;
}

.product-card-chat .product-thumb {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-chat .product-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-card-chat .product-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
}

.product-card-chat .price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.product-card-chat .price-original {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 13px;
}

.product-card-chat .price-current {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent-green);
}

.product-card-chat .discount-badge {
  display: inline-block;
  background: rgba(37, 211, 102, 0.15);
  border: 1px solid rgba(37, 211, 102, 0.3);
  color: var(--accent-green);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.product-card-chat .coupon-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: var(--accent-yellow);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin: 4px 4px 4px 0;
}

.product-card-chat .affiliate-link-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: var(--gradient-main);
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.product-card-chat .affiliate-link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Typing indicator */
.typing-indicator {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  padding: 14px 18px;
  display: flex;
  gap: 5px;
  animation: message-in 0.2s ease-out;
}

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

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

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Welcome message */
.welcome-bubble {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  padding: 16px 18px;
  max-width: 85%;
  animation: message-in 0.5s ease-out;
}

.welcome-bubble h4 {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--accent-green);
}

.welcome-bubble p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Chat Input */
.chat-input-area {
  padding: 16px 20px;
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
  align-items: center;
}

.chat-input-area input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.25s ease;
}

.chat-input-area input::placeholder {
  color: var(--text-muted);
}

.chat-input-area input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--accent-green-glow);
}

.chat-input-area button {
  width: 46px;
  height: 46px;
  background: var(--gradient-main);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
  flex-shrink: 0;
}

.chat-input-area button:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.chat-input-area button:active {
  transform: scale(0.95);
}

.chat-input-area button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===========================
   Debug Panel (Right Side)
   =========================== */
.debug-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: calc(100vh - 130px);
  overflow-y: auto;
}

.debug-panel::-webkit-scrollbar {
  width: 6px;
}

.debug-panel::-webkit-scrollbar-track {
  background: transparent;
}

.debug-panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.debug-card {
  background: var(--gradient-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.debug-card-header {
  padding: 14px 18px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.debug-card-header .icon {
  font-size: 16px;
}

.debug-card-body {
  padding: 16px 18px;
}

/* Steps */
.debug-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.debug-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  transition: all 0.3s ease;
}

.debug-step.active {
  border-color: var(--accent-blue);
  background: var(--accent-blue-glow);
}

.debug-step.success {
  border-color: rgba(37, 211, 102, 0.3);
  background: rgba(37, 211, 102, 0.05);
}

.debug-step.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.step-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.debug-step.pending .step-icon {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}

.debug-step.active .step-icon {
  background: var(--accent-blue-glow);
  color: var(--accent-blue);
  animation: spin 1s linear infinite;
}

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

.debug-step.success .step-icon {
  background: rgba(37, 211, 102, 0.15);
  color: var(--accent-green);
}

.debug-step.error .step-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.step-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.step-value {
  margin-left: auto;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  max-width: 150px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* JSON viewer */
.json-viewer {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  max-height: 280px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

.json-viewer::-webkit-scrollbar {
  width: 4px;
}

.json-viewer::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.json-key { color: #7dd3fc; }
.json-string { color: #86efac; }
.json-number { color: #fbbf24; }
.json-boolean { color: #c084fc; }
.json-null { color: #94a3b8; }

/* Links Table */
.links-table-container {
  overflow-x: auto;
}

.links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.links-table th {
  text-align: left;
  padding: 10px 12px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

.links-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}

.links-table tr:last-child td {
  border-bottom: none;
}

.links-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.clicks-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: var(--accent-blue-glow);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}

.link-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.2);
  color: var(--accent-green);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 36px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 13px;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .chat-panel {
    height: 65vh;
  }

  .debug-panel {
    height: auto;
    max-height: 50vh;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 12px 16px;
  }

  .header-title {
    font-size: 15px;
  }

  .header-badge {
    display: none;
  }

  .chat-messages {
    padding: 14px;
  }

  .chat-input-area {
    padding: 12px 14px;
  }

  .message {
    max-width: 92%;
  }
}

/* ===========================
   Modal & Coupon Detail Card
   =========================== */
.btn-detail {
  background: var(--accent-blue-glow);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-detail:hover {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 450px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.close-btn {
  color: var(--text-muted);
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 20px;
}

.coupon-detail-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.coupon-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.coupon-detail-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.25);
  color: var(--accent-green);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
}

.coupon-detail-discount {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: var(--accent-yellow);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
}

.coupon-detail-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.detail-row strong {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-row span {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===========================
   Modern Form Styles
   =========================== */
.modern-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.25s ease;
}

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

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

/* ===========================
   Toast Notification Styling
   =========================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: 90%;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.hide {
  opacity: 0;
  transform: scale(0.9);
}

.toast-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-weight: 500;
}

.toast-close {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  transition: color 0.2s ease;
  line-height: 1;
  padding: 2px;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Toast variants styling */
.toast-success {
  border-left: 4px solid var(--accent-green);
}

.toast-error {
  border-left: 4px solid var(--accent-red);
}

.toast-warning {
  border-left: 4px solid var(--accent-yellow);
}

.toast-loading {
  border-left: 4px solid var(--accent-blue);
}

.toast-info {
  border-left: 4px solid var(--text-muted);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   Tab Navigation & Multi-pane Layout
   =========================== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  margin: 0 16px;
}

.nav-tab {
  background: transparent;
  border: none;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
  color: white;
  background: var(--gradient-main);
  box-shadow: var(--shadow-glow-green);
}

/* Tab Panes */
.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: tabFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Simulator Grid Layout */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: start;
}

/* Full Width Dashboard layouts */
.dashboard-card {
  background: var(--gradient-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.dashboard-card-header {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.dashboard-card-body {
  padding: 24px;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-subtle);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stat-card-icon {
  position: absolute;
  right: 16px;
  bottom: 12px;
  font-size: 36px;
  opacity: 0.08;
  pointer-events: none;
}

/* Dashboard Actions Bar */
.dashboard-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 500px;
}

.search-filter-group input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.search-filter-group input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.search-filter-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-filter-group select:focus {
  border-color: var(--accent-blue);
}

.buttons-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-action {
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-action:hover {
  transform: translateY(-1px);
}

.btn-blue {
  background: var(--accent-blue-glow);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
}
.btn-blue:hover {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-green {
  background: rgba(37, 211, 102, 0.08);
  border-color: rgba(37, 211, 102, 0.3);
  color: var(--accent-green);
}
.btn-green:hover {
  background: var(--accent-green);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-red {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}
.btn-red:hover {
  background: var(--accent-red);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Override .main-content grid for multi-pane */
.main-content {
  display: block; /* We handle grid inside the Simulator pane instead */
}

/* Adjust responsiveness */
@media (max-width: 1024px) {
  .header-content {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  .header-nav {
    margin: 0;
    width: 100%;
    justify-content: space-between;
  }
  .nav-tab {
    flex: 1;
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-filter-group {
    max-width: none;
  }
  .buttons-group {
    justify-content: space-between;
  }
  .btn-action {
    flex: 1;
    justify-content: center;
  }
}


