/* Distribution Card Styles — Notion-inspired refinement */

/* Badge system — pill style */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 9999px;
  line-height: 1.4;
}

.badge-success {
  background: var(--green-light);
  color: var(--green);
}

.badge-warning {
  background: var(--orange-light);
  color: var(--orange);
}

.badge-muted {
  background: var(--bg);
  color: var(--text-muted);
}

/* Card container — fixed width, consistent spacing */
.dist-card {
  width: 100%;
  margin-bottom: 32px;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
  box-shadow:
    rgba(0,0,0,0.03) 0px 1px 3px,
    rgba(0,0,0,0.02) 0px 4px 12px;
}

.dist-card:hover {
  border-color: rgba(0,0,0,0.12);
  box-shadow:
    rgba(0,0,0,0.04) 0px 2px 6px,
    rgba(0,0,0,0.03) 0px 8px 24px;
  transform: translateY(-1px);
}

/* Header: icon + platform name + form + note + status */
.dist-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.01);
  min-height: 56px;
}

/* Platform icon — unified rounded square with brand color */
.dist-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dist-card-platform {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  flex-shrink: 0;
  min-width: 60px;
}

.dist-card-form {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 9999px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Note — inline after form, muted */
.dist-card-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dist-card-status {
  margin-left: auto;
  flex-shrink: 0;
}

/* Content area — full content visible */
.dist-card-body {
  padding: 20px;
  background: #fafafa;
}

.dist-card-body textarea {
  width: 100%;
  min-height: 300px;
  padding: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--white);
  resize: vertical;
  transition: var(--transition);
  overflow-y: auto;
}

.dist-card-body textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

/* Button group layout */
.dist-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dist-actions-left {
  display: flex;
  gap: 12px;
}

.dist-actions-right {
  margin-left: auto;
  display: flex;
  gap: 12px;
}

/* Empty state card */
.dist-empty-card {
  text-align: center;
  padding: 48px 24px;
  background: var(--white);
  border: 1px dashed rgba(0,0,0,0.1);
  border-radius: 12px;
  color: var(--text-muted);
}

.dist-empty-card .dist-empty-icon {
  font-size: 36px;
  opacity: 0.4;
  margin-bottom: 16px;
}

.dist-empty-card .dist-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dist-empty-card .dist-empty-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* Platforms container — consistent spacing */
#distPlatforms {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Generating indicator */
.generating-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.generating-indicator .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.generating-indicator p {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 24px;
}

/* Generation progress */
.generation-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 300px;
}

.progress-item {
  font-size: 13px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.progress-item.generating {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 500;
}

.progress-item.completed {
  background: var(--green-light);
  color: var(--green);
}

.progress-item.failed {
  background: var(--red-light);
  color: var(--red);
}

/* Screenshot upload area */
.screenshot-upload-area {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 8px;
  min-height: 80px;
}

.screenshot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.screenshot-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.screenshot-item:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(79, 110, 247, 0.15);
}

.screenshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.screenshot-item .screenshot-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.screenshot-item:hover .screenshot-delete {
  opacity: 1;
}

.screenshot-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 12px;
  transition: var(--transition);
}

.screenshot-add-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Screenshot thumbnail in table */
.screenshot-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.screenshot-thumb:hover {
  border-color: var(--blue);
  transform: scale(1.1);
}

.screenshot-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Screenshot preview modal */
.screenshot-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.screenshot-preview-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.screenshot-preview-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.screenshot-preview-close:hover {
  background: rgba(255,255,255,0.3);
}

.screenshot-preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.screenshot-preview-nav:hover {
  background: rgba(255,255,255,0.3);
}

.screenshot-preview-prev {
  left: 20px;
}

.screenshot-preview-next {
  right: 20px;
}

.screenshot-preview-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  background: rgba(0,0,0,0.5);
  padding: 4px 12px;
  border-radius: 12px;
}
