/* ── VALIDATOR MAIN LAYOUT ── */
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 24px;
  min-height: calc(100vh - 61px);
  gap: 16px;
}

/* ── LOADING STATE ── */
#loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-muted);
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.4; }
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dotPulse 1s ease-in-out infinite;
}

/* ── DROP ZONE ── */
#drop-zone {
  width: 100%;
  max-width: 600px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}

#drop-zone.dragover {
  border-color: var(--accent);
  background: #fff5f8;
}

#drop-zone.analyzing {
  pointer-events: none;
  border-color: var(--accent);
  background: #fff5f8;
  animation: dzPulse 1.1s ease-in-out infinite;
}

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

.upload-text { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.upload-sub  { font-size: 13px; color: var(--text-muted); font-family: var(--mono); line-height: 1.6; margin-bottom: 20px; }
.upload-btn  { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 10px 24px; font-family: var(--sans); font-size: 14px; font-weight: 700; cursor: pointer; }
#drop-zone input[type="file"] { display: none; }

/* ── RESULT AREA ── */
#result-area {
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── PREVIEW CONTAINER ── */
.preview-container {
  position: relative;
  width: 100%;
  background: #f0ede4;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 16px;
  box-sizing: border-box;
}


#preview-iframe {
  display: block;
  border: none;
}

#preview-canvas,
#preview-img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── FALLBACK IMAGE ── */
#fallback-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fallback-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#fallback-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f0ede4;
}

/* ── BANNER CONTROLS (below preview) ── */
.banner-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-play {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--text);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.ctrl-play:hover { opacity: 0.8; }
.ctrl-play svg   { width: 15px; height: 15px; }

.ctrl-close {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.ctrl-close:hover { border-color: var(--text-muted); color: var(--text); }
.ctrl-close svg   { width: 14px; height: 14px; }

/* ── RESULT META ── */
.result-meta { padding: 0 2px; }

.result-dims {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.result-iab {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.result-filename {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── CHIPS ── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@keyframes chipIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 500;
  opacity: 0;
  animation: chipIn 0.25s ease forwards;
}

.chip svg    { width: 14px; height: 14px; flex-shrink: 0; }
.chip-ok     { background: #e8f5e9; color: #2e7d32; }
.chip-warn   { background: #ffeaea; color: #c62828; }
.chip-info   { background: var(--bg); color: var(--text); border: 1px solid var(--border); }

/* ── FOOTER ── */
footer { padding: 16px 32px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); font-family: var(--mono); border-top: 1px solid var(--border); }
.footer-copy { display: flex; align-items: center; gap: 8px; }
.footer-dot  { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* ── MOBILE NOTICE ── */
.mobile-notice {
  display: none;
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mobile-notice svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  main { padding: 20px 16px; }
  .mobile-notice { display: flex; }
  .preview-container { padding: 12px; }
  .result-dims { font-size: 18px; }
}
