/* assets/css/components.css */

/* Loading Bar */
.loading-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 9999;
}

.loading-bar {
  height: 100%;
  background: var(--gradient-accent);
  width: 0%;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  max-width: 600px;
  margin: 0 auto;
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 9000;
  box-shadow: var(--shadow-card), 0 0 20px rgba(0, 212, 255, 0.2);
  transform: translateY(150%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.show {
  transform: translateY(0);
}

.cookie-content h4 {
  margin-bottom: 0.5rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cookie-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.cookie-buttons .btn-accept,
.cookie-buttons .btn-decline {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-glass);
}

.cookie-buttons .btn-accept {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}
.cookie-buttons .btn-accept:hover { box-shadow: 0 0 15px rgba(0, 212, 255, 0.4); }

.cookie-buttons .btn-decline {
  background: transparent;
  color: var(--text-secondary);
}
.cookie-buttons .btn-decline:hover { color: var(--text-primary); border-color: var(--text-secondary); }

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-left: 4px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(120%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: auto;
}

.toast.toast-show { opacity: 1; transform: translateX(0); }
.toast.toast-leave { opacity: 0; transform: translateX(120%); }

.toast-success { border-color: var(--accent-green); }
.toast-error { border-color: var(--accent-red); }
.toast-warning { border-color: var(--accent-orange); }
.toast-info { border-color: var(--accent-cyan); }

.toast-icon {
  flex-shrink: 0;
  display: flex;
  color: var(--accent-cyan);
}
.toast-success .toast-icon { color: var(--accent-green); }
.toast-error .toast-icon { color: var(--accent-red); }
.toast-warning .toast-icon { color: var(--accent-orange); }

.toast-content {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: var(--accent-cyan);
  opacity: 0.6;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-primary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-card), 0 0 30px rgba(124, 58, 237, 0.1);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
}

.modal-title {
  font-size: 1.25rem;
  margin: 0;
  color: var(--accent-cyan);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--accent-red);
}

.modal-body {
  padding: 1.5rem;
  color: var(--text-secondary);
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: var(--bg-secondary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.page-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.page-item:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--accent-purple);
}

.page-item.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

/* Search Bar */
.search-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 4px solid;
}

.alert-info {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
}

.alert-warning {
  background: rgba(255, 107, 53, 0.1);
  border-color: var(--accent-orange);
}

.alert-danger {
  background: rgba(255, 56, 100, 0.1);
  border-color: var(--accent-red);
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.progress-bar {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-xl);
  width: 0%;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Status Indicator */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-online .status-indicator { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); animation: glowPulse 2s infinite; }
.status-offline .status-indicator { background: var(--text-muted); }
.status-busy .status-indicator { background: var(--accent-red); }

/* Code Block */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin: 1rem 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--border-glass);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.code-content {
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #e6edf3;
  line-height: 1.5;
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  padding: 0.25rem 0.75rem;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all 0.2s;
  cursor: pointer;
}

.tag:hover {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

/* ============================================================
   Cyber Terminal HUD (CLI overlay injected by terminal-hud.js)
   Deliberately always "dark terminal" styled — independent of
   the site's light/dark theme toggle, like a real console.
   ============================================================ */

/* Floating trigger button, bottom-right, fixed so it never
   affects document height / page scroll position. */
.hud-floating-trigger {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 8500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: #05070d;
  border: 1px solid var(--border-cyan);
  border-radius: 999px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 rgba(0, 212, 255, 0);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.hud-floating-trigger:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(0, 212, 255, 0.35);
  transform: translateY(-2px);
}

.hud-floating-trigger svg,
.hud-floating-trigger [data-lucide] {
  width: 16px;
  height: 16px;
}

.hud-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  flex-shrink: 0;
  animation: hudPulse 2s ease-in-out infinite;
}

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

/* Full-screen matrix rain canvas, hidden until toggled by JS */
.matrix-fullscreen-canvas {
  position: fixed;
  inset: 0;
  z-index: 8600;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
  opacity: 0.85;
}

/* Modal overlay — hidden by default via opacity/visibility so it
   never adds height to <body> and never triggers page auto-scroll. */
.cyber-hud-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 4, 8, 0.75);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cyber-hud-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Prevent the page underneath from scrolling while the terminal is open */
body.hud-scroll-lock {
  overflow: hidden;
}

.hud-window {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  height: min(600px, 80vh);
  background: #05070d;
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 255, 0.12);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.cyber-hud-overlay.active .hud-window {
  transform: translateY(0) scale(1);
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-cyan);
  flex-shrink: 0;
}

.hud-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent-cyan);
  font-size: 0.8rem;
  overflow: hidden;
}

.hud-title .font-mono {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  flex-shrink: 0;
  animation: hudPulse 2s ease-in-out infinite;
}

.hud-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hud-btn:hover {
  border-color: var(--border-cyan);
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent-cyan);
}

.hud-btn.hud-close:hover {
  border-color: var(--accent-red);
  background: rgba(255, 56, 100, 0.1);
  color: var(--accent-red);
}

.hud-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
  color: #cbd5e1;
  font-family: var(--font-mono);
}

.hud-welcome {
  margin-bottom: 0.75rem;
}

.hud-ascii {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  line-height: 1.3;
  white-space: pre;
  overflow-x: auto;
  margin-bottom: 0.5rem;
}

.hud-output {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.hud-line {
  font-size: 0.8rem;
  line-height: 1.5;
  word-break: break-word;
}

.hud-line-cmd {
  margin-top: 0.3rem;
  opacity: 0.9;
}

.hud-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.25rem 1rem;
  font-size: 0.78rem;
  margin: 0.4rem 0;
}

.hud-prompt-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.hud-prompt-symbol {
  color: var(--accent-cyan);
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.hud-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #e6edf3;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  caret-color: var(--accent-cyan);
}

@media (max-width: 640px) {
  .hud-btn-text { display: none; }
  .hud-floating-trigger { right: 1rem; bottom: 1rem; padding: 0.65rem; border-radius: 50%; }
  .cyber-hud-overlay { padding: 0; }
  .hud-window { max-width: 100%; height: 100dvh; border-radius: 0; }
  .hud-ascii { font-size: 0.5rem; }
}
