/* ============================================
   KirimWA — Modern Neo-Brutalist / Indie Hacker Styles
   Clean, Tactile, High-Contrast & Zero AI Gimmicks
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Canvas & Containers */
  --bg: #0c1117;
  --panel: #151d27;
  --panel-hover: #1b2635;
  --panel-inner: #0d141d;
  
  /* Solid Neo-Brutalist Borders & Shadows */
  --border: #2b394a;
  --border-dark: #000000;
  --shadow-hard: 4px 4px 0px #000000;
  --shadow-hard-sm: 2px 2px 0px #000000;
  --shadow-hard-lg: 6px 6px 0px #000000;

  /* Accents */
  --wa-green: #25d366;
  --wa-dark: #075e54;
  --wa-bubble: #005c4b;
  --accent-yellow: #facc15;
  --accent-blue: #38bdf8;
  --accent-pink: #f43f5e;

  /* Typography Colors */
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Geometrics */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ============================================
   HEADER NAVBAR
   ============================================ */
.site-header {
  border-bottom: 2px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-badge-icon {
  width: 34px;
  height: 34px;
  background: var(--wa-green);
  color: #000;
  border: 2px solid #000;
  box-shadow: 2px 2px 0px #000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--panel);
  color: var(--accent-yellow);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--panel);
  padding: 8px 14px;
  border: 2px solid #000;
  box-shadow: var(--shadow-hard-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s var(--ease);
}

.header-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px #000;
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.header-link:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px #000;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-box {
  padding: 40px 0 28px;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #000;
  background: var(--accent-yellow);
  padding: 4px 10px;
  border: 2px solid #000;
  box-shadow: 2px 2px 0px #000;
  border-radius: 4px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.dot-live {
  width: 7px;
  height: 7px;
  background: #000;
  border-radius: 50%;
}

.hero-heading {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
  color: #ffffff;
}

.hero-subheading {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.6;
}

/* ============================================
   MAIN APP LAYOUT (2 COLUMNS)
   ============================================ */
.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 40px;
}

/* Base Panel Box */
.panel-box {
  background: var(--panel);
  border: 2px solid #000;
  box-shadow: var(--shadow-hard);
  border-radius: var(--radius);
  padding: 24px;
  box-sizing: border-box;
}

.panel-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--border);
}

.panel-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.panel-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

/* ============================================
   FORM PANEL STYLES
   ============================================ */
.field-block {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.field-hint {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 2px;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.char-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Phone input row */
.phone-row {
  display: flex;
  align-items: center;
  background: var(--panel-inner);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.phone-row:focus-within {
  border-color: var(--wa-green);
}

.select-country {
  background: #192330;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 14px;
  border: none;
  border-right: 2px solid var(--border);
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}

.select-country option {
  background: var(--panel);
  color: var(--text);
}

.input-phone {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 12px 14px;
  outline: none;
  width: 100%;
}

.input-phone::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

/* Fix Chrome / Edge Autofill turning dark inputs white */
.input-phone:-webkit-autofill,
.input-phone:-webkit-autofill:hover, 
.input-phone:-webkit-autofill:focus,
.input-phone:-webkit-autofill:active,
.input-textarea:-webkit-autofill,
.input-textarea:-webkit-autofill:hover,
.input-textarea:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fafc !important;
  -webkit-box-shadow: 0 0 0px 1000px #0d141d inset !important;
  box-shadow: 0 0 0px 1000px #0d141d inset !important;
  caret-color: #f8fafc !important;
  transition: background-color 5000s ease-in-out 0s;
}

.badge-status {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  margin-right: 10px;
  flex-shrink: 0;
}

.badge-status.valid {
  display: inline-block;
  background: var(--wa-green);
  color: #000;
}

.badge-status.invalid {
  display: inline-block;
  background: var(--accent-pink);
  color: #fff;
}

/* Template Chips */
.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-chip {
  background: var(--panel-inner);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chip:hover {
  background: var(--panel-hover);
  color: #fff;
  border-color: #fff;
}

.btn-chip.active {
  background: var(--wa-green);
  color: #000;
  border-color: #000;
  font-weight: 700;
  box-shadow: 2px 2px 0px #000;
}

/* Textarea */
.input-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--panel-inner);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  line-height: 1.5;
  transition: border-color 0.15s ease;
}

.input-textarea:focus {
  border-color: var(--wa-green);
}

.input-textarea::placeholder {
  color: var(--text-dim);
}

/* ============================================
   TACTILE ACTION BUTTONS
   ============================================ */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.btn-brutal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  padding: 13px 20px;
  border: 2px solid #000;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s var(--ease);
  box-shadow: var(--shadow-hard-sm);
  white-space: nowrap;
}

.btn-brutal:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hard);
}

.btn-brutal:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px #000;
}

.btn-primary {
  flex: 1 1 200px;
  background: var(--wa-green);
  color: #000;
}

.btn-primary:hover {
  background: #2fe06f;
}

.btn-secondary {
  flex: 0 1 auto;
  background: var(--panel-inner);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--panel-hover);
  border-color: #000;
  color: #fff;
}

/* Generated Link Box */
.link-box {
  margin-top: 20px;
  padding: 10px 14px;
  background: var(--panel-inner);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}

.link-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.link-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  background: #1f2b3a;
  color: var(--accent-blue);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.link-url {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
  flex: 1 1 0%;
  min-width: 0;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #1f2b3a;
  color: var(--text);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-copy:hover {
  background: #2a394d;
  color: #fff;
  border-color: #fff;
}

/* ============================================
   RIGHT SIDE PANEL (PREVIEW & QR)
   ============================================ */
.side-panel-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Chat Viewport (Clean, Authentic, No Fake Notches) */
.chat-viewport {
  background: #0b141a;
  border: 2px solid #000;
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 16px 16px;
}

.chat-day-stamp {
  align-self: center;
  background: #182229;
  color: #8696a0;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.chat-bubble-card {
  align-self: flex-end;
  background: var(--wa-bubble);
  color: #e9edef;
  padding: 9px 12px 5px 12px;
  border-radius: 8px 8px 0px 8px;
  max-width: 90%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.chat-text {
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-time-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.68rem;
  color: #8696a0;
  margin-top: 4px;
}

.chat-ticks {
  color: #53bdeb;
  font-weight: 700;
}

/* QR Code Panel */
.qr-canvas-holder {
  background: #ffffff;
  border: 2px solid #000;
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  width: fit-content;
  box-shadow: var(--shadow-hard-sm);
}

.qr-canvas-holder img,
.qr-canvas-holder canvas {
  display: block;
}

.btn-download {
  width: 100%;
  background: var(--panel-inner);
  color: var(--text);
  font-size: 0.88rem;
  padding: 11px 14px;
}

.btn-download:hover {
  background: var(--accent-yellow);
  color: #000;
}

/* ============================================
   EMBED CODE & WIDGET STYLES
   ============================================ */
.embed-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.embed-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.embed-tabs .btn-chip {
  font-size: 0.78rem;
  padding: 6px 12px;
}

.embed-preview-box {
  background: var(--panel-inner);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.embed-preview-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.embed-preview-target {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  width: 100%;
}

.embed-code-box {
  background: #090d13;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.embed-code-pre {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-blue);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 12px;
  line-height: 1.45;
  background: transparent;
  padding: 4px;
}

.btn-copy-embed {
  width: 100%;
  background: var(--panel-inner);
  color: var(--text);
  font-size: 0.86rem;
  padding: 10px 14px;
  border-color: var(--border);
}

.btn-copy-embed:hover {
  background: var(--wa-green);
  color: #000;
  border-color: #000;
}

/* ============================================
   HISTORY SECTION
   ============================================ */
.history-panel {
  margin-bottom: 40px;
}

.history-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.history-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--accent-pink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.btn-text-danger:hover {
  color: #fff;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.history-card {
  background: var(--panel-inner);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 0;
}

.history-card:hover {
  border-color: var(--wa-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hard-sm);
}

.history-phone {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--wa-green);
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.history-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  word-break: break-word;
}

.history-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.empty-history {
  color: var(--text-dim);
  font-size: 0.88rem;
  text-align: center;
  padding: 20px;
  background: var(--panel-inner);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  grid-column: 1 / -1;
}

/* ============================================
   USE CASES (PRACTICAL & CLEAN)
   ============================================ */
.usecase-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 60px;
}

.usecase-card {
  background: var(--panel);
  border: 2px solid #000;
  box-shadow: var(--shadow-hard);
  border-radius: var(--radius);
  padding: 20px;
}

.badge-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--accent-blue);
  color: #000;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1.5px solid #000;
  margin-bottom: 10px;
}

.usecase-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.usecase-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  margin-top: auto;
  border-top: 2px solid var(--border);
  background: var(--bg);
  padding: 28px 0;
  font-size: 0.88rem;
}

.footer-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-meta a,
.footer-links a {
  color: var(--wa-green);
  text-decoration: underline;
}

.footer-dim {
  color: var(--text-dim);
  margin-left: 6px;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--wa-green);
  color: #000;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 10px 22px;
  border: 2px solid #000;
  box-shadow: var(--shadow-hard);
  border-radius: var(--radius-sm);
  transition: transform 0.2s var(--ease);
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE MEDIA QUERIES
   ============================================ */

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .side-panel-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .usecase-section {
    grid-template-columns: 1fr;
  }
}

/* Mobile Phones (≤ 640px) */
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .hero-box {
    padding: 28px 0 20px;
  }

  .hero-heading {
    font-size: 1.85rem;
  }

  .hero-subheading {
    font-size: 0.94rem;
  }

  .panel-box {
    padding: 18px 14px;
  }

  .phone-row {
    flex-direction: row;
  }

  .select-country {
    padding: 10px 10px;
    font-size: 0.85rem;
  }

  .input-phone {
    font-size: 0.98rem;
    padding: 10px 10px;
  }

  .action-row {
    flex-direction: column;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
    flex: unset;
  }

  .link-box {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .link-meta {
    width: 100%;
  }

  .btn-copy {
    align-self: flex-end;
  }

  .side-panel-wrap {
    display: flex;
    flex-direction: column;
  }

  .qr-canvas-holder {
    padding: 10px;
  }

  .qr-canvas-holder img,
  .qr-canvas-holder canvas {
    width: 140px !important;
    height: 140px !important;
  }

  .footer-layout {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Touch active states (disable hover drift on tap) */
@media (hover: none) {
  .btn-brutal:hover,
  .header-link:hover,
  .history-card:hover {
    transform: none;
    box-shadow: var(--shadow-hard-sm);
  }
}
