/* ==========================================================================
   DownPortal — Submit & Uploader Studio (Sharp, Solid & High-Contrast)
   ========================================================================== */

.uploader-studio-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.modal-form-label {
  font-size: 13px;
  font-weight: 750;
  color: var(--ui-color-text-strong);
  line-height: 1.2;
}

.modal-form-input,
.modal-form-select,
.modal-form-textarea,
.uploader-spec-key,
.uploader-spec-val,
.uploader-mirror-host,
.uploader-mirror-url {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ui-color-text-strong);
  background: var(--ui-color-canvas);
  border: 1.5px solid var(--ui-color-border-strong);
  border-radius: var(--ui-radius-xs);
  padding: 8px 12px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.12s ease;
}

.modal-form-input,
.modal-form-select {
  height: 40px;
  line-height: 22px;
}

.modal-form-input:focus,
.modal-form-select:focus,
.modal-form-textarea:focus,
.uploader-spec-key:focus,
.uploader-spec-val:focus,
.uploader-mirror-host:focus,
.uploader-mirror-url:focus {
  border-color: var(--ui-color-primary);
  outline: 1.5px solid var(--ui-color-primary);
  outline-offset: -1px;
}

.modal-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  cursor: pointer;
}

/* Fulfill Target Request Highlight Card */
.uploader-target-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eff6ff;
  border: 1.5px solid var(--ui-color-primary);
  padding: 14px 16px;
  border-radius: var(--ui-radius-xs);
  gap: 12px;
  margin-bottom: 8px;
}

.uploader-target-card.is-guest-banner {
  background: #fffbeb;
  border-color: #fde68a;
  margin-bottom: 16px;
}

.req-flat-status.is-guest-status {
  background: #fef3c7;
  color: #92400e;
}

.uploader-target-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.uploader-target-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ui-color-text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploader-fulfill-status {
  width: fit-content;
  padding: 2px 8px;
  font-size: var(--type-caption-size, 11px);
  font-weight: 800;
  border-radius: var(--radius-xs);
  margin-bottom: 4px;
}

.uploader-back-button {
  padding: 6px 14px;
  font-size: var(--type-body-sm-size, 12.5px);
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.uploader-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.uploader-section--spaced {
  margin-top: 8px;
}

.uploader-form-group--spaced {
  margin-top: 8px;
}

.uploader-publish-button {
  padding: 8px 24px;
}

.uploader-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ui-color-text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--ui-color-border-strong);
  letter-spacing: -0.01em;
}

.uploader-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .uploader-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Cover Image Upload Area */
.uploader-cover-wrap {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.uploader-dropzone {
  flex: 1;
  border: 2px dashed var(--ui-color-border-strong);
  border-radius: var(--ui-radius-xs);
  background: var(--ui-color-surface-subtle);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
}

.uploader-dropzone:hover {
  border-color: var(--ui-color-primary);
  background: #eff6ff;
}

.uploader-dropzone.is-dragging {
  border-color: var(--ui-action);
  background: #dbeafe;
}

.uploader-dropzone-icon {
  width: 32px;
  height: 32px;
  color: var(--ui-color-primary);
}

.uploader-dropzone-text {
  font-size: 13px;
  font-weight: 750;
  color: var(--ui-color-text-strong);
}

.uploader-dropzone-subtext {
  font-size: var(--type-caption-size, 12px);
  color: var(--ui-color-text-muted);
}

.uploader-dropzone-subtext--spaced {
  margin-bottom: 10px;
}

.uploader-dropzone--spaced {
  margin-bottom: 12px;
}

.fulfill-banner.is-hidden {
  display: none;
}

.uploader-preview-card {
  width: 104px;
  height: 104px;
  border-radius: var(--ui-radius-xs);
  border: 1px solid var(--ui-color-border-strong);
  overflow: hidden;
  position: relative;
  background: var(--ui-color-surface-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uploader-preview-card:not(.is-visible) {
  display: none;
}

.uploader-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploader-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-xs);
  width: 22px;
  height: 22px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease;
}

.uploader-preview-remove:hover {
  background: #991b1b;
}

/* Multi-Screenshots Upload Gallery */
.uploader-screenshots-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.uploader-screenshot-preview-item {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--ui-radius-xs, 4px);
  border: 1px solid var(--ui-color-border-strong, #cbd5e1);
  background: var(--ui-color-surface-subtle, #f8fafc);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uploader-screenshot-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.uploader-screenshot-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  transition: background 0.12s ease;
}

.uploader-screenshot-preview-remove:hover {
  background: #dc2626;
}

/* Dynamic Key-Value Specs Table */
.uploader-specs-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uploader-spec-row {
  display: grid;
  grid-template-columns: 160px 1fr 38px;
  gap: 10px;
  align-items: center;
}

@media (max-width: 540px) {
  .uploader-spec-row {
    grid-template-columns: 1fr 38px;
  }
  .uploader-spec-row .uploader-spec-key {
    grid-column: 1 / -1;
  }
}

.btn-remove-spec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #ffffff;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: var(--ui-radius-xs);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.12s ease;
}

.btn-remove-spec:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

/* Dynamic Mirrors Table */
.uploader-mirrors-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uploader-mirror-row {
  display: grid;
  grid-template-columns: 160px 1fr 38px;
  gap: 10px;
  align-items: center;
}

@media (max-width: 540px) {
  .uploader-mirror-row {
    grid-template-columns: 1fr 38px;
  }
  .uploader-mirror-row .uploader-mirror-host {
    grid-column: 1 / -1;
  }
}

.btn-remove-mirror {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #ffffff;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: var(--ui-radius-xs);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.12s ease;
}

.btn-remove-mirror:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.btn-add-mirror-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--ui-color-primary);
  border-radius: var(--ui-radius-xs);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 750;
  color: var(--ui-color-primary);
  cursor: pointer;
  width: fit-content;
  transition: all 0.12s ease;
}

.btn-add-mirror-row:hover {
  background: var(--ui-color-primary);
  color: #ffffff;
}

/* Solid Editor Box / wp_editor Integration */
.uploader-editor-box {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ui-color-border-strong);
  border-radius: var(--ui-radius-xs);
  overflow: hidden;
  background: var(--ui-color-canvas);
  transition: border-color 0.12s ease;
}

.uploader-editor-box:focus-within {
  border-color: var(--ui-color-primary);
  outline: 1.5px solid var(--ui-color-primary);
  outline-offset: -1px;
}

.uploader-editor-box--wp {
  border: none;
  background: transparent;
}

.uploader-editor-box--wp .wp-editor-wrap {
  border: 1px solid var(--ui-color-border-strong);
  border-radius: var(--ui-radius-xs);
  overflow: hidden;
  background: var(--ui-color-canvas);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.uploader-editor-box--wp .wp-editor-wrap:focus-within {
  border-color: var(--ui-color-primary);
  box-shadow: 0 0 0 1px var(--ui-color-primary);
}

.uploader-editor-box--wp .wp-editor-tools {
  background: var(--ui-color-surface-subtle);
  padding: 6px 10px 0;
  border-bottom: 1px solid var(--ui-color-border);
}

.uploader-editor-box--wp .wp-switch-editor {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px 4px 0 0;
  margin-right: 4px;
}

.uploader-editor-box--wp .quicktags-toolbar {
  background: var(--ui-color-surface-subtle);
  border-bottom: 1px solid var(--ui-color-border);
  padding: 6px 8px;
}

.uploader-editor-box--wp .quicktags-toolbar input.button {
  background: var(--ui-color-canvas);
  border: 1px solid var(--ui-color-border-strong);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ui-color-text-strong);
  margin: 2px;
  cursor: pointer;
  height: 28px;
  line-height: 20px;
}

.uploader-editor-box--wp .quicktags-toolbar input.button:hover {
  background: #eff6ff;
  border-color: var(--ui-color-primary);
  color: var(--ui-color-primary);
}

.uploader-editor-box--wp .wp-editor-container {
  border: none;
}

.uploader-editor-box--wp textarea.wp-editor-area {
  font-family: var(--font-code, monospace);
  font-size: 13.5px;
  line-height: 1.6;
  padding: 14px 16px;
  color: var(--ui-color-text-strong);
  background: var(--ui-color-canvas);
  border: none;
  box-shadow: none;
  outline: none;
}

.uploader-editor-box--wp .mce-tinymce {
  box-shadow: none !important;
  border: none !important;
}

.uploader-editor-box--wp .mce-top-part::before {
  box-shadow: none !important;
}

/* Rich Markdown Typography for Post Descriptions */
.post-full__desc-text {
  font-size: var(--type-body-md-size, 14px);
  color: var(--body, #1e293b);
  line-height: 1.6;
  margin: 12px 0 18px;
  letter-spacing: 0;
  max-width: 75ch;
}

.post-full__desc-text h2,
.post-full__desc-text h3,
.post-full__desc-text h4 {
  font-weight: 800;
  color: #0f172a;
  margin: 14px 0 6px;
}

.post-full__desc-text h2 {
  font-size: 16px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
}

.post-full__desc-text h3 {
  font-size: 14.5px;
}
.post-full__desc-text h4 {
  font-size: 13.5px;
}

.post-full__desc-text ul,
.post-full__desc-text ol {
  padding-left: 20px;
  margin: 6px 0 10px;
}

.post-full__desc-text li {
  margin-bottom: 3px;
  line-height: 1.55;
}

.post-full__desc-text blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border: 1px solid var(--ui-color-border-strong);
  background: var(--surface-subdued);
  color: #1e293b;
  font-style: italic;
  border-radius: var(--radius-xs);
}
