/* ── Component: LaunchDialog, LaunchProgress ──
 * Class prefix: launch-
 */

/* ── Launch Dialog ── */
.launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 11, 20, 0.85);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.launch-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.launch-dialog {
  background: rgba(22, 27, 45, 0.95);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 20px;
  padding: 40px;
  max-width: 540px;
  width: 90%;
  text-align: center;
  animation: launch-dialog-in 0.4s ease;
}

@keyframes launch-dialog-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.launch-dialog h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}

.launch-dialog .launch-subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
  margin: 0 0 24px;
}

.launch-textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.launch-textarea:focus {
  border-color: rgba(167, 139, 250, 0.5);
}

.launch-textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Example chips */
.launch-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 16px 0 24px;
}

.launch-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  background: rgba(167, 139, 250, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.launch-chip:hover {
  background: rgba(167, 139, 250, 0.18);
  color: #fff;
  border-color: rgba(167, 139, 250, 0.4);
}

/* Actions */
.launch-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.launch-btn {
  width: 100%;
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #a78bfa, #6C3BEE);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.launch-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(108, 59, 238, 0.4);
}

.launch-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.launch-skip {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
}

.launch-skip:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Launch Progress (full-page) ── */
.launch-page {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080B14;
  animation: launch-page-in 0.5s ease;
}

@keyframes launch-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.launch-progress {
  max-width: 560px;
  width: 100%;
  padding: 0 20px;
}

.launch-progress-header {
  text-align: center;
  margin-bottom: 32px;
}

.launch-progress-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
}

.launch-progress-header p {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  margin: 0;
}

.launch-progress-header .launch-skip {
  margin-top: 14px;
}

/* Task rows */
.launch-tasks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.launch-task-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s ease;
}

.launch-task-row.active {
  background: rgba(167, 139, 250, 0.06);
  border-color: rgba(167, 139, 250, 0.2);
}

.launch-task-row.done {
  border-color: rgba(52, 211, 153, 0.2);
}

.launch-task-row.failed {
  border-color: rgba(244, 114, 182, 0.2);
}

/* Mini avatar in task row */
.launch-task-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

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

.launch-task-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.launch-task-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Status icon */
.launch-task-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Spinner */
.launch-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(167, 139, 250, 0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: launch-spin 0.8s linear infinite;
}

@keyframes launch-spin {
  to { transform: rotate(360deg); }
}

/* Check mark */
.launch-check {
  color: #34d399;
  font-size: 1.1rem;
  line-height: 1;
}

/* Fail X */
.launch-fail {
  color: #f472b6;
  font-size: 1.1rem;
  line-height: 1;
}

/* Pending dot */
.launch-pending-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

/* ── Summary Card ── */
.launch-summary-card {
  background: rgba(22, 27, 45, 0.9);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  animation: launch-dialog-in 0.4s ease;
}

.launch-summary-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px;
}

.launch-summary-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}

.launch-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.7);
}

.launch-summary-item .icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.launch-summary-item a {
  color: #a78bfa;
  text-decoration: none;
}

.launch-summary-item a:hover {
  text-decoration: underline;
}

.launch-summary-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 16px;
}

.launch-go-btn {
  width: 100%;
  padding: 13px 24px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #a78bfa, #6C3BEE);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.launch-go-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(108, 59, 238, 0.4);
}

/* ── Tool Recommendations ── */
.tool-recs {
  max-width: 720px;
  width: 100%;
  padding: 0 20px;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
}

.tool-recs-header {
  text-align: center;
  margin-bottom: 28px;
}

.tool-recs-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
}

.tool-recs-subtitle {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  margin: 0;
  max-width: 500px;
  margin-inline: auto;
  line-height: 1.4;
}

.tool-recs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

/* ── Tool card ── */
.tool-rec-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: tool-rec-in 0.4s ease both;
}

.tool-rec-card:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 6px 24px rgba(108, 59, 238, 0.15);
}

@keyframes tool-rec-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.tool-rec-card-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.tool-rec-card-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
}

.tool-rec-card-desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.4;
  flex: 1;
}

.tool-rec-card-meta {
  margin-top: 4px;
}

.tool-rec-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
}

.tool-rec-badge--ready {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}

.tool-rec-badge--setup {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
}

.tool-rec-card-minis {
  font-size: 0.72rem;
  color: rgba(167, 139, 250, 0.7);
  margin-top: 2px;
}

/* ── Skeleton shimmer ── */
.tool-rec-skeleton {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-rec-skel-icon,
.tool-rec-skel-name,
.tool-rec-skel-desc {
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: tool-rec-shimmer 1.5s ease-in-out infinite;
}

.tool-rec-skel-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.tool-rec-skel-name {
  width: 70%;
  height: 14px;
}

.tool-rec-skel-desc {
  width: 100%;
  height: 10px;
}

.tool-rec-skel-desc.short {
  width: 60%;
}

@keyframes tool-rec-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Actions ── */
.tool-recs-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-bottom: 32px;
}

/* ── Error state ── */
.tool-recs-error {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  padding: 40px 0;
  grid-column: 1 / -1;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .launch-dialog {
    padding: 28px 20px;
    margin: 16px;
  }

  .launch-dialog h2 {
    font-size: 1.3rem;
  }

  .launch-progress {
    padding: 0 12px;
  }

  .tool-recs {
    padding: 0 12px;
  }

  .tool-recs-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
}
