/**
 * New Topic Image Upload Popup Styles
 *
 * Modal that appears after creating a post with new topics,
 * allowing users to upload header images for the new topic pages.
 */

/* Topic List */
.new-topic-popup-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.new-topic-item {
  background: rgba(0, 168, 255, 0.05);
  border: 1px solid rgba(0, 168, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: all 0.3s ease;
}

.new-topic-item:hover {
  background: rgba(0, 168, 255, 0.08);
  border-color: rgba(0, 168, 255, 0.3);
}

.new-topic-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.new-topic-item-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.new-topic-item-name .topic-icon {
  font-size: 1.25rem;
}

.new-topic-item-status {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.new-topic-item-status.uploaded {
  color: #22c55e;
}

.new-topic-item-status svg {
  width: 14px;
  height: 14px;
}

/* Image Upload Area */
.new-topic-image-upload {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.new-topic-image-preview {
  width: 120px;
  height: 80px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 168, 255, 0.1), rgba(0, 168, 255, 0.05));
  border: 2px dashed rgba(0, 168, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.new-topic-image-preview.has-image {
  border-style: solid;
  border-color: rgba(0, 168, 255, 0.5);
}

.new-topic-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.new-topic-image-preview .placeholder-icon {
  color: rgba(0, 168, 255, 0.4);
  font-size: 2rem;
}

/* Upload Controls */
.new-topic-upload-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.new-topic-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 168, 255, 0.1);
  border: 1px solid rgba(0, 168, 255, 0.3);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.new-topic-upload-btn:hover {
  background: rgba(0, 168, 255, 0.2);
  border-color: rgba(0, 168, 255, 0.5);
  transform: translateY(-1px);
}

.new-topic-upload-btn.uploading {
  opacity: 0.7;
  pointer-events: none;
}

.new-topic-upload-btn svg {
  width: 16px;
  height: 16px;
}

.new-topic-upload-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* Hidden file input */
.new-topic-file-input {
  display: none;
}

/* Success Message in Header */
.new-topic-success-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.new-topic-success-banner .success-icon {
  font-size: 1.5rem;
}

.new-topic-success-banner .success-text {
  flex: 1;
}

.new-topic-success-banner .success-title {
  font-size: 1rem;
  font-weight: 600;
  color: #22c55e;
  margin: 0 0 0.25rem 0;
}

.new-topic-success-banner .success-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin: 0;
}

/* Footer with Skip option */
.new-topic-popup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.new-topic-skip-link {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease;
  background: none;
  border: none;
  padding: 0;
}

.new-topic-skip-link:hover {
  color: var(--color-text-secondary);
  text-decoration: underline;
}

/* Loading spinner for upload */
.upload-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 168, 255, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: uploadSpin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
  .new-topic-image-upload {
    flex-direction: column;
  }

  .new-topic-image-preview {
    width: 100%;
    height: 100px;
  }
}
