/* ai-ml-eticasa custom styles */

:root {
  --ring: 99 102 241;
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgb(var(--ring));
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* Custom scrollbar (webkit) */
.scroll-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.scroll-thin::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Photo grid thumbnails */
.thumb {
  aspect-ratio: 4 / 3;
  background: #e2e8f0;
  background-image: linear-gradient(135deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 200%;
  animation: shimmer 1.6s linear infinite;
}
.thumb.loaded { animation: none; background: transparent; }

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

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(99,102,241,.25);
  border-top-color: rgb(99,102,241);
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Score bar */
.bar-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill { height: 100%; border-radius: 999px; transition: width .35s ease; }

/* Detection dot on image overlay */
.det-dot {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.95);
  border: 2px solid white;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(15,23,42,.5);
  cursor: pointer;
  transition: transform .15s ease;
  pointer-events: auto;
}
.det-dot:hover, .det-dot:focus {
  transform: translate(-50%, -50%) scale(1.4);
  z-index: 5;
}
.det-dot[data-vendor="restb"] { background: rgba(244, 114, 182, .95); }
.det-dot[data-vendor^="gemini"] { background: rgba(99, 102, 241, .95); }

.det-tooltip {
  position: absolute;
  background: rgba(15,23,42,.92);
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  z-index: 10;
  opacity: 0;
  transition: opacity .12s ease;
}
.det-dot:hover + .det-tooltip,
.det-dot:focus + .det-tooltip {
  opacity: 1;
}

/* Card */
.card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
}

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 11px;
  color: #334155;
  font-weight: 500;
}
.chip strong { color: #0f172a; font-weight: 600; }

/* Scrollable details */
.scroll-y { overflow-y: auto; max-height: 240px; }

/* Compare panel transition */
.fade-in { animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Responsive: stack 4-col cards on mobile */
@media (max-width: 768px) {
  .compare-grid { grid-template-columns: 1fr !important; }
  .photo-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
