/**
 * Arcade — Golden Master Frontend Styles
 * Covers: Hardware Wizard, ROM/BIOS File Manager, Provisioning Hub
 */

/* ─── Arcade Section Layout ───────────────────────────────────────────────── */

.arcade-section {
  padding: var(--spacing-lg) 0;
  border-bottom: 1px solid var(--bg-secondary);
}

.arcade-section + .arcade-section {
  border-top: none;
}

.arcade-card {
  background: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: var(--spacing-md);
}

.arcade-card h3 {
  color: var(--accent-neon);
  margin-bottom: var(--spacing-xs);
}

.arcade-card p {
  color: var(--text-secondary);
}

/* ─── Wizard Stepper ──────────────────────────────────────────────────────── */

.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: var(--spacing-md);
}

.wizard-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  transition: all 0.3s ease;
}

.wizard-step-dot.active {
  background: var(--accent-primary);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  transform: scale(1.3);
}

.wizard-step-dot.completed {
  background: #22c55e;
}

.wizard-step-line {
  width: 40px;
  height: 2px;
  background: var(--bg-tertiary);
  transition: background 0.3s ease;
}

.wizard-step-line.completed {
  background: #22c55e;
}

/* ─── Wizard Options Grid ─────────────────────────────────────────────────── */

.wizard-question {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.wizard-question h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.wizard-question p {
  color: var(--text-muted);
  font-size: 1rem;
}

.wizard-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: var(--spacing-md);
}

.wizard-option {
  background: var(--bg-primary);
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}

.wizard-option:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.wizard-option.selected {
  border-color: var(--accent-neon);
  background: rgba(236, 72, 153, 0.08);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.15);
}

.wizard-option-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.wizard-option-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.wizard-option-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ─── Wizard Result ───────────────────────────────────────────────────────── */

.wizard-result {
  text-align: center;
  padding: var(--spacing-md);
}

.wizard-result-badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.wizard-result p {
  max-width: 600px;
  margin: 0 auto var(--spacing-sm);
}

.wizard-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: var(--spacing-sm);
}

/* ─── File Manager ────────────────────────────────────────────────────────── */

.file-manager-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--bg-tertiary);
  padding-bottom: 0.5rem;
}

.file-tab {
  padding: 0.5rem 1.25rem;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.file-tab:hover {
  color: var(--text-primary);
}

.file-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.file-list-empty {
  text-align: center;
  padding: var(--spacing-lg) var(--spacing-sm);
  color: var(--text-muted);
}

.file-list-empty .empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--spacing-sm);
  opacity: 0.5;
}

.file-grid {
  display: grid;
  gap: 0.75rem;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease;
}

.file-row:hover {
  border-color: var(--accent-primary);
}

.file-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.file-actions {
  flex-shrink: 0;
}

.file-delete-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-delete-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.file-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Drop Zone ───────────────────────────────────────────────────────────── */

.drop-zone {
  border: 2px dashed var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg) var(--spacing-md);
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-bottom: var(--spacing-md);
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
}

.drop-zone.drag-over {
  transform: scale(1.01);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
}

.drop-zone-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: var(--spacing-xs);
  opacity: 0.7;
}

.drop-zone-text {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.drop-zone-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ─── Upload Progress ─────────────────────────────────────────────────────── */

.upload-progress {
  margin-bottom: var(--spacing-md);
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.upload-item-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.upload-bar-wrap {
  width: 120px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}

.upload-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-neon));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.upload-status {
  font-size: 0.82rem;
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

.upload-status.success {
  color: #22c55e;
}

.upload-status.error {
  color: #ef4444;
}

/* ─── Provisioning Hub ────────────────────────────────────────────────────── */

.provision-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.provision-status.not-provisioned {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}

.provision-status-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.provision-status-text {
  flex: 1;
}

.provision-status-text strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.provision-status-text span {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ─── Build Button ────────────────────────────────────────────────────────── */

.build-action {
  text-align: center;
  padding: var(--spacing-md);
}

.btn-build {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  font-size: 1.15rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-primary), #6366f1);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-build:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.45);
}

.btn-build:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-build .build-icon {
  font-size: 1.3rem;
}

/* ─── Build Progress ──────────────────────────────────────────────────────── */

.build-progress {
  max-width: 400px;
  margin: var(--spacing-md) auto 0;
  text-align: center;
}

.build-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--spacing-xs);
}

.build-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-neon));
  border-radius: 4px;
  animation: build-pulse 1.5s ease-in-out infinite;
  width: 60%;
}

@keyframes build-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.build-progress-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (min-width: 768px) {
  .wizard-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .file-manager-tabs {
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .wizard-options.four-cols {
    grid-template-columns: repeat(4, 1fr);
  }

  .arcade-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
  }
}
