/* /admin/hbd-control/css/main.css */

/* ==================== */
/* CYBERPUNK THEME */
/* ==================== */

:root {
  /* Neon colors */
  --neon-blue: #00f0ff;
  --neon-pink: #ff006e;
  --neon-purple: #8b00ff;
  --neon-green: #00ff9f;
  
  /* Dark backgrounds */
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --bg-card: rgba(30, 41, 59, 0.8);
  --bg-hover: rgba(51, 65, 85, 0.9);
  
  /* Text colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Borders */
  --border-color: rgba(0, 240, 255, 0.3);
  --border-glow: 0 0 20px rgba(0, 240, 255, 0.5);
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==================== */
/* LAYOUT */
/* ==================== */

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 2px solid var(--border-color);
  gap: 16px;
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--neon-blue);
  text-shadow: var(--border-glow);
  white-space: nowrap;
}

.header-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hbd-tab-nav {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 5px;
  border: 1px solid rgba(0, 240, 255, 0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(9, 21, 43, 0.96), rgba(7, 16, 36, 0.9));
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  max-width: 100%;
}

.hbd-tab-nav::-webkit-scrollbar {
  height: 4px;
}

.hbd-tab-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.45);
  border-radius: 10px;
}

.hbd-tab-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hbd-tab-link:hover {
  color: #d7fbff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(139, 0, 255, 0.16));
}

.hbd-tab-link:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 7px;
  bottom: 7px;
  width: 1px;
  background: rgba(0, 240, 255, 0.2);
}

/* ==================== */
/* STATS CARDS */
/* ==================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: var(--spacing-lg);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-pink));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card:hover {
  border-color: var(--neon-blue);
  box-shadow: var(--border-glow);
  transform: translateY(-4px);
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--neon-blue);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

/* ==================== */
/* FILTERS */
/* ==================== */

.filters {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.filter-group label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.filter-input,
.filter-select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: var(--border-glow);
}

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

/* ==================== */
/* BUTTONS */
/* ==================== */

.btn {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left 0.3s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.4);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, #ff006e, #dc2626);
}

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
}

/* ==================== */
/* TABLE */
/* ==================== */

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  overflow-x: auto; /* allow horizontal scroll on narrow screens */
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(15, 23, 42, 0.9);
}

thead th {
  padding: var(--spacing-md);
  text-align: left;
  font-size: 12px;
  color: var(--neon-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: var(--bg-hover);
}

tbody td {
  padding: var(--spacing-md);
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

/* ==================== */
/* PROJECT ID BADGE */
/* ==================== */

.project-id {
  display: inline-block;
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid var(--neon-blue);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--neon-blue);
}

/* ==================== */
/* STATUS BADGE */
/* ==================== */

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: rgba(0, 255, 159, 0.2);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
}

.status-upcoming {
  background: rgba(0, 240, 255, 0.2);
  color: var(--neon-blue);
  border: 1px solid var(--neon-blue);
}

.status-inactive {
  background: rgba(255, 94, 120, 0.2);
  color: #ff8da1;
  border: 1px solid #ff8da1;
}

.status-archived {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
  border: 1px solid var(--text-secondary);
}

/* ==================== */
/* ACTION BUTTONS */
/* ==================== */

.actions {
  display: flex;
  gap: var(--spacing-sm);
}

.action-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  border-color: var(--neon-blue);
  color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* ==================== */
/* LOADING */
/* ==================== */

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: var(--text-secondary);
  font-size: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--neon-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ==================== */
/* UTILITIES */
/* ==================== */

.hidden {
  display: none !important;
}

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

.text-secondary {
  color: var(--text-secondary);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

/* ==================== */
/* MODE CONTROLS */
/* ==================== */

.mode-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.mode-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.mode-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.mode-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mode-badge.mode-dynamic {
  background: rgba(0, 240, 255, 0.2);
  color: var(--neon-blue);
  border: 1px solid var(--neon-blue);
}

.mode-badge.mode-static {
  background: rgba(0, 255, 159, 0.2);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
}

.load-time {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
}

.cache-age {
  font-size: 12px;
  color: var(--neon-pink);
  font-weight: 600;
}

.mode-actions {
  display: flex;
  gap: var(--spacing-sm);
  margin-left: auto;
}

/* ==================== */
/* RESPONSIVE */
/* ==================== */

@media (max-width: 768px) {
  .container {
    padding: 14px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-main {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header h1 {
    font-size: 26px;
  }

  .header-actions {
    gap: 10px;
    justify-content: flex-start;
  }

  .header-actions > * {
    flex: 0 0 auto;
  }

  .hbd-tab-nav {
    width: 100%;
  }

  .mode-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mode-group {
    justify-content: space-between;
  }
  
  .mode-indicator {
    justify-content: center;
  }
  
  .mode-actions {
    margin-left: 0;
    width: 100%;
  }
  
  .mode-actions button {
    flex: 1;
  }
}


/* ==================== */
/* MODAL */
/* ==================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 240, 255, 0.2);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h2 {
  margin: 0;
  color: var(--neon-blue);
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--neon-pink);
  transform: rotate(90deg);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.edit-project-actions .btn-danger {
  margin-right: auto;
}

.danger-warning {
  border: 1px solid rgba(255, 0, 110, 0.6);
  background: rgba(127, 29, 29, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.danger-warning-title {
  color: #fb7185;
  font-weight: 700;
  margin-bottom: 6px;
}

.danger-warning-text {
  color: #fecdd3;
  line-height: 1.45;
  font-size: 14px;
}

.seed-panel {
  margin-top: 20px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.35);
}

.seed-panel-title {
  color: var(--neon-blue);
  font-weight: 700;
  margin-bottom: 4px;
}

.seed-panel-text {
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 10px;
}

.seed-json-input {
  min-height: 150px;
  width: 100%;
  resize: vertical;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.seed-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.seed-option {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.seed-option input[type="checkbox"] {
  accent-color: var(--neon-blue);
}

.seed-preview-box {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.65);
  color: var(--text-secondary);
  font-size: 12px;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* ==================== */
/* FORM */
/* ==================== */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.form-group small {
  font-size: 12px;
  color: var(--text-secondary);
}

.form-group textarea {
  resize: vertical;
  font-family: inherit;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    padding: 24px;
  }
}


/* ==================== */
/* BADGES */
/* ==================== */

.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.badge-secondary {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ==================== */
/* TOAST */
/* ==================== */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  min-width: 280px;
  max-width: 460px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.92);
  color: var(--text-primary);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(0, 255, 159, 0.6);
  box-shadow: 0 0 20px rgba(0, 255, 159, 0.25), 0 14px 34px rgba(0, 0, 0, 0.4);
}

.toast-error {
  border-color: rgba(255, 0, 110, 0.6);
  box-shadow: 0 0 20px rgba(255, 0, 110, 0.2), 0 14px 34px rgba(0, 0, 0, 0.4);
}
