/* Upload Page */
.upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms var(--ease-out);
  background: var(--bg-secondary);
  overflow: hidden;
}

.upload-area::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 250ms ease;
  pointer-events: none;
}

.upload-area:hover::before,
.upload-area.dragover::before {
  opacity: 1;
}

.upload-area:hover {
  border-color: var(--accent);
}

.upload-area.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: scale(1.01);
}

.upload-area.has-file {
  border-color: var(--success);
  border-style: solid;
}

.upload-icon-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 220ms var(--ease-out), background-color 220ms ease;
}

.upload-icon-svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.upload-area:hover .upload-icon-wrap {
  transform: translateY(-3px);
  background: rgba(0, 212, 255, 0.18);
}

.upload-area h3 {
  margin-bottom: 0.4rem;
  position: relative;
}

.upload-area p {
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
}

.file-info {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.file-info .filename {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.file-info .filesize {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Model Analysis Result */
.analysis-result {
  margin-top: 2rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.analysis-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  transition: border-color 180ms ease, transform 180ms var(--ease-out);
}

.analysis-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.analysis-item .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.analysis-item .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Price Comparison */
.price-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.price-option {
  position: relative;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

.price-option:active {
  transform: scale(0.97);
}

.price-option.selected {
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent);
}

.price-option.selected::before {
  content: '\2713';
  position: absolute;
  top: 6px;
  left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  animation: heroRise 200ms var(--ease-out);
}

.info-icon {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-style: normal;
  line-height: 16px;
  text-align: center;
  cursor: help;
  z-index: 2;
  transition: background-color 160ms ease, color 160ms ease, transform 140ms var(--ease-out);
}
.info-icon:hover,
.info-icon.active {
  background: var(--accent);
  color: #1a2124;
}
.info-icon:active {
  transform: scale(0.92);
}
.info-icon .info-tooltip {
  position: absolute;
  top: 20px;
  right: 0;
  width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  font-size: 0.78rem;
  font-weight: normal;
  line-height: 1.4;
  color: var(--text-secondary);
  text-align: left;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: scale(0.95) translateY(-4px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.info-icon:hover .info-tooltip,
.info-icon.active .info-tooltip {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.price-option:hover,
.price-option.selected {
  border-color: var(--accent);
}

.price-option .material-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.price-option .material-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.price-option .material-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.upload-progress {
  margin-top: 1rem;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}

/* Server-Analysephase nach 100% Upload: kein echter Fortschritt mehr messbar,
   daher ein wandernder Balken statt eines stehenden 100%-Balkens. */
.progress-bar-fill.indeterminate {
  width: 40% !important;
  animation: upload-indeterminate 1.2s ease-in-out infinite;
}

@keyframes upload-indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}
