/* ==========================================================================
   Chat Page (chat.webguruji.online Showcase & Blueprint) Styles
   ========================================================================== */

:root {
  --chat-primary: #ff6b4a;
  --chat-primary-glow: rgba(255, 107, 74, 0.25);
  --chat-primary-hover: #ff522b;
  --chat-emerald: #10b981;
  --chat-emerald-glow: rgba(16, 185, 129, 0.25);
  --chat-indigo: #6366f1;
  --chat-bg-dark: #0a0d14;
  --chat-surface: rgba(18, 24, 38, 0.85);
  --chat-surface-card: rgba(23, 30, 48, 0.7);
  --chat-surface-border: rgba(255, 255, 255, 0.08);
  --chat-surface-hover: rgba(255, 255, 255, 0.04);
  --chat-text-main: #f8fafc;
  --chat-text-muted: #94a3b8;
  --chat-text-dim: #64748b;
  --chat-radius-sm: 8px;
  --chat-radius-md: 14px;
  --chat-radius-lg: 20px;
  --chat-radius-xl: 28px;
  --chat-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --chat-font-display: 'Space Grotesk', var(--chat-font-sans);
}

body.chat-page-body {
  background-color: var(--chat-bg-dark);
  color: var(--chat-text-main);
  font-family: var(--chat-font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Cyber Glow Background */
.chat-page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.chat-bg-glow-1 {
  position: absolute;
  top: -100px;
  left: 20%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(255, 107, 74, 0.12) 0%, transparent 70%);
  filter: blur(60px);
}

.chat-bg-glow-2 {
  position: absolute;
  top: 40%;
  right: 5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  filter: blur(70px);
}

.chat-bg-glow-3 {
  position: absolute;
  bottom: 5%;
  left: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  filter: blur(60px);
}

.chat-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* Page Container */
.chat-page-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 100px 24px 60px;
}

/* Header & Hero */
.chat-hero-section {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 60px;
  padding: 20px 0 0;
}

.chat-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(255, 107, 74, 0.1);
  border: 1px solid rgba(255, 107, 74, 0.3);
  color: #ff8c66;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(255, 107, 74, 0.15);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--chat-emerald);
  box-shadow: 0 0 10px var(--chat-emerald);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.chat-hero-title {
  font-family: var(--chat-font-display);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.title-gradient {
  background: linear-gradient(135deg, #ff8c66 0%, #ff522b 50%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chat-hero-desc {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--chat-text-muted);
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.chat-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.btn-chat-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ff6b4a 0%, #e04e2d 100%);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--chat-radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px var(--chat-primary-glow);
  transition: all 0.25s ease;
}

.btn-chat-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 107, 74, 0.4);
  color: #fff;
}

.btn-chat-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--chat-text-main);
  padding: 14px 24px;
  border-radius: var(--chat-radius-md);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--chat-surface-border);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.btn-chat-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ==========================================================================
   Interactive Chat Simulator Box
   ========================================================================== */
.chat-simulator-wrap {
  background: var(--chat-surface);
  border: 1px solid var(--chat-surface-border);
  border-radius: var(--chat-radius-xl);
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  margin-bottom: 70px;
}

.simulator-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--chat-surface-border);
  background: rgba(13, 17, 27, 0.6);
}

.sim-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
}

.sim-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 107, 74, 0.4);
}

.sim-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--chat-emerald);
  border: 2px solid var(--chat-bg-dark);
}

.sim-user-details h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.golden-tick {
  color: #fbbf24;
  font-size: 0.85rem;
}

.sim-user-sub {
  font-size: 0.8rem;
  color: var(--chat-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.sim-id-chip {
  background: rgba(255, 107, 74, 0.12);
  color: #ff8c66;
  border: 1px solid rgba(255, 107, 74, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sim-id-chip:hover {
  background: rgba(255, 107, 74, 0.25);
}

.sim-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--chat-text-muted);
  border: 1px solid var(--chat-surface-border);
}

/* Chat Messages Stream */
.sim-messages-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 480px;
  overflow-y: auto;
  background: rgba(10, 13, 20, 0.4);
}

.sim-date-divider {
  text-align: center;
  position: relative;
  margin: 8px 0;
}

.sim-date-divider span {
  background: rgba(255, 255, 255, 0.06);
  color: var(--chat-text-dim);
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid var(--chat-surface-border);
}

.sim-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.sim-msg-row.incoming {
  align-self: flex-start;
}

.sim-msg-row.outgoing {
  align-self: flex-end;
  align-items: flex-end;
}

.sim-msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.incoming .sim-msg-bubble {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
  color: #f1f5f9;
}

.outgoing .sim-msg-bubble {
  background: linear-gradient(135deg, #e04e2d 0%, #c23819 100%);
  border-bottom-right-radius: 4px;
  color: #fff;
}

.sim-reply-quote {
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid #ffaa88;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: #fed7aa;
}

/* Audio Waveform Bubble */
.sim-audio-bubble {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.sim-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #ff522b;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sim-play-btn:hover {
  transform: scale(1.06);
}

.sim-waveform-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  flex: 1;
}

.sim-wave-bar {
  width: 3px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}

.sim-wave-bar:nth-child(1) { height: 8px; }
.sim-wave-bar:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.sim-wave-bar:nth-child(3) { height: 22px; animation-delay: 0.2s; }
.sim-wave-bar:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.sim-wave-bar:nth-child(5) { height: 18px; animation-delay: 0.4s; }
.sim-wave-bar:nth-child(6) { height: 24px; animation-delay: 0.5s; }
.sim-wave-bar:nth-child(7) { height: 14px; animation-delay: 0.6s; }
.sim-wave-bar:nth-child(8) { height: 9px; animation-delay: 0.7s; }

.sim-speed-btn {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: none;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.sim-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.72rem;
  opacity: 0.8;
}

.sim-seen-ticks {
  color: #38bdf8;
  font-weight: bold;
}

/* Reactions Bar */
.sim-reactions-row {
  display: flex;
  gap: 6px;
  margin-top: -6px;
  margin-bottom: 4px;
  z-index: 2;
}

.sim-reaction-pill {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid var(--chat-surface-border);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}

.sim-reaction-pill:hover {
  transform: scale(1.15);
  background: rgba(30, 41, 59, 1);
}

/* Simulator Footer / Input Bar */
.sim-input-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--chat-surface-border);
  background: rgba(13, 17, 27, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sim-input-mock {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--chat-surface-border);
  padding: 12px 18px;
  border-radius: 9999px;
  color: var(--chat-text-dim);
  font-size: 0.95rem;
  cursor: text;
}

.sim-btn-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b4a 0%, #e04e2d 100%);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--chat-primary-glow);
  transition: transform 0.2s ease;
}

.sim-btn-circle:hover {
  transform: scale(1.08);
}

/* ==========================================================================
   Features Grid
   ========================================================================== */
.chat-section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}

.chat-section-badge {
  color: var(--chat-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: block;
}

.chat-section-title {
  font-family: var(--chat-font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
}

.chat-section-desc {
  color: var(--chat-text-muted);
  font-size: 1rem;
}

.chat-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 80px;
}

.feature-card {
  background: var(--chat-surface);
  border: 1px solid var(--chat-surface-border);
  border-radius: var(--chat-radius-lg);
  padding: 28px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 107, 74, 0.3);
  box-shadow: 0 16px 32px -8px rgba(0, 0, 0, 0.4);
}

.feature-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--chat-radius-md);
  background: rgba(255, 107, 74, 0.1);
  border: 1px solid rgba(255, 107, 74, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--chat-text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ==========================================================================
   Documentation & Architecture Tabs View
   ========================================================================== */
.blueprint-card {
  background: var(--chat-surface);
  border: 1px solid var(--chat-surface-border);
  border-radius: var(--chat-radius-xl);
  overflow: hidden;
  margin-bottom: 70px;
  backdrop-filter: blur(14px);
}

.blueprint-tabs-nav {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--chat-surface-border);
  background: rgba(13, 17, 27, 0.6);
  padding: 8px 16px;
  gap: 8px;
}

.blueprint-tab-btn {
  background: transparent;
  border: none;
  color: var(--chat-text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.blueprint-tab-btn:hover {
  color: var(--chat-text-main);
  background: rgba(255, 255, 255, 0.05);
}

.blueprint-tab-btn.active {
  color: #ff8c66;
  background: rgba(255, 107, 74, 0.12);
  border: 1px solid rgba(255, 107, 74, 0.25);
}

.blueprint-tab-pane {
  display: none;
  padding: 32px;
}

.blueprint-tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.code-block-wrap {
  position: relative;
  background: #090c12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--chat-radius-md);
  margin: 20px 0;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--chat-text-dim);
}

.copy-code-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--chat-text-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

pre.code-content {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.88rem;
  color: #38bdf8;
  line-height: 1.5;
}

/* Toast Notification */
.chat-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1e293b;
  border: 1px solid rgba(255, 107, 74, 0.3);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Responsive Rules */
@media (max-width: 768px) {
  .chat-page-container {
    padding: 80px 16px 40px;
  }
  .sim-msg-row {
    max-width: 90%;
  }
  .sim-header-actions {
    display: none;
  }
  .blueprint-tab-pane {
    padding: 20px 16px;
  }
}
