/* ==========================================================
   MINIMALIST & ELEGANT DESIGN SYSTEM
   Authentic WhatsApp Chat Experience + Luxury Dark Aesthetic
   ========================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;

  /* Minimalist Luxury Palette (Subtle & Matte, No harsh neons) */
  --bg-core: #090c10;
  --surface-1: #11161f;
  --surface-2: #161d28;
  --surface-border: rgba(255, 255, 255, 0.08);
  --surface-border-subtle: rgba(255, 255, 255, 0.04);
  --surface-border-highlight: rgba(255, 255, 255, 0.16);

  /* Sophisticated Muted Accents */
  --accent-red: #c93b50;
  --accent-red-soft: rgba(201, 59, 80, 0.12);
  --accent-amber: #c58a24;
  --accent-amber-soft: rgba(197, 138, 36, 0.12);
  --accent-green: #2a8b64;
  --accent-green-soft: rgba(42, 139, 100, 0.12);

  /* WhatsApp Dark Theme Palette */
  --wa-bg: #0b141a;
  --wa-header: #202c33;
  --wa-incoming: #202c33;
  --wa-outgoing: #005c4b;
  --wa-text-primary: #e9edef;
  --wa-text-muted: #8696a0;
  --wa-input-bg: #2a3942;
  --wa-green-btn: #00a884;
  --wa-green-btn-hover: #02b68f;
  --wa-ticks: #53bdeb;

  /* Typography */
  --text-main: #f0f3f6;
  --text-muted: #8b949e;
  --text-sub: #adb5bd;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* Ambient Subtle Lighting */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: 
    radial-gradient(ellipse at 50% 10%, rgba(201, 59, 80, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 90%, rgba(32, 44, 51, 0.4) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* App Viewport Container */
.app-viewport {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background-color: var(--surface-1);
}

@media (min-width: 500px) {
  .app-viewport {
    height: 94vh;
    margin: 3vh auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    overflow: hidden;
  }
}

/* Screen Management */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* Minimalist Button Styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  background-color: var(--text-main);
  color: #0b0f14;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: #ffffff;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  background-color: var(--surface-2);
  color: var(--text-main);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #1c2635;
  border-color: var(--surface-border-highlight);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-ghost:hover {
  color: var(--text-main);
}

/* ==========================================================
   1. WELCOME SCREEN
   ========================================================== */
#screen-welcome {
  padding: 32px 24px;
  overflow-y: auto;
  justify-content: center;
}

.welcome-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 5px 12px;
  background-color: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: 100px;
  align-self: flex-start;
  margin-bottom: 12px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-red);
  border-radius: 50%;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 10px;
}

.text-accent {
  color: var(--accent-red);
}

.welcome-subtitle {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Scenario Timeline */
.scenario-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--surface-2);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.item-index {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--accent-red);
  font-weight: 600;
  padding-top: 2px;
}

.item-content h4 {
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.item-content p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Start Form */
.start-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-block label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-block input {
  width: 100%;
  padding: 13px 16px;
  background-color: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-block input:focus {
  border-color: var(--surface-border-highlight);
}

.welcome-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.8;
}

/* ==========================================================
   2. AUTHENTIC WHATSAPP CHAT SHELL
   ========================================================== */
#screen-chat {
  height: 100%;
  position: relative;
  background-color: var(--wa-bg);
  overflow: hidden;
}

/* Ad slots */
.ad-container-top, .ad-container-bottom {
  height: 38px;
  background-color: #121b22;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
  z-index: 10;
}
.ad-container-bottom {
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ad-slot-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--wa-text-muted);
}
.ad-lbl {
  background-color: #202c33;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #adb5bd;
}
.ad-txt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* The WhatsApp Frame */
.wa-shell {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--wa-bg);
  /* WhatsApp subtle dark texture */
  background-image: radial-gradient(circle at center, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 20px 20px;
  overflow: hidden;
}

/* WhatsApp Header */
.wa-header {
  height: 56px;
  background-color: var(--wa-header);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
  z-index: 5;
}

.wa-header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-btn-icon {
  background: transparent;
  border: none;
  color: var(--wa-text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.wa-btn-icon:hover {
  color: var(--wa-text-primary);
}

.wa-avatar-box {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #374248;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wa-avatar-initial {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #cfd8dc;
}

.wa-user-meta {
  display: flex;
  flex-direction: column;
}

.wa-contact-name {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--wa-text-primary);
  line-height: 1.2;
}

.wa-status-text {
  font-size: 0.72rem;
  color: var(--wa-text-muted);
}

.wa-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-chapter-tag {
  background-color: rgba(255, 255, 255, 0.08);
  color: #adb5bd;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
}

.wa-btn-finish {
  background: rgba(201, 59, 80, 0.18);
  border: 1px solid rgba(201, 59, 80, 0.4);
  color: #e57373;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.wa-btn-finish:hover {
  background: rgba(201, 59, 80, 0.3);
  color: #fff;
}

/* Tracker Bar */
.wa-tracker-bar {
  background-color: #182229;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding: 5px 16px;
  flex-shrink: 0;
}

.tracker-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--wa-text-muted);
}

/* Chat Messages Feed (Dedicated Scroll Container) */
.wa-messages-feed {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}

.wa-messages-feed::-webkit-scrollbar {
  width: 5px;
}
.wa-messages-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.wa-date-chip {
  align-self: center;
  background-color: #182229;
  border-radius: 7px;
  padding: 5px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.wa-date-chip span {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--wa-text-muted);
}

/* WhatsApp In-Chat Context Notice */
.wa-system-notice {
  align-self: center;
  background-color: rgba(24, 34, 41, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 8px 14px;
  max-width: 86%;
  text-align: center;
  margin: 4px auto 12px auto;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  animation: waFadeIn 0.2s ease-out;
}

.wa-system-notice p {
  font-size: 0.72rem;
  line-height: 1.45;
  color: #cfd8dc;
  margin: 0;
}

/* WhatsApp Message Bubble */
.wa-bubble {
  max-width: 84%;
  padding: 6px 9px 6px 11px;
  border-radius: 7.5px;
  font-size: 0.88rem;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  animation: waFadeIn 0.15s ease-out;
}

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

.wa-bubble.incoming {
  align-self: flex-start;
  background-color: var(--wa-incoming);
  color: var(--wa-text-primary);
  border-top-left-radius: 0;
}

.wa-bubble.outgoing {
  align-self: flex-end;
  background-color: var(--wa-outgoing);
  color: var(--wa-text-primary);
  border-top-right-radius: 0;
}

.wa-msg-text {
  display: inline;
}

.wa-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  float: right;
  margin-left: 10px;
  margin-top: 5px;
  font-size: 0.65rem;
  color: var(--wa-text-muted);
}

.wa-ticks {
  color: var(--wa-ticks);
  display: inline-flex;
}

/* Typing Pill */
.wa-typing-pill {
  padding: 4px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wa-typing-pill.hidden {
  display: none;
}

.wa-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background-color: var(--wa-incoming);
  padding: 6px 10px;
  border-radius: 12px;
}

.wa-typing-dots span {
  width: 5px;
  height: 5px;
  background-color: var(--wa-text-muted);
  border-radius: 50%;
  animation: dotPulse 1.2s infinite ease-in-out both;
}

.wa-typing-dots span:nth-child(1) { animation-delay: -0.3s; }
.wa-typing-dots span:nth-child(2) { animation-delay: -0.15s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.wa-typing-caption {
  font-size: 0.72rem;
  color: var(--wa-text-muted);
}

/* Dynamic End Chat Suggestion Banner */
.wa-suggestion-banner {
  background-color: rgba(32, 44, 51, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 6;
  animation: slideBanner 0.25s ease-out;
}

@keyframes slideBanner {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.wa-suggestion-banner.hidden {
  display: none;
}

.suggestion-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--wa-text-muted);
}

.btn-suggestion-action {
  background-color: var(--accent-red);
  color: #fff;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-suggestion-action:hover {
  opacity: 0.9;
}

/* WhatsApp Interactive Emoji Picker Panel */
.wa-emoji-panel {
  background-color: var(--wa-header);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  height: 220px;
  flex-shrink: 0;
  z-index: 6;
  animation: slideEmojiPanel 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideEmojiPanel {
  from { height: 0; opacity: 0; }
  to { height: 220px; opacity: 1; }
}

.wa-emoji-panel.hidden {
  display: none;
}

.emoji-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background-color: rgba(17, 27, 33, 0.6);
}

.emoji-category-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.emoji-tab-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, background-color 0.15s;
}

.emoji-tab-btn:hover {
  opacity: 0.9;
  background-color: rgba(255, 255, 255, 0.06);
}

.emoji-tab-btn.active {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 -2px 0 var(--wa-accent);
}

.btn-emoji-close {
  background: transparent;
  border: none;
  color: var(--wa-text-muted);
  font-size: 1.3rem;
  line-height: 1;
  padding: 2px 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s;
}

.btn-emoji-close:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

.emoji-grid-body {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.emoji-grid-body::-webkit-scrollbar {
  width: 3.5px;
}

.emoji-grid-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.emoji-item-btn {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background-color 0.1s;
  user-select: none;
}

.emoji-item-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.15);
}

.emoji-item-btn:active {
  transform: scale(0.95);
}

.wa-btn-addon.active {
  color: var(--wa-accent);
}

/* WhatsApp Input Bar (Permanently Fixed at bottom) */
.wa-input-container {
  background-color: var(--wa-header);
  padding: 8px 10px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.wa-input-box {
  flex: 1;
  background-color: var(--wa-input-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  min-height: 42px;
}

.wa-btn-addon {
  background: transparent;
  border: none;
  color: var(--wa-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.wa-btn-addon:hover {
  color: #aebac1;
}

.wa-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #d1d7db;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 6px 8px;
  resize: none;
  max-height: 90px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.wa-textarea::-webkit-scrollbar {
  width: 3.5px;
}

.wa-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.wa-textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.wa-textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.wa-textarea::placeholder {
  color: var(--wa-text-muted);
}

/* Circular Send Button */
.wa-send-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--wa-green-btn);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s, transform 0.15s;
}

.wa-send-circle:hover {
  background-color: var(--wa-green-btn-hover);
  transform: scale(1.04);
}

.wa-send-circle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================
   3. INTERSTITIAL SCREEN (TRANSITION)
   ========================================================== */
#screen-transition {
  justify-content: center;
  align-items: center;
  padding: 32px 24px;
}

.transition-container {
  background-color: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.transition-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
}

.transition-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-red);
  border-radius: 50%;
}

.transition-time {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.transition-heading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

.transition-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.transition-divider {
  width: 40px;
  height: 1px;
  background-color: var(--surface-border);
  margin: 4px auto;
}

/* ==========================================================
   4. LOADING SCREEN (MINIMALIST)
   ========================================================== */
#screen-loading {
  justify-content: center;
  align-items: center;
  padding: 32px;
}

.loading-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.minimal-spinner {
  width: 44px;
  height: 44px;
  position: relative;
}

.spinner-ring {
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-header {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.loading-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 20px;
}

/* ==========================================================
   5. RESULT SCREEN (MINIMALIST ELEGANT ID CARD)
   ========================================================== */
#screen-result {
  overflow-y: auto;
  padding: 24px 18px 40px;
}

.result-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-intro {
  text-align: center;
}

.result-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.result-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

/* THE MINIMALIST ID CARD */
.minimal-id-card {
  background-color: #0d121a;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* Themes */
.minimal-id-card.flag-theme-red {
  border-color: rgba(201, 59, 80, 0.4);
}
.minimal-id-card.flag-theme-yellow {
  border-color: rgba(197, 138, 36, 0.4);
}
.minimal-id-card.flag-theme-green {
  border-color: rgba(42, 139, 100, 0.4);
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--surface-border-subtle);
  padding-bottom: 10px;
}

.card-issuer {
  display: flex;
  flex-direction: column;
}

.issuer-code {
  font-family: monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.issuer-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #c5cbd3;
}

.card-status-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.pill-red { background: var(--accent-red-soft); color: #e57373; border: 1px solid rgba(201, 59, 80, 0.3); }
.pill-yellow { background: var(--accent-amber-soft); color: #ffb74d; border: 1px solid rgba(197, 138, 36, 0.3); }
.pill-green { background: var(--accent-green-soft); color: #81c784; border: 1px solid rgba(42, 139, 100, 0.3); }

/* Middle Grid */
.card-middle-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-profile-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-initial-large {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background-color: var(--surface-2);
  border: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.subject-info {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.subject-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-score-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.score-display-box {
  display: flex;
  align-items: baseline;
}

.score-digit {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.score-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 2px;
}

.score-caption {
  font-size: 0.62rem;
  color: var(--text-muted);
}

/* Title Panel */
.card-title-panel {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--surface-border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.official-alias {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #e57373;
  margin-top: 2px;
  margin-bottom: 2px;
}

.official-summary {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Metrics Grid */
.card-metrics-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-sub);
}

.metric-track {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  background-color: var(--accent-red);
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* Card Bottom */
.card-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--surface-border-subtle);
  padding-top: 8px;
  font-family: monospace;
  font-size: 0.58rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Psych Analysis Card */
.analysis-card {
  background-color: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.sub-heading {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
  margin-bottom: 10px;
}

.analysis-body-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #c5cbd3;
  white-space: pre-line;
  margin-bottom: 14px;
}

.advice-panel {
  background-color: var(--surface-2);
  border-left: 2px solid var(--surface-border-highlight);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 10px 12px;
}

.advice-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.advice-text {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-sub);
}

/* Result Actions */
.result-action-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--surface-2);
  border: 1px solid var(--surface-border-highlight);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  z-index: 99;
  transition: opacity 0.2s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}
