/* ═══════════════════════════════════════════════════════════════
   OSINT DASHBOARD — tool cards, filters, navigation
   ═══════════════════════════════════════════════════════════════ */

/* ─── Dashboard nav bar ─────────────────────────────────────── */
#dash-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
  flex-shrink: 0;
}

.dash-nav-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 6px 16px;
  text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.dash-nav-btn:hover {
  background: var(--cyan-dim);
  border-color: rgba(34, 211, 238, 0.3);
  color: var(--text);
}

.dash-nav-btn.active {
  background: var(--cyan-dim);
  border-color: rgba(34, 211, 238, 0.5);
  color: var(--cyan);
}

/* ─── Dashboard view visibility ─────────────────────────────── */
.dashboard-view {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
}

.dashboard-view.active {
  display: flex;
}

/* ─── OSINT panel (fills view like feeds-section) ───────────── */
#osint-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ─── Header row ────────────────────────────────────────────── */
#osint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

#osint-header .label {
  margin-bottom: 0;
  flex: 1;
  min-width: 160px;
}

/* ─── Filter controls ───────────────────────────────────────── */
#osint-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Search bar */
.osint-search {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  outline: none;
  width: 180px;
  transition: background 0.15s, border-color 0.15s, width 0.2s;
}

.osint-search::placeholder {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.osint-search:focus {
  background: var(--cyan-dim);
  border-color: rgba(34, 211, 238, 0.4);
  width: 240px;
}

/* Remove the native ✕ button on search inputs (webkit) */
.osint-search::-webkit-search-cancel-button { display: none; }

/* Importance toggle group */
#importance-group {
  display: flex;
  gap: 4px;
}

.imp-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  padding: 4px 10px;
  text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  color: var(--muted);
}

.imp-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.imp-btn.active                    { color: var(--cyan);   border-color: rgba(34,211,238,0.5);  background: var(--cyan-dim); }
.imp-btn[data-imp="red"].active    { color: #f87171;       border-color: rgba(248,113,113,0.5); background: rgba(248,113,113,0.1); }
.imp-btn[data-imp="orange"].active { color: #fb923c;       border-color: rgba(251,146,60,0.5);  background: rgba(251,146,60,0.1); }
.imp-btn[data-imp="yellow"].active { color: #facc15;       border-color: rgba(250,204,21,0.5);  background: rgba(250,204,21,0.1); }
.imp-btn[data-imp="default"].active{ color: var(--muted);  border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.06); }

/* Filter select dropdowns */
.osint-select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: var(--cyan);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  padding: 5px 10px;
  text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s;
  outline: none;
  max-width: 200px;
}

.osint-select:hover,
.osint-select:focus {
  background: var(--cyan-dim);
  border-color: rgba(34, 211, 238, 0.4);
}

.osint-select option {
  background: #1a1f35;
  color: var(--text);
  text-transform: none;
}

/* Result count */
#osint-count {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
}

/* Tool grid */
#osint-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 6px;
  align-content: start;
  padding-right: 8px;
}

#osint-grid::-webkit-scrollbar       { width: 4px; }
#osint-grid::-webkit-scrollbar-track { background: transparent; }
#osint-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
#osint-grid::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* Tool card */
.osint-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 12px 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}

.osint-card:hover {
  border-color: rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.04);
}

/* Importance border colours */
.osint-card.imp-red     { border-left-color: #f87171; }
.osint-card.imp-orange  { border-left-color: #fb923c; }
.osint-card.imp-yellow  { border-left-color: #facc15; }
.osint-card.imp-default { border-left-color: rgba(255,255,255,0.15); }

/* Card top row */
.osint-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.osint-tool-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

/* Importance badge */
.osint-imp-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge-imp-red     { background: rgba(248,113,113,0.12); color: #f87171;  border: 1px solid rgba(248,113,113,0.3); }
.badge-imp-orange  { background: rgba(251,146,60,0.12);  color: #fb923c;  border: 1px solid rgba(251,146,60,0.3); }
.badge-imp-yellow  { background: rgba(250,204,21,0.12);  color: #facc15;  border: 1px solid rgba(250,204,21,0.3); }
.badge-imp-default { background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid rgba(255,255,255,0.12); }

/* Direct-visit button on card */
.osint-card-visit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 4px;
  color: rgba(34, 211, 238, 0.45);
  font-size: 0.68rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.osint-card-visit-btn:hover {
  background: rgba(34, 211, 238, 0.18);
  border-color: rgba(34, 211, 238, 0.45);
  color: var(--cyan);
}

/* Goal chips row */
.osint-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.osint-goal-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(192,132,252,0.2);
  white-space: nowrap;
}

/* Tags row */
.osint-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.osint-tag {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.07);
  color: rgba(34, 211, 238, 0.7);
  border: 1px solid rgba(34, 211, 238, 0.12);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.osint-tag-more {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border-color: rgba(255,255,255,0.08);
}

/* Empty state */
#osint-grid > .state-msg-wrapper {
  grid-column: 1 / -1;
}

/* SUBVIEW OVERLAY */
@keyframes sv-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes sv-slide-in { from { transform: translateY(12px); opacity: 0; }
                         to   { transform: translateY(0);    opacity: 1; } }

#osint-subview {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#osint-subview[hidden] { display: none; }

#osint-subview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 26, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: sv-fade-in 0.18s ease;
}

#osint-subview-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  animation: sv-slide-in 0.2s ease;
}

/* Subview header */
#osint-sv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

#osint-sv-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

#osint-sv-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

#osint-subview-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 5px 8px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

#osint-subview-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

/* Subview scrollable body */
#osint-sv-body {
  overflow-y: auto;
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#osint-sv-body::-webkit-scrollbar       { width: 4px; }
#osint-sv-body::-webkit-scrollbar-track { background: transparent; }
#osint-sv-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.osint-sv-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.osint-sv-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.osint-sv-note-goal {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--purple);
  margin-top: 10px;
  margin-bottom: 4px;
}

#osint-sv-comment .osint-sv-note-goal:first-child {
  margin-top: 0;
}

.osint-sv-comment-text {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.6;
}

.osint-sv-empty {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

/* Subview footer */
#osint-sv-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.osint-sv-visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cyan-dim);
  border: 1px solid rgba(34,211,238,0.4);
  border-radius: 8px;
  color: var(--cyan);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  padding: 7px 18px;
  text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s;
}

.osint-sv-visit-btn:hover {
  background: rgba(34,211,238,0.2);
  border-color: rgba(34,211,238,0.6);
}

/* Prevent body scroll while subview is open */
body.subview-open { overflow: hidden; }

/* Responsive */
@media (max-width: 900px) {
  #osint-grid { grid-template-columns: 1fr; }
  #osint-filters { gap: 6px; }
}

@media (max-width: 600px) {
  #osint-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #osint-header .label { flex: unset; }
  #osint-filters { justify-content: flex-start; }
  #osint-count { margin-left: 0; width: 100%; }
  .osint-select { max-width: 100%; flex: 1; }

  #osint-subview { padding: 12px; }
  #osint-subview-panel { max-height: calc(100vh - 24px); }
}
