/* components/js_api/wizard.css - スタートアップ・ウィザード スタイル */

.puc-wizard-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.puc-wizard-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.puc-wizard-modal {
  background: #ffffff;
  width: 95%;
  max-width: 800px;
  height: 100%;
  max-height: 100%;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.puc-wizard-backdrop.show .puc-wizard-modal {
  transform: translateY(0) scale(1);
}

/* Header */
.puc-wizard-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.puc-wizard-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.puc-wizard-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.puc-wizard-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg);
}

/* Step Indicator */
.puc-wizard-stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  padding: 10px 20px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.puc-wizard-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.puc-wizard-step-item.active {
  opacity: 1;
}

.puc-wizard-step-item.completed {
  opacity: 0.9;
}

.puc-wizard-step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 60%;
  width: 80%;
  height: 2px;
  background: #cbd5e1;
  z-index: 1;
}

.puc-wizard-step-item.completed:not(:last-child)::after {
  background: #10b981;
}

.puc-wizard-step-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.3s;
}

.puc-wizard-step-item.active .puc-wizard-step-circle {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.puc-wizard-step-item.completed .puc-wizard-step-circle {
  background: #059669;
  color: #ffffff;
}

.puc-wizard-step-label {
  font-size: 0.72rem;
  margin-top: 4px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.puc-wizard-step-item.active .puc-wizard-step-label {
  color: #0f172a;
}

/* Body Content */
.puc-wizard-body {
  padding: 16px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.puc-wizard-step-pane {
  display: none;
  animation: pucFadeIn 0.3s ease;
}

.puc-wizard-step-pane.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1 1 auto;
}

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

/* Card Boxes */
.puc-guide-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.puc-guide-highlight {
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: #166534;
}

/* Device Tabs */
.puc-device-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  flex-shrink: 0;
}

.puc-device-btn {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.puc-device-btn.active {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.puc-device-pane {
  display: none;
}

.puc-device-pane.active {
  display: block;
}

.puc-instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.puc-step-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.puc-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.puc-feature-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.puc-feature-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.puc-feature-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
  display: block;
}

.puc-feature-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1e293b;
  margin-bottom: 4px;
}

.puc-feature-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.35;
}

.puc-wizard-iframe-wrap {
  width: 100%;
  flex: 1 1 auto;
  min-height: 280px;
  height: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
  background: #f8fafc;
  margin-bottom: 0;
}

.puc-wizard-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Footer */
.puc-wizard-footer {
  background: #f8fafc;
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .puc-wizard-backdrop {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .puc-wizard-modal {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 16px;
  }
  .puc-wizard-header {
    padding: 12px 14px;
  }
  .puc-wizard-stepper {
    padding: 8px 12px;
  }
  .puc-wizard-step-label {
    font-size: 0.65rem;
  }
  .puc-wizard-body {
    padding: 12px 12px;
  }
  .puc-wizard-footer {
    padding: 10px 14px;
  }
  .puc-wizard-iframe-wrap {
    min-height: 240px;
  }
  .puc-feature-grid {
    grid-template-columns: 1fr;
  }
}
