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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ---- Feedback Bar ---- */

.feedback-bar {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
}

.feedback-text {
  font-size: 0.85rem;
  color: #888;
  font-weight: 500;
}

.feedback-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #16213e;
  color: #c9a84c;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
  position: relative;
}

.feedback-btn:hover {
  border-color: #c9a84c;
  background: #1f2b47;
}

.mail-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.feedback-copied {
  display: none;
}

.feedback-btn.copied .feedback-btn-text {
  display: none;
}

.feedback-btn.copied .feedback-copied {
  display: inline;
  color: #2ecc71;
}

.feedback-btn.copied {
  border-color: #2ecc71;
}

/* On small screens, stack vertically */
@media (max-width: 700px) {
  .feedback-bar {
    position: relative;
    top: 0;
    left: 0;
    justify-content: center;
    padding: 12px 0 0;
  }
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

h1 {
  text-align: center;
  color: #c9a84c;
  font-size: 2rem;
  margin-bottom: 30px;
}

/* ---- Info Section ---- */

.info-section {
  text-align: center;
  margin-bottom: 28px;
}

.info-tagline {
  font-size: 1.05rem;
  color: #aaa;
  margin-bottom: 8px;
}

.info-details {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.info-toggle {
  background: none;
  border: none;
  color: #c9a84c;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}

.info-toggle:hover {
  background: rgba(201, 168, 76, 0.1);
}

.info-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
  max-width: 600px;
  text-align: left;
  margin-top: 0;
}

.info-content.open {
  max-height: 400px;
  opacity: 1;
  margin-top: 14px;
}

.info-content p {
  font-size: 0.88rem;
  color: #999;
  line-height: 1.5;
  margin-bottom: 12px;
}

.info-supports {
  background: #16213e;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.info-supports-label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

.info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-chip {
  background: #1f2b47;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  color: #c9a84c;
  white-space: nowrap;
}

.info-example {
  background: #16213e;
  border-left: 3px solid #c9a84c;
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
}

.info-example strong {
  color: #c9a84c;
}

.info-note {
  font-size: 0.82rem !important;
  color: #777 !important;
  font-style: italic;
}

/* ---- Form ---- */

.form-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.url-input {
  width: 100%;
  max-width: 700px;
  padding: 14px 18px;
  font-size: 1rem;
  border: 2px solid #333;
  border-radius: 8px;
  background-color: #16213e;
  color: #e0e0e0;
  outline: none;
  transition: border-color 0.2s;
}

.url-input:focus {
  border-color: #c9a84c;
}

.url-input::placeholder {
  color: #666;
}

.to-label {
  font-size: 1.1rem;
  font-weight: bold;
  color: #888;
  letter-spacing: 3px;
}

.compare-btn {
  margin-top: 8px;
  padding: 14px 40px;
  font-size: 1.1rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  background-color: #c9a84c;
  color: #1a1a2e;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.compare-btn:hover {
  background-color: #d4b85e;
  transform: translateY(-1px);
}

.compare-btn:active {
  transform: translateY(0);
}

.compare-btn:disabled {
  background-color: #555;
  color: #999;
  cursor: not-allowed;
  transform: none;
}

/* ---- Status ---- */

.status {
  text-align: center;
  margin-top: 20px;
  font-size: 1rem;
  min-height: 24px;
  white-space: pre-line;
}

.status.loading { color: #c9a84c; }
.status.error { color: #e74c3c; }
.status.success { color: #2ecc71; }

/* ---- Progress Bar ---- */

.progress-container {
  max-width: 700px;
  margin: 20px auto 0;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s, max-height 0.3s;
}

.progress-container.visible {
  opacity: 1;
  max-height: 80px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #16213e;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c9a84c, #d4b85e);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.progress-text {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #c9a84c;
  text-align: center;
  min-height: 20px;
}

.progress-fill.queue-waiting {
  width: 100% !important;
  background: linear-gradient(
    90deg,
    #16213e 0%,
    #c9a84c 50%,
    #16213e 100%
  );
  background-size: 200% 100%;
  animation: queuePulse 2s ease-in-out infinite;
}

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

/* ---- Results ---- */

.results {
  margin-top: 30px;
}

/* Summary bar */
.summary-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 16px;
  background: #16213e;
  border-radius: 8px;
}

.summary-item {
  text-align: center;
}

.summary-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #c9a84c;
}

.summary-label {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

/* Display toggle */
.toggle-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.toggle-btn {
  padding: 8px 20px;
  font-size: 0.9rem;
  border: 2px solid #333;
  border-radius: 6px;
  background: #16213e;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:hover {
  border-color: #555;
  color: #ccc;
}

.toggle-btn.active {
  border-color: #c9a84c;
  color: #c9a84c;
  background: #1f2b47;
}

/* Category sections */
.category-section {
  margin-bottom: 32px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #333;
}

.category-title {
  font-size: 1.3rem;
  color: #c9a84c;
}

.category-desc {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 12px;
  margin-top: -8px;
}

/* Column headers */
.column-headers {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 12px;
  margin-bottom: 8px;
  padding: 0 8px;
}

.column-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.column-header-right {
  text-align: right;
}

/* Match rows */
.match-row {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px;
  background: #16213e;
  border-radius: 8px;
  transition: background 0.2s;
}

.match-row:hover {
  background: #1c2a4a;
}

.match-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 1.2rem;
}

/* Card display - image mode */
.card-side {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.card-side.right {
  flex-direction: row-reverse;
}

.card-image {
  width: 150px;
  border-radius: 8px;
  flex-shrink: 0;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0;
}

.card-name {
  font-weight: 600;
  color: #e0e0e0;
  font-size: 0.95rem;
}

.card-set {
  font-size: 0.8rem;
  color: #999;
}

.card-details {
  font-size: 0.8rem;
  color: #777;
}

.card-foil {
  font-size: 0.75rem;
  color: #c9a84c;
  font-weight: 600;
}

.card-qty {
  font-size: 0.8rem;
  color: #aaa;
}

/* Card display - text mode */
.card-side-text {
  padding: 8px 4px;
}

.card-side-text.right {
  text-align: right;
}

/* Unmatched section */
.unmatched-section {
  margin-top: 32px;
  margin-bottom: 32px;
}

.unmatched-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #333;
}

.unmatched-title {
  font-size: 1.2rem;
  color: #888;
}

.unmatched-count {
  font-size: 0.85rem;
  color: #1a1a2e;
  background: #888;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: bold;
}

.unmatched-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
}

.unmatched-card {
  padding: 10px;
  background: #16213e;
  border-radius: 6px;
  font-size: 0.85rem;
}

.unmatched-card-name {
  color: #e0e0e0;
  font-weight: 600;
}

.unmatched-card-details {
  color: #777;
  margin-top: 3px;
}

/* Responsive */
@media (max-width: 700px) {
  .match-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .match-separator {
    display: none;
  }

  .card-side.right {
    flex-direction: row;
    border-top: 1px solid #333;
    padding-top: 8px;
  }

  .card-side-text.right {
    text-align: left;
    border-top: 1px solid #333;
    padding-top: 8px;
  }

  .column-headers {
    display: none;
  }

  .card-image {
    width: 100px;
  }
}