/* ========================================
   Face Compare Tool — Premium Dark UI
   ======================================== */

:root {
  /* Dynamic Mesh Backgrounds */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;

  /* Glassmorphism Variables */
  --glass-bg: rgba(22, 22, 31, 0.4);
  --glass-bg-hover: rgba(34, 34, 46, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(139, 92, 246, 0.4);
  --glass-blur: blur(16px);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;

  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-dark: #6d28d9;
  --accent-glow: rgba(139, 92, 246, 0.4);
  --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(76, 29, 149, 0.5));

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: var(--glass-shadow);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px var(--accent-glow);

  --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* === SCREENS === */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: flex;
}

/* ========= AUTH SCREEN ========= */
#auth-screen {
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
}

#auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 30% 20%, rgba(99, 102, 241, 0.08), transparent),
    radial-gradient(ellipse 500px 300px at 70% 80%, rgba(139, 92, 246, 0.06), transparent);
  pointer-events: none;
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  padding: 0 24px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}

.logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glow);
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-light), #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.auth-form {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.auth-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 18px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  letter-spacing: 6px;
  text-align: center;
  outline: none;
  transition: all var(--transition);
}

.auth-input:focus {
  border-color: var(--glass-border-focus);
  box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.2), 0 0 0 3px var(--accent-glow);
  background: rgba(0, 0, 0, 0.4);
}

.auth-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.auth-btn:active {
  transform: scale(0.95);
}

.auth-error {
  font-size: 13px;
  color: var(--error);
  margin-top: 10px;
  min-height: 20px;
  text-align: center;
  transition: opacity var(--transition);
}

/* ========= APP SCREEN ========= */
#app-screen {
  flex-direction: column;
}

/* HEADER */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(10, 10, 15, 0.6);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-small {
  display: flex;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  border-color: var(--glass-border-focus);
  box-shadow: var(--shadow-glow);
}

/* MAIN */
.app-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

/* SECTIONS */
.section {
  animation: fadeIn 300ms ease;
}

.section.hidden {
  display: none;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.section-desc {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 28px;
}

/* === UPLOAD === */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.upload-card {
  position: relative;
}

.upload-zone {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--glass-border);
}

.upload-zone:hover {
  border-color: var(--accent-light);
  background: var(--glass-bg-hover);
  box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.15), 0 0 0 1px var(--glass-border-focus);
}

.upload-zone.has-image {
  border-style: solid;
  border-color: var(--accent);
  border-width: 1px;
}

.upload-zone.dragover {
  border-color: var(--accent-light);
  background: rgba(139, 92, 246, 0.1);
  box-shadow: inset 0 0 60px rgba(139, 92, 246, 0.2);
  transform: scale(1.02);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.upload-placeholder.hidden {
  display: none;
}

.upload-icon {
  color: var(--text-tertiary);
  opacity: 0.6;
}

.upload-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  border-radius: var(--radius-lg);
}

.upload-preview.visible {
  display: block;
}

/* Batch Preview Miniatures */
.upload-preview-container {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  position: absolute;
  inset: 0;
  padding: 12px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  overflow-y: auto;
  z-index: 1;
}
.upload-preview-container:empty {
  display: none;
}
.miniature-item {
  position: relative;
  width: calc(33.333% - 6px);
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  animation: fadeIn 0.2s ease-out forwards;
}
.miniature-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.miniature-add-more {
  position: relative;
  width: calc(33.333% - 6px);
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.miniature-add-more:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}
.miniature-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.miniature-item:hover .miniature-remove {
  opacity: 1;
}
.miniature-remove:hover {
  background: var(--error);
}

.upload-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 6px;
  z-index: 2;
}

.ref-badge {
  background: rgba(99, 102, 241, 0.9);
  color: white;
}

.gen-badge {
  background: rgba(139, 92, 246, 0.9);
  color: white;
}

/* === BUTTONS === */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--accent-light);
  box-shadow: var(--shadow-glow);
}

/* === LOADING === */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  text-align: center;
}

.loading-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 28px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.spinner-ring.delay-1 {
  inset: 8px;
  border-top-color: var(--accent-light);
  animation-delay: 0.15s;
  animation-duration: 1.5s;
}

.spinner-ring.delay-2 {
  inset: 16px;
  border-top-color: #c4b5fd;
  animation-delay: 0.3s;
  animation-duration: 1.8s;
}

.loading-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.loading-desc {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 32px;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-tertiary);
  transition: color var(--transition);
}

.step.active {
  color: var(--accent-light);
}

.step.done {
  color: var(--success);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: background var(--transition);
  flex-shrink: 0;
}

.step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 1.5s ease infinite;
}

.step.done .step-dot {
  background: var(--success);
}

/* === RESULTS === */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 40px;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.result-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.result-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.result-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-light);
  letter-spacing: 0.5px;
}

/* == COMPARE SLIDER & CONTAINERS == */
.compare-container, .metrics-container, .overlay-container {
  position: relative;
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.compare-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  aspect-ratio: 3/4;
  user-select: none;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.compare-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.compare-img-bottom {
  z-index: 1;
}

.compare-img-top {
  z-index: 2;
  clip-path: inset(0 50% 0 0);
}

.compare-slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  transform: translateX(-50%);
  cursor: ew-resize;
  z-index: 10;
}

.slider-line {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  color: #333;
  transition: transform 150ms ease;
}

.slider-handle:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.compare-labels {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-tertiary);
}

/* == METRICS == */
.metrics-container {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metrics-img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
}

.gen-full-wrapper {
  position: relative;
}

.btn-download-metrics {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 5;
}

.gen-full-wrapper:hover .btn-download-metrics {
  opacity: 1;
}

.btn-download-metrics:hover {
  background: var(--accent);
  transform: scale(1.1);
}

.metric-block {
  padding: 0 4px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.metric-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.metric-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.metric-bar {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 1000ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Face Search Styles */
.search-results-container {
    margin-top: 30px;
    padding: 24px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    display: none;
    animation: fadeIn 0.5s ease;
    box-shadow: var(--shadow-md);
}

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.search-result-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.search-result-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--glass-border-focus);
}

.result-thumb-container {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    background: #1a1a1a;
}

.result-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-confidence {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.result-info {
    padding: 12px;
}

.result-site {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-link {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-link:hover {
    color: var(--accent-color);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Euclidean: low similarity=red, high similarity=green */
#metric-bar-euclidean {
  background: linear-gradient(90deg, var(--error), var(--warning), var(--success));
}

/* Cosine: low similarity=red, high similarity=green */
#metric-bar-cosine {
  background: linear-gradient(90deg, var(--error), var(--warning), var(--success));
}

.metric-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
  padding: 0 2px;
}

.scale-label {
  font-size: 10px;
  opacity: 0.7;
}

.metrics-info-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.metrics-info-tip svg {
  flex-shrink: 0;
  color: var(--accent-light);
}

.metric-hint {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  min-height: 22px;
  transition: all var(--transition);
}

.metric-hint.good {
  color: var(--success);
  background: rgba(16, 185, 129, 0.08);
}

.metric-hint.medium {
  color: #bef264;
  background: rgba(190, 242, 100, 0.1);
}

.metric-hint.bad {
  color: var(--error);
  background: rgba(239, 68, 68, 0.08);
}

.metric-value-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: right;
  margin-top: 2px;
  opacity: 0.5;
  font-variant-numeric: tabular-nums;
  font-family: 'Inter', monospace;
}

.verdict-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.verdict-icon {
  font-size: 20px;
}

.metric-verdict {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.metric-verdict.excellent {
  color: #10b981;
}

.verdict-container.excellent {
  background: rgba(16, 185, 129, 0.1);
}

.metric-verdict.good {
  color: #84cc16;
}

.verdict-container.good {
  background: rgba(132, 204, 22, 0.1);
}

.metric-verdict.medium {
  color: #bef264;
}

.verdict-container.medium {
  background: rgba(190, 242, 100, 0.1);
  border: 1px solid rgba(190, 242, 100, 0.2);
}

.metric-verdict.low {
  color: #f97316;
}

.verdict-container.low {
  background: rgba(249, 115, 22, 0.1);
}

.metric-verdict.bad {
  color: #ef4444;
}

.verdict-container.bad {
  background: rgba(239, 68, 68, 0.1);
}

/* === METRICS ANIMATIONS === */
@keyframes runWave {
  from { transform: translateX(0); }
  to { transform: translateX(-20px); }
}

.animated-cosine-wave {
  animation: runWave var(--metric-speed-cosine, 1s) linear infinite;
}

@keyframes shootLaser {
  from { stroke-dashoffset: 8; }
  to { stroke-dashoffset: 0; }
}

.animated-euclidean-laser {
  animation: shootLaser var(--metric-speed-euclidean, 0.5s) linear infinite;
}

/* OVERLAY IMAGE CONTAINER */
.overlay-full-wrapper {
  position: relative;
  margin-top: 16px;
}

.overlay-img {
  width: 100%;
  border-radius: var(--radius-sm);
  display: block;
}

.btn-download-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 5;
}

.overlay-full-wrapper:hover .btn-download-overlay {
  opacity: 1;
}

.btn-download-overlay:hover {
  background: var(--accent);
  transform: scale(1.1);
}


/* === RESULT ACTIONS === */
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* === ERROR === */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  text-align: center;
  gap: 16px;
}

.error-title {
  font-size: 20px;
  font-weight: 600;
}

.error-desc {
  font-size: 14px;
  color: var(--text-tertiary);
  max-width: 400px;
}

.error-container .btn-primary {
  width: auto;
  margin-top: 8px;
}

/* === FOOTER === */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  font-size: 12px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-subtle);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

.shake {
  animation: shake 300ms ease;
}

@keyframes shimmer {
  0% { left: -100%; top: 0; }
  100% { left: 200%; top: 0; }
}

.honeycomb-spinner {
  width: 50px;
  height: 50px;
  background: conic-gradient(from 0deg at 50% 50%, rgba(210, 172, 71, 0) 0%, rgba(210, 172, 71, 1) 100%);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  mask: radial-gradient(transparent 55%, black 56%);
  -webkit-mask: radial-gradient(transparent 55%, black 56%);
}

.osint-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(210, 172, 71, 0.6);
}
.osint-btn:active {
  transform: translateY(1px);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .results-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .bottom-island {
    grid-template-columns: 1fr 1fr !important;
  }
  .search-results-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .upload-grid,
  .results-grid,
  .bottom-island,
  .result-actions {
    grid-template-columns: 1fr !important;
  }

  .upload-zone {
    aspect-ratio: 4 / 3;
  }

  .app-main {
    padding: 20px 16px;
  }

  .section-title {
    font-size: 18px;
  }

  .app-footer {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}

/* INFO BANNER */
.info-banner {
  margin: 16px 24px 0;
  padding: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 16px;
  align-items: center;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.banner-icon {
  color: var(--accent-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.2);
}

.banner-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.banner-text strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 600px) {
  .info-banner {
    margin: 12px 16px 0;
    padding: 12px;
    gap: 12px;
  }
}
