html {
  scroll-behavior: smooth;
}

:root {
  --primary: #00e5ff;
  --secondary: #00ffa3;
  --bg-deep: #050a14;
  --bg-card: rgba(255, 255, 255, 0.05);
  --text-main: #e0e6ed;
  --text-dim: #94a3b8;
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Glassmorphism Utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 0;
  background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.1), transparent),
              radial-gradient(circle at bottom left, rgba(0, 255, 163, 0.05), transparent);
}

.hero-content h1 {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px rgba(0, 229, 255, 0.3));
}

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.25rem;
  color: var(--text-dim);
  max-width: 700px;
  margin: 0 auto 3rem;
}

/* CTA Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #000;
  box-shadow: 0 10px 30px -10px rgba(0, 229, 255, 0.5);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 15px 40px -10px rgba(0, 229, 255, 0.6);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  font-size: 1.15rem;
  padding: 1.1rem 3rem;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  animation: wa-pulse 2.4s ease-in-out infinite;
}

.btn-whatsapp:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 15px 45px -8px rgba(37, 211, 102, 0.8);
  animation: none;
}

@keyframes wa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
  60%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
}

.card {
  padding: 2.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-10px);
}

.card h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.card p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Simulation Containers */
.sim-container {
  margin-top: 4rem;
  padding: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.live-demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(340px, 1fr));
  gap: 1.4rem;
  align-items: start;
}

.live-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Chat Simulator */
.chat-window {
  height: 500px;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
  background: #0b141a;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.setup-window,
.group-window {
  height: 560px;
}

.chat-header {
  background: #202c33;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--glass-border);
  z-index: 10;
}

/* Header Typing Indicator - Removed from header, moved to bubble */
.chat-messages {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
  background-blend-mode: overlay;
  background-color: #0b141a;
  scroll-behavior: smooth;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid var(--glass-border);
  background: #202c33;
}

.chat-input-bar input {
  width: 100%;
  background: #111b21;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  color: var(--text-main);
  font-size: 0.86rem;
  padding: 0.58rem 0.85rem;
  outline: none;
}

.chat-input-bar input:focus {
  border-color: var(--primary);
}

.chat-send {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #000;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-send:hover {
  transform: translateY(-1px);
}

.chat-send:disabled,
.chat-input-bar input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.group-input-bar {
  display: grid;
  grid-template-columns: 95px 1fr auto;
}

.setup-status {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: var(--text-dim);
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
}

.enforcement-log {
  padding: 0.9rem;
  max-height: 190px;
  overflow: hidden;
}

.log-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.log-items {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.log-item {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  font-size: 0.74rem;
  line-height: 1.35;
}

.log-item.info {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.log-item.ok {
  background: rgba(16, 185, 129, 0.18);
  color: #bbf7d0;
}

.log-item.violation {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.chat-bubble {
  max-width: 84%;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 0.9rem;
  position: relative;
  opacity: 0;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
  transform-origin: bottom;
}

.chat-bubble.incoming {
  align-self: flex-start;
  background: #202c33;
  color: #e9edef;
  border-top-left-radius: 3px;
  animation: messageInLeft 0.35s forwards cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-bubble.incoming::before {
  content: "";
  position: absolute;
  top: 0;
  left: -7px;
  width: 0;
  height: 0;
  border-top: 8px solid #202c33;
  border-left: 8px solid transparent;
}

.chat-bubble.outgoing {
  align-self: flex-end;
  background: #005c4b;
  color: #e9edef;
  border-top-right-radius: 3px;
  animation: messageInRight 0.35s forwards cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-bubble.outgoing::after {
  content: "";
  position: absolute;
  top: 0;
  right: -7px;
  width: 0;
  height: 0;
  border-top: 8px solid #005c4b;
  border-right: 8px solid transparent;
}

.chat-bubble.bot {
  align-self: flex-start;
  background: rgba(0, 229, 255, 0.14);
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: #d6f6ff;
  border-top-left-radius: 3px;
  animation: messageInLeft 0.35s forwards cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-bubble.bot::before {
  content: "";
  position: absolute;
  top: 0;
  left: -7px;
  width: 0;
  height: 0;
  border-top: 8px solid rgba(0, 229, 255, 0.14);
  border-left: 8px solid transparent;
}

.chat-bubble.violation {
  border: 1px solid rgba(248, 113, 113, 0.5);
}

.bubble-sender {
  font-size: 0.72rem;
  line-height: 1.2;
  margin-bottom: 0.15rem;
  font-weight: 600;
  color: #86efac;
}

.chat-bubble.outgoing .bubble-sender {
  color: #9ce8d8;
}

.chat-bubble.bot .bubble-sender {
  color: var(--primary);
}

.bubble-text {
  white-space: normal;
  overflow-wrap: anywhere;
}

.bubble-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.chat-bubble .timestamp,
.chat-bubble .status {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.58);
}

.chat-bubble .status {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.system-note {
  align-self: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin: 0.2rem 0;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  animation: systemNoticeIn 0.3s ease forwards;
}

@keyframes messageInLeft {
  0% { opacity: 0; transform: translateY(15px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes messageInRight {
  0% { opacity: 0; transform: translateY(15px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes systemNoticeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Typing Bubble */
.typing-bubble {
  width: fit-content;
  display: flex !important;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 1rem !important;
  border-bottom-left-radius: 3px !important;
  min-height: 38px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.sim-label {
  text-align: center;
  font-size: 1.1rem;
  color: var(--secondary);
  margin-top: 1rem;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
  background: rgba(0, 229, 255, 0.05);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.1);
  display: inline-block;
  margin-bottom: -1rem;
  position: relative;
  z-index: 5;
}

.sim-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(auto, 380px);
    justify-content: center;
    margin-top: 2rem;
}

@media (min-width: 800px) {
    .sim-grid {
        grid-template-columns: repeat(2, minmax(auto, 380px));
    }
}

@media (min-width: 1600px) {
    .sim-grid {
        grid-template-columns: repeat(4, minmax(auto, 380px));
    }
}

/* Group Simulation Header */
.group-header {
  background: #202c33;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.78rem;
  color: var(--secondary);
  text-align: center;
}

/* Pipeline Simulator */
.pipeline-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem;
  position: relative;
}

.pipeline-node {
  flex: 1 1 0;
  max-width: 220px;
  height: auto;
  padding: 1.5rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 2;
  transition: all 0.5s ease;
}

.node-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  font-weight: 400;
  line-height: 1.4;
}

.pipeline-node i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.pipeline-connector {
  flex-grow: 1;
  height: 2px;
  background: var(--glass-border);
  position: relative;
  overflow: hidden;
}

.pipeline-pulse {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: pulse-ltr 2s infinite;
}

@keyframes pulse-ltr {
  to { left: 100%; }
}

html[dir="rtl"] .pipeline-pulse {
  left: auto;
  right: -100%;
  background: linear-gradient(270deg, transparent, var(--primary), transparent);
  animation: pulse-rtl 2s infinite;
}

@keyframes pulse-rtl {
  to { right: 100%; }
}

.active-node {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary);
  background: rgba(0, 229, 255, 0.1);
}

/* Detail Features */
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 4rem;
}

.detail-card {
  padding: 2rem;
  text-align: left;
}

.detail-card .icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

/* Responsive Extensions */
.chat-bubble.deleted-anim {
  opacity: 0.6;
  transition: opacity 0.5s ease;
  filter: grayscale(100%);
}

.chat-bubble.deleted-anim .bubble-text {
  color: var(--text-dim) !important;
}

@media (max-width: 900px) {
  .pipeline-track {
    flex-direction: column;
    gap: 2rem;
  }
  .pipeline-connector {
    width: 2px;
    height: 30px;
  }
}

@media (max-width: 600px) {
  .live-demo-grid { grid-template-columns: 1fr; }
  .group-input-bar { grid-template-columns: 1fr; }
  .setup-window,
  .group-window { height: 520px; }
  .pipeline-track { flex-direction: column; gap: 2rem; }
  .pipeline-connector { width: 2px; height: 40px; }
  .pipeline-pulse,
  html[dir="rtl"] .pipeline-pulse {
    top: -100%;
    left: 0;
    right: auto;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--primary), transparent);
    animation: pulse-vertical 2s infinite;
  }
}

@keyframes pulse-vertical {
  to { top: 100%; }
}
