/* ========================================================
   UI // VIBE DESIGN - Visual Dictionary & Interactive Lab
   High-Tech Cyber Dark Design System for Vibe Coders
   ======================================================== */

:root {
  --bg-core: #060911;
  --bg-surface: rgba(15, 23, 42, 0.75);
  --bg-card: rgba(18, 28, 51, 0.7);
  --bg-card-hover: rgba(24, 38, 70, 0.88);
  --bg-interactive: rgba(255, 255, 255, 0.04);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(34, 211, 238, 0.35);
  --border-highlight: rgba(16, 185, 129, 0.35);

  --accent-cyan: #22d3ee;
  --accent-cyan-glow: rgba(34, 211, 238, 0.4);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.35);
  --accent-amber: #f59e0b;
  --accent-purple: #c084fc;
  --accent-rose: #f43f5e;
  --accent-orange: #fb923c;
  --accent-indigo: #818cf8;

  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;

  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-sans);
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: clip;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow blobs */
.ambient-glow {
  position: fixed;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(140px);
  z-index: 0;
  opacity: 0.16;
}

.glow-cyan {
  top: -100px;
  left: -100px;
  background: var(--accent-cyan);
}

.glow-emerald {
  bottom: 20%;
  right: -100px;
  background: var(--accent-emerald);
}

.glow-purple {
  top: 50%;
  left: 20%;
  background: var(--accent-purple);
  opacity: 0.12;
}

/* Reading Progress Bar */
.reading-progress-track {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 1000;
}

.reading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald), var(--accent-purple));
  transition: width 0.1s ease-out;
}

/* Layout Container */
.layout-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 100px;
  position: relative;
  z-index: 1;
}

/* Header */
.hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 36px;
}

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

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.brand-divider {
  color: var(--border-subtle);
  font-size: 1.2rem;
  font-weight: 300;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.brand-title .accent-dot {
  color: var(--accent-cyan);
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 700;
}

.header-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-header-link:hover {
  background: rgba(34, 211, 238, 0.16);
  border-color: var(--accent-cyan);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 20px 0 40px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 20px;
  letter-spacing: -0.8px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 10%, #22d3ee 60%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-sub);
  max-width: 760px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

/* Search & Quick Filter Bar */
.search-filter-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 40px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.search-input-wrap {
  position: relative;
  margin-bottom: 16px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  background: rgba(6, 11, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.filter-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 8px 14px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-chip.active {
  background: rgba(34, 211, 238, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.25);
}

/* Category Sections */
.category-section {
  margin-bottom: 50px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.category-badge {
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
}

.category-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
}

.category-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Component Grid */
.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

/* Component Card */
.comp-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.comp-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 211, 238, 0.15);
}

.comp-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.comp-title-group {
  display: flex;
  flex-direction: column;
}

.comp-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.comp-eng {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-top: 2px;
}

.comp-alias-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.comp-desc {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Interactive Playground Area inside Card */
.comp-demo-box {
  background: rgba(6, 11, 20, 0.7);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  position: relative;
}

.comp-demo-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  align-self: flex-start;
}

/* Interactive Trigger Buttons */
.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-action-primary:hover {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.35), rgba(16, 185, 129, 0.35));
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.4);
  transform: translateY(-1px);
}

.btn-action-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

/* Prompt Box */
.comp-prompt-box {
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: auto;
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.prompt-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
}

.btn-copy-prompt {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-sub);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-copy-prompt:hover {
  background: rgba(34, 211, 238, 0.2);
  color: #fff;
  border-color: var(--accent-cyan);
}

.prompt-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.5;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 10px;
  border-radius: 4px;
  word-break: break-all;
}

/* Tip & Warning Box */
.comp-tip-box {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

/* ========================================================
   LIVE SIMULATION OVERLAYS (모달, 바텀시트, 드로어, 토스트)
   ======================================================== */

/* Toast Container */
.vibe-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999999;
  pointer-events: none;
}

.vibe-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 440px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(34, 211, 238, 0.2);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toastSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.vibe-toast.toast-success {
  border-color: var(--accent-emerald);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(16, 185, 129, 0.3);
}

.vibe-toast.toast-warning {
  border-color: var(--accent-amber);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(245, 158, 11, 0.3);
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Simulation */
.sim-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 8, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.sim-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.sim-modal-box {
  background: linear-gradient(145deg, rgba(16, 24, 40, 0.98), rgba(9, 14, 26, 0.99));
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  width: min(90vw, 480px);
  padding: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(34, 211, 238, 0.25);
  transform: scale(0.9);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-backdrop.active .sim-modal-box {
  transform: scale(1);
}

.sim-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sim-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.sim-modal-close:hover {
  color: #fff;
}

/* Bottom Sheet Simulation */
.sim-bottom-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 8, 16, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999800;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.sim-bottom-sheet-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.sim-bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 75vh;
  background: linear-gradient(180deg, rgba(18, 28, 51, 0.98), rgba(10, 16, 30, 0.99));
  border-top: 1px solid var(--accent-cyan);
  border-radius: 24px 24px 0 0;
  padding: 16px 24px 32px;
  z-index: 999801;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-bottom-sheet.active {
  transform: translateY(0);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  margin: 0 auto 16px;
}

/* Drawer / Sidebar Simulation */
.sim-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 8, 16, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999800;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.sim-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.sim-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(85vw, 340px);
  height: 100%;
  background: linear-gradient(225deg, rgba(16, 26, 46, 0.98), rgba(10, 16, 30, 0.99));
  border-left: 1px solid var(--accent-cyan);
  padding: 24px;
  z-index: 999801;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.sim-drawer.active {
  transform: translateX(0);
}

/* In-Card Mini Demos */
.mini-skeleton-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-box {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.05) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.mini-fab-demo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent-cyan), #0077ff);
  color: #04101e;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 9999px;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mini-fab-demo:hover {
  transform: translateY(-2px) scale(1.05);
}

/* Tooltip Demo */
.tooltip-trigger-wrap {
  position: relative;
  display: inline-block;
}

.sim-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.sim-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--accent-cyan) transparent transparent transparent;
}

.tooltip-trigger-wrap:hover .sim-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Accordion Demo */
.sim-accordion-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.sim-accordion-trigger {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.sim-accordion-content {
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.25s ease-out;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.8rem;
  color: var(--text-sub);
}

.sim-accordion-item.active .sim-accordion-content {
  padding: 10px 14px;
  max-height: 120px;
}

/* Bottom Footer */
.hub-footer {
  margin-top: 80px;
  padding-top: 30px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .component-grid {
    grid-template-columns: 1fr;
  }
  .hub-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .header-right-group {
    width: 100%;
    justify-content: space-between;
  }
  .category-header {
    flex-wrap: wrap;
  }
  .category-desc {
    margin-left: 0;
    width: 100%;
  }
}
