/**
 * main.css - RPUC Modern OSINT Dashboard
 * A design that means business.
 */

/* ============================================
   FONTS (local, no external dependency)
   ============================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/Inter.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/JetBrainsMono.woff2') format('woff2');
}

/* ============================================
   DESIGN TOKENS
   ============================================ */

:root {
  /* Background — deep blue-black (#0D1A26) */
  --bg-base: #080f16;
  --bg-primary: #0D1A26;
  --bg-surface: #142230;
  --bg-surface-hover: #1a2b3b;
  --bg-surface-active: #213445;
  --bg-elevated: #253a4d;
  --border-color: rgba(242, 242, 233, 0.07);
  --border-color-light: rgba(242, 242, 233, 0.12);
  --border-color-strong: rgba(242, 242, 233, 0.18);

  /* Text — warm cream (#F2F2E9) */
  --text-primary: #F2F2E9;
  --text-secondary: #a8a89e;
  --text-muted: #6b6b63;
  --text-inverse: #0D1A26;

  /* Accent — terracotta red (#A6524B) */
  --accent: #A6524B;
  --accent-hover: #bf5f57;
  --accent-glow: rgba(166, 82, 75, 0.3);
  --accent-bg: rgba(166, 82, 75, 0.1);
  --accent-border: rgba(166, 82, 75, 0.25);
  --accent-gradient: linear-gradient(135deg, #A6524B, #734343);

  /* Semantic */
  --success: #5cb87a;
  --success-bg: rgba(92, 184, 122, 0.1);
  --success-border: rgba(92, 184, 122, 0.25);
  --warning: #d4a44a;
  --warning-bg: rgba(212, 164, 74, 0.1);
  --warning-border: rgba(212, 164, 74, 0.25);
  --error: #c75a5a;
  --error-bg: rgba(199, 90, 90, 0.1);
  --error-border: rgba(199, 90, 90, 0.25);
  --info: #6a8fbd;
  --info-bg: rgba(106, 143, 189, 0.1);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;

  /* Font sizes — nothing below 13px */
  --font-size-xs: 0.8125rem;    /* 13px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-md: 1.0625rem;    /* 17px */
  --font-size-lg: 1.1875rem;    /* 19px */
  --font-size-xl: 1.375rem;     /* 22px */
  --font-size-2xl: 1.625rem;    /* 26px */
  --font-size-3xl: 2rem;        /* 32px */
  --font-size-4xl: 2.5rem;      /* 40px */
  --font-size-5xl: 3.25rem;     /* 52px */
  --font-size-6xl: 4rem;        /* 64px */

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);
  --shadow-glow-sm: 0 0 10px var(--accent-glow);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Spacing */
  --element-spacing: 8px;

  /* Legacy compat */
  --sys7-white: var(--bg-surface);
  --sys7-black: var(--border-color);
  --sys7-gray-light: var(--bg-primary);
  --sys7-gray-dark: var(--text-secondary);
  --sys7-text-muted: var(--text-muted);
  --sys7-link: var(--accent);
  --sys7-success: var(--success);
  --sys7-warning: var(--warning);
  --sys7-danger: var(--error);
  --sys7-border: var(--border-color);
  --sys7-border-light: var(--border-color-light);
  --sys7-button-face: var(--bg-surface-hover);
  --primary: var(--text-primary);
  --secondary: var(--bg-surface);
  --tertiary: var(--text-secondary);
  --disabled: var(--text-muted);
  --box-shadow: none;
  --donation-bg: var(--accent-bg);
  --system-font: var(--font-sans);
  --json-key-color: #f472b6;
  --json-string-color: #34d399;
  --json-number-color: #818cf8;
  --json-keyword-color: #fbbf24;
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem; /* 16px — the floor */
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
}

/* Subtle warm vignette */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(166, 82, 75, 0.04), transparent),
    radial-gradient(circle at 50% 120%, rgba(115, 67, 67, 0.03), transparent);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

a:hover {
  color: var(--accent-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 650;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

img { max-width: 100%; height: auto; }

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 24px 0;
}

code, pre {
  font-family: var(--font-mono);
}

/* Scrollbar - thin and subtle */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

button,
.btn,
.btn-default,
::file-selector-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: 550;
  line-height: 1.4;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s var(--ease-out);
  position: relative;
  overflow: hidden;
}

button:hover,
.btn:hover,
.btn-default:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-color-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active,
.btn-default:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn:disabled,
button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent-gradient);
  border: 1px solid rgba(79, 143, 255, 0.3);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
  border-color: rgba(79, 143, 255, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-glow-sm);
}

.btn-danger {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.15);
  box-shadow: 0 0 15px rgba(248, 113, 113, 0.15);
}

.btn-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}

.btn-success:hover {
  background: rgba(52, 211, 153, 0.15);
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.15);
}

.btn-sm {
  min-height: 30px;
  padding: 4px 12px;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  min-height: 44px;
  padding: 12px 28px;
  font-size: var(--font-size-md);
}

.btn-export {
  min-height: 28px;
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
}

.btn-export:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: var(--error-border);
  color: var(--error);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.12);
  transform: none;
}

.standard-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

form {
  font-family: var(--font-sans);
}

input,
textarea,
select {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all 0.2s var(--ease-out);
  outline: none;
}

input:focus,
textarea:focus,
select:focus,
input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="number"]:focus-visible,
input[type="url"]:focus-visible,
input[type="search"]:focus-visible,
input[type="tel"]:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-glow-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

.app-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  background: var(--bg-primary);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all 0.2s var(--ease-out);
}

.app-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-glow-sm);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238892a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

label {
  font-size: var(--font-size-sm);
  font-weight: 550;
  color: var(--text-secondary);
}

/* ============================================
   SEARCH & PROGRESS
   ============================================ */

.results-section-header {
  font-weight: 700;
  font-size: var(--font-size-lg);
  margin: 32px 0 20px 0;
  padding-bottom: 12px;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  display: block;
  width: 100%;
  clear: both;
  grid-column: 1 / -1; /* span full grid */
}

.results-spacer-small,
.results-spacer-medium,
.results-spacer-large { display: none; }

.blocked-section-wrapper,
.not-found-accordion { grid-column: 1 / -1; }

.blocked-section-wrapper .results-section-header { margin-top: 0; }

.blocked-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.blocked-site-card {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.results-site-header {
  font-weight: 700;
  font-size: var(--font-size-md);
  margin: 24px 0 12px 0;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  grid-column: 1 / -1;
}

.results-site-count {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  display: block;
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.results-container {
  background: transparent;
  border: none;
  padding: 0;
  height: auto;
  overflow: visible;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.results-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

#export-buttons {
  display: flex;
  gap: 6px;
}

.results-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin: 0;
}

.results-timestamp {
  margin: 4px 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Progress bars */
.progress-container,
.search-progress {
  display: none;
  margin: 20px 0;
}

.progress-container.active,
.search-progress.active {
  display: block;
}

.progress-bar-container,
.search-progress-bar {
  height: 4px;
  background: var(--bg-surface);
  border-radius: 2px;
  overflow: hidden;
  border: none;
}

.progress-bar-fill,
.search-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: var(--accent-gradient);
  background-size: 200% 100%;
  transition: width 0.4s var(--ease-out);
  animation: shimmer 2s linear infinite;
  position: relative;
}

.search-progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  bottom: -3px;
  width: 20px;
  background: var(--accent);
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.8;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.progress-message,
.search-progress-message {
  text-align: center;
  margin-top: 10px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.search-form-title { font-size: var(--font-size-xl); font-weight: 650; margin-top: 0; }
.search-form-label { min-width: 80px; }
.search-form-input { width: 100%; }
.search-form-actions { justify-content: flex-end; margin-top: 16px; }
.search-form-button { min-width: 100px; }

/* ============================================
   PROFILE CARDS
   ============================================ */

.results-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 4px 0 60px;
}

.profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  transition: all 0.2s ease;
  overflow: visible;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.profile-card .card-select {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  z-index: 2;
}

.profile-card.card-deselected {
  opacity: 0.4;
}

.selection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.selection-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.selection-bar .selection-count {
  margin-left: auto;
}

.profile-card:hover {
  border-color: var(--border-color-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: none;
  border-radius: var(--radius-md);
  margin-right: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-site {
  font-weight: 700;
  font-size: var(--font-size-base);
  margin-bottom: 1px;
  color: var(--accent);
}

.profile-username {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.profile-info {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.profile-name {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  margin-bottom: 0;
}

.profile-handle {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.profile-bio {
  font-size: var(--font-size-xs);
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 0 0 10px;
  flex: 1;
}

.profile-stat {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 8px 6px;
  background: var(--bg-surface-hover);
  min-width: 0;
}

.profile-stat-value {
  font-weight: 700;
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
}

/* URL values in stats */
.profile-stat-value a {
  color: var(--accent);
  font-size: 0.7rem;
  word-break: break-all;
  display: block;
}

.profile-stat-label {
  color: var(--text-muted);
  font-size: 0.65rem;
  margin-top: 2px;
  text-transform: lowercase;
}

.profile-actions {
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: auto;
}

.profile-url {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}

.profile-url:hover {
  color: var(--accent-hover);
}

.profile-image-small {
  height: 16px;
  vertical-align: middle;
}

.results-site-header-container {
  margin-bottom: 12px;
  display: block;
  width: 100%;
  grid-column: 1 / -1;
}

/* ============================================
   COPY TOOLTIP (click-to-copy on truncated values)
   ============================================ */

.copy-tooltip {
  position: fixed;
  z-index: 20000;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  box-shadow: var(--shadow-lg);
  max-width: 420px;
  cursor: pointer;
  animation: tooltip-in 0.1s ease;
}

.copy-tooltip:hover {
  border-color: var(--accent-border);
}

.copy-tooltip-text {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-primary);
  line-height: 1.3;
  user-select: all;
  word-break: break-all;
}

.copy-tooltip-hint {
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

@keyframes tooltip-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Badges */
.blocked-status,
.not-found-status {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  margin-right: 6px;
}

.blocked-status {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error);
}

.not-found-status {
  background: rgba(136, 146, 168, 0.1);
  color: var(--text-muted);
}


/* ============================================
   DOCUMENT TOOLS (EXIF, OPENDOC)
   ============================================ */

.opendocscan-form,
.exif-editor-form {
  background: transparent;
  font-family: var(--font-sans);
}

.file-drop-zone {
  background: var(--bg-surface);
  border: 2px dashed var(--border-color-light);
  color: var(--text-secondary);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  margin: 16px 0;
  border-radius: var(--radius-xl);
  position: relative;
}

.file-drop-zone:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: inset 0 0 40px var(--accent-bg);
}

.file-drop-zone.drag-over {
  background: var(--accent-bg);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.drop-zone-content { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.drop-zone-icon { font-size: 36px; line-height: 1; }
.drop-zone-text { font-size: var(--font-size-sm); line-height: 1.5; }
.drop-zone-text strong { font-size: var(--font-size-md); color: var(--text-primary); }
.drop-zone-text small { color: var(--text-muted); font-size: var(--font-size-xs); }

.opendoc-privacy-notice,
.exif-privacy-notice {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.opendoc-privacy-header, .exif-privacy-header { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-sm); }
.opendoc-privacy-title, .exif-privacy-title { font-weight: 600; color: var(--text-primary); }
.opendoc-file-info, .exif-file-info { background: var(--bg-surface); border: 1px solid var(--border-color); padding: 14px; border-radius: var(--radius-md); margin-bottom: 16px; }
.exif-info-section { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; margin-bottom: 12px; }

/* Tabs */
.exif-tab-bar, .document-tab-bar { display: flex; gap: 2px; margin-bottom: 0; flex-wrap: wrap; }

.exif-tab-btn, .document-tab-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-bottom: none;
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all 0.2s var(--ease-out);
}

.exif-tab-btn:hover, .document-tab-btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); }

.exif-tab-btn.active, .document-tab-btn.active {
  background: var(--bg-surface-hover);
  color: var(--accent);
  border-bottom: 1px solid var(--bg-surface-hover);
  margin-bottom: -1px;
  z-index: 1;
  position: relative;
  font-weight: 600;
}

.exif-tab-pane, .document-tab-pane { display: none; padding: 16px; border: 1px solid var(--border-color); background: var(--bg-surface-hover); border-radius: 0 0 var(--radius-md) var(--radius-md); }
.exif-tab-pane.active, .document-tab-pane.active { display: block; }

.stat-card, .document-section { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; }
.stat-card { text-align: center; }
.stat-value { font-size: var(--font-size-2xl); font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: var(--font-size-xs); color: var(--text-muted); }
.document-section { margin-bottom: 12px; }
.file-tree-container { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; font-family: var(--font-mono); font-size: var(--font-size-xs); }

/* Info items */
.info-item { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border-color); font-size: var(--font-size-sm); color: var(--text-secondary); }
.info-item:last-child { border-bottom: none; }
.privacy-item { display: flex; align-items: center; padding: 5px 0; font-size: var(--font-size-sm); color: var(--text-secondary); }
.privacy-icon { margin-right: 8px; font-size: 14px; }
.edit-field { margin: 10px 0; display: flex; align-items: center; font-size: var(--font-size-sm); }
.edit-field label { display: flex; align-items: center; gap: 4px; min-width: 180px; color: var(--text-secondary); }
.edit-field input[type="text"] { font-size: var(--font-size-sm); padding: 6px 10px; flex: 1; max-width: 260px; }

/* ============================================
   WAYBACK, GIT, MISC COMPONENTS
   ============================================ */

.modeless-dialog { color: var(--text-primary); }
.modeless-dialog h2 { color: var(--text-primary); }
.modeless-dialog p, .modeless-dialog label { color: var(--text-secondary); }

.wayback-archive { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 12px; margin-bottom: 8px; }
.wayback-link { background: var(--bg-surface-hover); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--accent); padding: 5px 12px; text-decoration: none; display: inline-block; font-size: var(--font-size-sm); transition: all 0.2s var(--ease-out); }
.wayback-link:hover { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--shadow-glow-sm); }
.wayback-info { margin-top: 8px; padding: 10px; background: var(--bg-surface-hover); border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: var(--font-size-sm); color: var(--text-secondary); }

.git-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 8px; }
.git-recommendation { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; }
.missing-files-info { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; margin-bottom: 8px; }

.content-textarea { font-family: var(--font-mono); font-size: var(--font-size-sm); width: 100%; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 10px; resize: vertical; white-space: pre-wrap; color: var(--text-primary); }
.content-textarea-small { height: 60px; }
.content-textarea-large { height: 120px; margin-top: 4px; }

textarea[readonly] { color: var(--text-secondary) !important; background-color: var(--bg-surface) !important; }
textarea[readonly]::selection { background-color: var(--accent) !important; color: #fff !important; }

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

.d-none { display: none !important; }
.d-block { display: block; }
.d-flex, .flex { display: flex; }
.d-grid { display: grid; }
.flex-1 { flex: 1; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }

.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.gap-10 { gap: 10px; } .gap-20 { gap: 20px; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-10 { margin-top: 10px; } .mt-20 { margin-top: 20px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-10 { margin-bottom: 10px; } .mb-20 { margin-bottom: 20px; }
.my-3 { margin-top: 12px; margin-bottom: 12px; }
.ml-2 { margin-left: 8px; }
.p-0 { padding: 0; } .p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; }

.text-center { text-align: center; } .text-right { text-align: right; }
.text-xs { font-size: var(--font-size-xs); } .text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); } .text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); } .text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); } .text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); } .text-6xl { font-size: var(--font-size-6xl); }
.text-uppercase { text-transform: uppercase; } .text-strikethrough { text-decoration: line-through; }

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--error) !important; }
.text-warning { color: var(--warning) !important; }
.text-accent { color: var(--accent) !important; }

.w-100, .w-full { width: 100%; }
.rounded { border-radius: var(--radius-md); }
.overflow-hidden { overflow: hidden; }

.loading-message { color: var(--text-secondary); text-align: center; padding: 24px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
