/**
 * Drafts page styles — dev-only draft management UI.
 */

.drafts-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.drafts-page__hint {
  color: var(--color-text-muted, #888);
  margin-bottom: 1.5rem;
}

.drafts-page__empty {
  color: var(--color-text-muted, #888);
  text-align: center;
  padding: 2rem;
}

.drafts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.drafts-toolbar__filters {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.drafts-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid var(--color-border, #333);
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-muted, #aaa);
  cursor: pointer;
}

.drafts-filter.active {
  background: var(--color-surface, #1a1a1a);
  color: var(--color-text, #eee);
  border-color: var(--color-text-muted, #666);
}

.drafts-toolbar__toggle {
  font-size: 0.8rem;
  color: var(--color-text-muted, #888);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-publish {
  min-width: 5.5rem;
  transition:
    background 0.3s,
    transform 0.2s;
}

.btn-publish.publishing {
  opacity: 0.7;
  animation: pulse 0.8s infinite alternate;
}

.btn-publish.published {
  background: var(--color-success, #27ae60);
  border-color: var(--color-success, #27ae60);
  transform: scale(1.05);
}

@keyframes pulse {
  from {
    opacity: 0.5;
  }

  to {
    opacity: 1;
  }
}

.row-published {
  animation: fadeOut 0.8s 0.4s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.drafts-table {
  width: 100%;
  border-collapse: collapse;
}

.drafts-table th,
.drafts-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border, #333);
}

.drafts-table__date {
  font-family: monospace;
  font-size: 0.85rem;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}

/* Detail editor */
.draft-editor {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.draft-editor__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (width <= 768px) {
  .draft-editor__layout {
    grid-template-columns: 1fr;
  }
}

.draft-editor__meta h1 {
  margin-bottom: 0.25rem;
}

.draft-editor__date {
  color: var(--color-text-muted, #888);
  margin-bottom: 1rem;
}

.draft-editor__label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
}

.draft-editor__label select,
.draft-editor__label textarea {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.4rem;
  font-size: 0.9rem;
  background: var(--color-surface, #1a1a1a);
  color: var(--color-text, #eee);
  border: 1px solid var(--color-border, #333);
  border-radius: 4px;
}

.draft-editor__saving {
  color: var(--color-accent, #3498db);
  font-size: 0.8rem;
}

.draft-editor__process-result {
  font-size: 0.85rem;
  color: var(--color-success, #27ae60);
  margin-top: 0.5rem;
}

.draft-editor__images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.draft-editor__img-card {
  position: relative;
  width: 140px;
}

.draft-editor__img-card img,
.draft-editor__img-card video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.draft-editor__img-card input {
  width: 100%;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  padding: 0.2rem 0.3rem;
  background: var(--color-surface, #1a1a1a);
  color: var(--color-text, #eee);
  border: 1px solid var(--color-border, #333);
  border-radius: 3px;
}

.draft-editor__img-card button {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgb(0 0 0 / 70%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
}

.draft-editor__available {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.draft-editor__add-img {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100px;
  padding: 0.25rem;
  background: var(--color-surface, #1a1a1a);
  border: 1px dashed var(--color-border, #444);
  border-radius: 4px;
  cursor: pointer;
  color: var(--color-text-muted, #aaa);
  font-size: 0.7rem;
}

.draft-editor__add-img img,
.draft-editor__add-img video {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 3px;
}

.draft-editor__dropzone {
  border: 2px dashed var(--color-border, #444);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted, #888);
  margin-bottom: 1rem;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.draft-editor__dropzone.drag-over {
  border-color: var(--color-accent, #3498db);
  background: rgb(52 152 219 / 8%);
}

.draft-editor__dropzone p {
  margin: 0;
  pointer-events: none;
}

.draft-editor__preview .post-media-figure {
  margin: 1rem 0;
}

.draft-editor__preview .post-media-figure img,
.draft-editor__preview .post-media-figure video {
  width: 100%;
  border-radius: 4px;
}

.draft-editor__preview .post-media-figure figcaption {
  font-size: 0.85rem;
  color: var(--color-text-muted, #888);
  margin-top: 0.4rem;
  text-align: center;
}

.draft-editor__preview {
  border-left: 1px solid var(--color-border, #333);
  padding-left: 2rem;
}

@media (width <= 768px) {
  .draft-editor__preview {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--color-border, #333);
    padding-top: 1.5rem;
  }
}
