/* ==========================================================================
   privacy-inspector — Minimal looca.xyz Style
   Ultra-clean dark aesthetic, centered glass card, micro-interactions,
   subtle particles, JetBrains Mono & Plus Jakarta Sans.
   ========================================================================== */

@import url('../shared/theme.css');

/* Utility for hiding elements cleanly */
.hidden {
  display: none !important;
}

/* Particle Dust Canvas */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.45;
}

.bg-ambient-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 680px;
  height: 520px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.16) 0%, rgba(6, 7, 10, 0) 70%);
  z-index: 0;
  pointer-events: none;
  filter: blur(75px);
}

/* App Structure */
.app-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Minimal Top Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: rgba(6, 7, 10, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.brand {
  text-decoration: none;
  color: #ffffff;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* Main Content */
.main-content {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 60px 20px 24px;
  box-sizing: border-box;
}

/* Centered Glass Card (identical to looca.xyz .card) */
.card {
  width: 100%;
  background: rgba(13, 15, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-radius: 22px;
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.9),
    0 0 25px rgba(168, 85, 247, 0.12);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 
    0 30px 70px -15px rgba(0, 0, 0, 0.95),
    0 0 30px rgba(168, 85, 247, 0.2);
}

/* Hero Section */
.hero-section {
  width: 100%;
  max-width: 440px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  padding: 24px 0;
}

.hero-card {
  width: 100%;
  max-width: 440px;
  padding: 34px 26px 26px;
  text-align: center;
  border-color: rgba(168, 85, 247, 0.22);
  box-shadow: 
    0 25px 60px -15px rgba(0, 0, 0, 0.9),
    0 0 30px rgba(168, 85, 247, 0.16);
}

/* Avatar Ring */
.avatar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.avatar-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  padding: 2px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease-spring);
}

.avatar-ring:hover {
  transform: scale(1.05);
}

.avatar-icon-wrap {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0d0f16;
  border: 1px solid rgba(168, 85, 247, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-soft);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.25);
}

/* Identity */
.identity {
  margin-bottom: 22px;
}

.username {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
  margin-bottom: 4px;
}

.bio-line {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* Search Form */
.search-form {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 9, 14, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 5px 6px 5px 14px;
  margin-bottom: 16px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-form:focus-within {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.25);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #ffffff;
  outline: none;
  min-width: 0;
}

.search-input::placeholder {
  color: #4f5567;
  font-family: var(--font-sans);
}

.btn-scan {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  white-space: nowrap;
}

.btn-scan:hover:not([disabled]) {
  background: rgba(168, 85, 247, 0.38);
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.3);
  transform: translateY(-1px);
}

.btn-scan[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-soft);
  opacity: 0.8;
}

/* Quick Chips */
.quick-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  padding: 4px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.35);
  color: #ffffff;
}

/* Loading Card */
.loading-card {
  max-width: 380px;
  margin: 18px auto 0;
  padding: 26px;
  text-align: center;
}

.radar-ping-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
}

.radar-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ping-pulse 1.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.radar-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 12px var(--accent);
}

@keyframes ping-pulse {
  0% { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.loading-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.loading-step {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Error Card */
.error-card {
  max-width: 380px;
  margin: 18px auto 0;
  padding: 20px;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(24, 13, 15, 0.9);
  text-align: center;
}

.error-title {
  color: var(--bad);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.error-desc {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* Results Section */
.results-section {
  width: 100%;
  max-width: 820px;
  margin: 10px auto 40px;
}

.result-card {
  padding: 28px;
  margin-bottom: 24px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
}

.result-meta {
  flex: 1;
  min-width: 0;
}

.result-target {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-url {
  font-size: 0.76rem;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Canonical Box (Prompt exact requested format) */
.canonical-box {
  background: #090a10;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 22px;
}

.canonical-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.btn-subtle {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-subtle:hover {
  background: rgba(168, 85, 247, 0.15);
  color: #ffffff;
}

.canonical-pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-soft);
  line-height: 1.65;
  white-space: pre-wrap;
  user-select: text;
}

/* Actions Row */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Filter Bar (looca.xyz .project-filters style) */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 5px;
  background: rgba(13, 14, 19, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.filter-pill.active {
  background: rgba(168, 85, 247, 0.2);
  color: #ffffff;
  border-color: rgba(168, 85, 247, 0.35);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

/* Detailed Report Grid adjustments */
#detailed-report-container .report-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 18px !important;
  width: 100%;
}

#detailed-report-container .report-card,
.report-card {
  padding: 20px 22px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

#detailed-report-container .report-card.span-2,
.report-card.span-2 {
  grid-column: 1 / -1 !important;
}

#detailed-report-container .card-title {
  font-size: 1.02rem;
}

@media (max-width: 768px) {
  #detailed-report-container .report-grid,
  .report-grid {
    grid-template-columns: 1fr !important;
  }
  #detailed-report-container .report-card.span-2,
  .report-card.span-2 {
    grid-column: 1 !important;
  }
}

/* Footer */
.app-footer {
  padding: 26px;
  text-align: center;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

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

.app-footer a:hover {
  color: #ffffff;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  opacity: 0;
  visibility: hidden;
  background: rgba(14, 16, 24, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(168, 85, 247, 0.25);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 8px 18px;
  border-radius: 10px;
  transition: all 0.3s var(--ease-spring);
  z-index: 10000;
  backdrop-filter: blur(14px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Responsive */
@media (max-width: 600px) {
  .top-bar { padding: 12px 16px; }
  .main-content { padding: 70px 14px 30px; }
  .result-header { flex-direction: column; text-align: center; gap: 14px; }
  .result-badge-row { justify-content: center; }
  .actions-row { justify-content: center; }
}

/* Print */
@media print {
  #particle-canvas, .bg-ambient-glow, .top-bar, .filter-bar, .actions-row, .app-footer, .toast {
    display: none !important;
  }
  body, html { background: #fff !important; color: #000 !important; }
  .card, .glass { background: #fff !important; border: 1px solid #ccc !important; color: #000 !important; box-shadow: none !important; }
}
