/* Cyber-Bento Horizon: Component Primitives */

/* Bento Containers */
.bento-grid {
  display: grid;
  gap: 16px;
}

.bento-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  position: relative;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.bento-card:hover {
  border-color: var(--border-active);
}

.bento-card.highlight {
  border-color: var(--border-glow);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.08);
}

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

.bento-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Button Variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #052e16;
  font-weight: 600;
}
.btn-primary:hover {
  background: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: var(--color-secondary-dim);
  color: var(--color-secondary);
  border: 1px solid var(--border-cyan-glow);
}
.btn-secondary:hover {
  background: rgba(6, 182, 212, 0.2);
}

.btn-ghost {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
  color: var(--text-main);
  border-color: var(--border-active);
}

.btn-danger {
  background: var(--color-error-dim);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
}
.badge-emerald {
  background: var(--color-primary-dim);
  color: var(--color-primary);
  border: 1px solid var(--border-glow);
}
.badge-cyan {
  background: var(--color-secondary-dim);
  color: var(--color-secondary);
  border: 1px solid var(--border-cyan-glow);
}
.badge-amber {
  background: var(--color-warning-dim);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-crimson {
  background: var(--color-error-dim);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Terminal Component */
.cyber-terminal {
  background: #06070a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.terminal-titlebar {
  background: #0d0f15;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.window-dots {
  display: flex;
  gap: 6px;
}
.window-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-body {
  padding: 16px;
  height: 380px;
  overflow-y: auto;
  line-height: 1.6;
}

.terminal-line {
  margin-bottom: 4px;
}
.terminal-line.cmd { color: var(--color-secondary); }
.terminal-line.success { color: var(--color-primary); }
.terminal-line.warn { color: var(--color-warning); }
.terminal-line.dim { color: var(--text-dim); }

/* Table Styles */
.cyber-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.cyber-table th {
  padding: 10px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: #0c0e14;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
}

.cyber-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.cyber-table tr:hover td {
  background: var(--bg-hover);
  color: var(--text-main);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(16, 185, 129, 0.15);
  overflow: hidden;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px 20px;
}

/* VietQR Frame */
.vietqr-box {
  background: #fff;
  padding: 14px;
  border-radius: var(--radius-btn);
  display: inline-block;
  margin: 16px auto;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   WCAG 2.1 AA Accessibility Pass (stitch-a11y)
   ========================================================================== */

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--color-primary);
  color: #052e16;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 13px;
  z-index: 100000;
  text-decoration: none;
  transition: top 0.2s ease-out;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 16px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* High-Visibility Focus Rings */
:focus-visible {
  outline: 2px solid var(--color-primary) !important;
  outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary) !important;
  outline-offset: 2px !important;
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   Motion & Animation Pass (stitch-animate)
   ========================================================================== */

/* Smooth Bento Micro-Interactions */
.bento-card,
[class*="rounded-xl"] {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease;
}

.bento-card:hover,
[class*="rounded-xl"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 0 16px -2px rgba(16, 185, 129, 0.2);
}

/* Reduced Motion Override (WCAG 2.1 AA / stitch-animate) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .bento-card:hover,
  [class*="rounded-xl"]:hover {
    transform: none !important;
  }
}
