/* ==========================================================================
   FeedbackToDev — Design System & Stylesheet
   Dark Glassmorphism, Modern Typography, Mobile-Optimized Terminal UX
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-deep: #080911;
  --bg-surface: rgba(16, 18, 30, 0.75);
  --bg-surface-hover: rgba(24, 28, 48, 0.85);
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-bright: rgba(255, 255, 255, 0.18);
  
  /* Text & Accent Colors */
  --text-primary: #f0f4fc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-pink: #ec4899;
  --accent-blue: #3b82f6;

  /* Tag Color Badges */
  --tag-wisdom: #38bdf8;
  --tag-kudos: #34d399;
  --tag-bug: #f87171;
  --tag-rant: #fb923c;
  --tag-idea: #c084fc;

  /* Fonts */
  --font-jetbrains: 'JetBrains Mono', monospace;
  --font-firacode: 'Fira Code', monospace;
  --font-spacemono: 'Space Mono', monospace;
  --font-sourcecode: 'Source Code Pro', monospace;
  --font-inter: 'Inter', sans-serif;

  /* Shadows & Glass effects */
  --glass-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.1);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Font Classes */
body.font-jetbrains { font-family: var(--font-jetbrains); }
body.font-firacode { font-family: var(--font-firacode); font-feature-settings: "liga" 1, "calt" 1; }
body.font-spacemono { font-family: var(--font-spacemono); }
body.font-sourcecode { font-family: var(--font-sourcecode); }
body.font-inter { font-family: var(--font-inter); }

/* Reset & Global Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Background Canvas & Vignette */
#flowCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  display: block;
}

.ambient-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(8, 9, 17, 0.75) 100%);
}

/* Glassmorphism Panel Base Utility */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--glass-shadow);
}

.glass-pill {
  background: rgba(16, 18, 30, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
}

/* Header Component */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-glass);
}

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

.logo-mark {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-cyan);
}

.logo-icon {
  font-size: 14px;
  letter-spacing: -1px;
}

.logo-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.brand-title h1 {
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(90deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
}

/* Header Tabs */
.view-mode-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  gap: 4px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  min-height: 36px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-normal);
}

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

.tab-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(168, 85, 247, 0.25));
  color: #ffffff;
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.tab-btn .icon {
  width: 14px;
  height: 14px;
}

/* Header Right Options */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.glass-select {
  background: rgba(16, 18, 30, 0.8);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  min-height: 36px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-glass-bright);
}

.icon-btn .icon {
  width: 16px;
  height: 16px;
}

/* Toolbar & Filters */
.toolbar-container {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  width: max-content;
  max-width: 94vw;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  box-shadow: var(--glass-shadow);
  overflow-x: auto;
  scrollbar-width: none;
}

.toolbar::-webkit-scrollbar { display: none; }

.tag-filter-group {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.tag-chip {
  padding: 6px 12px;
  min-height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tag-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.tag-chip.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.tag-chip.tag-wisdom.active { background: rgba(56, 189, 248, 0.2); border-color: var(--tag-wisdom); color: var(--tag-wisdom); }
.tag-chip.tag-kudos.active { background: rgba(52, 211, 153, 0.2); border-color: var(--tag-kudos); color: var(--tag-kudos); }
.tag-chip.tag-bug.active { background: rgba(248, 113, 113, 0.2); border-color: var(--tag-bug); color: var(--tag-bug); }
.tag-chip.tag-rant.active { background: rgba(251, 146, 60, 0.2); border-color: var(--tag-rant); color: var(--tag-rant); }
.tag-chip.tag-idea.active { background: rgba(192, 132, 252, 0.2); border-color: var(--tag-idea); color: var(--tag-idea); }

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
}

.search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.search-input-wrapper input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  width: 130px;
}

.search-input-wrapper input::placeholder {
  color: var(--text-muted);
}

/* Syntax Highlighting CSS */
.inline-code {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-firacode), monospace;
  font-size: 0.9em;
}

.syntax-kw { color: var(--accent-purple); font-weight: 600; }
.syntax-string { color: var(--accent-green); }
.syntax-num { color: var(--accent-amber); }

/* Bottom Terminal Input Dock */
.bottom-dock-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 94vw);
  z-index: 25;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-dock {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  background: rgba(12, 14, 26, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(6, 182, 212, 0.15);
}

.dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.dock-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
}

.prompt-symbol { color: var(--accent-green); font-weight: 700; }

.dock-tag-selector {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.tag-opt { cursor: pointer; }
.tag-opt input { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  min-height: 28px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
}

.tag-opt input:checked + .chip { color: #ffffff; }
.tag-opt input:checked + .chip-wisdom { background: rgba(56, 189, 248, 0.25); border-color: var(--tag-wisdom); color: var(--tag-wisdom); }
.tag-opt input:checked + .chip-kudos { background: rgba(52, 211, 153, 0.25); border-color: var(--tag-kudos); color: var(--tag-kudos); }
.tag-opt input:checked + .chip-bug { background: rgba(248, 113, 113, 0.25); border-color: var(--tag-bug); color: var(--tag-bug); }
.tag-opt input:checked + .chip-rant { background: rgba(251, 146, 60, 0.25); border-color: var(--tag-rant); color: var(--tag-rant); }
.tag-opt input:checked + .chip-idea { background: rgba(192, 132, 252, 0.25); border-color: var(--tag-idea); color: var(--tag-idea); }

.dock-body { margin-bottom: 10px; }

.input-area-wrapper textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.dock-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.author-input-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  font-size: 12px;
}

.author-prefix { color: var(--text-muted); }
.author-input-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--accent-green);
  font-family: inherit;
  font-size: 12px;
  width: 100px;
}

.char-count-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.char-progress-bar {
  width: 50px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-green);
}

.counter-text {
  font-size: 11px;
  color: var(--text-muted);
  width: 52px;
}

.submit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(6, 182, 212, 0.5);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(168, 85, 247, 0.3));
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.submit-btn .icon { width: 14px; height: 14px; }

/* Modals & Zen Overlay */
.modal-backdrop, .zen-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 9, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.hidden, .zen-overlay.hidden { display: none !important; }

.modal-card, .zen-card {
  position: relative;
  width: min(520px, 94vw);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border-glass-bright);
}

.modal-close-btn, .close-mobile-dock-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-header, .zen-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.badge {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
}

.timestamp { font-size: 12px; color: var(--text-muted); }

.modal-content-box {
  background: rgba(0, 0, 0, 0.4);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 18px;
  word-break: break-word;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.meta-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.meta-label { font-size: 10px; color: var(--text-muted); display: block; }
.meta-val { font-size: 11px; color: var(--text-secondary); font-weight: 500; }

.modal-actions { display: flex; gap: 10px; }

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  min-height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.action-btn .icon { width: 15px; height: 15px; }

.stream-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  font-size: 11px;
  color: var(--text-secondary);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 90vw;
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(16, 18, 30, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-cyan);
  color: var(--text-primary);
  font-size: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* Mobile Trigger Button */
.mobile-dock-trigger-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 24;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  min-height: 48px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: none;
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.4);
  cursor: pointer;
}

.show-mobile { display: none; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Mobile & Touch Responsive Breakpoints */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: flex !important; }

  .app-header { padding: 0 12px; height: 56px; }
  .brand-subtitle { display: none; }
  .view-mode-tabs span { display: none; }

  .toolbar-container { top: 64px; }
  .search-input-wrapper input { width: 100px; }

  /* Bottom Input Dock converts to Mobile Sheet Drawer */
  .bottom-dock-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    transform: translateY(100%);
    z-index: 40;
  }

  .bottom-dock-container.mobile-open {
    transform: translateY(0);
  }

  .input-dock {
    border-radius: 20px 20px 0 0;
    padding: 16px;
    background: rgba(12, 14, 26, 0.96);
  }

  .dock-header { flex-direction: column; align-items: flex-start; gap: 6px; }
  .dock-tag-selector { width: 100%; padding-bottom: 4px; }

  .dock-footer { flex-wrap: wrap; }
  .author-input-box { width: 100%; justify-content: space-between; }
  .author-input-box input { width: 140px; }

  .submit-btn { width: 100%; justify-content: center; }

  .mobile-dock-trigger-btn { display: flex !important; }
  
  .meta-item { padding: 6px; }
  .modal-meta-grid { grid-template-columns: 1fr; }
}
