/* ==============================================
   BIDARTIGOS – Contribuidor: Abas + Editor Artigo
   Arquivo: contribuidor-artigos.css
============================================== */

/* =========================
   ABAS
========================= */

.contributor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.2rem 0;
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.contributor-tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #475569;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.88rem;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

.contributor-tab-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: translateY(-1px);
}

.contributor-tab-btn.active {
  background: #0D8F81;
  border-color: #0D8F81;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(13, 143, 129, 0.22);
}

.contributor-tab-panel {
  display: none;
}

.contributor-tab-panel.active {
  display: block;
}

/* =========================
   ÁREA DO ARTIGO
========================= */

.contributor-article-section,
.contributor-my-articles-section {
  margin-top: 1.2rem;
}

.article-helper-box {
  background:
    linear-gradient(135deg, rgba(13, 143, 129, 0.08), rgba(15, 23, 42, 0.03));
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 0.95rem 1rem;
  color: #475569;
  font-size: 0.93rem;
  line-height: 1.55;
  margin-bottom: 1.2rem;
}

.article-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.article-form-grid .full {
  grid-column: 1 / -1;
}

.article-counter {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

/* =========================
   UPLOAD DA CAPA
========================= */

#article-cover-file {
  cursor: pointer;
}

.article-cover-preview {
  margin-top: 0.7rem;
}

.article-cover-preview img {
  width: min(260px, 100%);
  max-height: 160px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.article-cover-preview .muted,
.article-cover-preview p {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: #64748b;
}

.upload-ok {
  color: #047857;
  font-size: 0.82rem;
  font-weight: 900;
  margin: 0.45rem 0 0;
}

/* =========================
   EDITOR DO ARTIGO
========================= */

.article-editor-toolbar {
  position: sticky;
  top: 74px;
  z-index: 10;

  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;

  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #dbe5e4;
  border-bottom: none;
  border-radius: 18px 18px 0 0;

  padding: 0.65rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.article-editor-toolbar button,
.article-editor-toolbar select,
.article-editor-toolbar input[type="color"] {
  min-height: 34px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #0f172a;
  border-radius: 10px;
  padding: 0.38rem 0.62rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  transition:
    background 0.14s ease,
    color 0.14s ease,
    border-color 0.14s ease,
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

.article-editor-toolbar button:hover,
.article-editor-toolbar select:hover {
  background: #eef6f5;
  border-color: rgba(13, 143, 129, 0.35);
  transform: translateY(-1px);
}

.article-editor-toolbar button:active {
  transform: translateY(0);
}

.article-editor-toolbar button.active {
  background: #0D8F81;
  border-color: #0D8F81;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(13, 143, 129, 0.22);
}

.article-editor-toolbar select {
  min-width: 72px;
}

.article-editor-toolbar input[type="color"] {
  width: 38px;
  padding: 0.2rem;
}

.article-toolbar-separator {
  width: 1px;
  height: 28px;
  background: #d1d5db;
  margin: 0 0.25rem;
}

/* Campo visual e campo HTML */

.article-editor-content,
.article-content-html {
  width: 100%;
  min-height: 520px;
  max-height: 75vh;
  overflow: auto;

  border: 1px solid #dbe5e4;
  border-radius: 0 0 18px 18px;
  background: #ffffff;
  color: #111827;

  padding: 1.25rem;
  outline: none;
  box-sizing: border-box;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.03rem;
  line-height: 1.78;

  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.article-editor-content:focus,
.article-content-html:focus {
  border-color: #0D8F81;
  box-shadow:
    0 0 0 4px rgba(13, 143, 129, 0.10),
    inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

.article-editor-content:empty::before {
  content: "Escreva o artigo aqui...";
  color: #94a3b8;
  pointer-events: none;
}

.article-content-html {
  display: none;
  resize: vertical;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: #0f172a;
  background: #f8fafc;
}

/* =========================
   CONTEÚDO DENTRO DO EDITOR
========================= */

.article-editor-content h1,
.article-editor-content h2,
.article-editor-content h3,
.article-editor-content h4 {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.article-editor-content h1 {
  font-size: 2rem;
  margin: 1.4rem 0 0.8rem;
}

.article-editor-content h2 {
  font-size: 1.55rem;
  margin: 1.35rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
}

.article-editor-content h3 {
  font-size: 1.28rem;
  margin: 1.15rem 0 0.55rem;
}

.article-editor-content h4 {
  font-size: 1.05rem;
  margin: 1rem 0 0.5rem;
}

.article-editor-content p {
  margin: 0.75rem 0;
}

.article-editor-content a {
  color: #0D8F81;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-editor-content ul,
.article-editor-content ol {
  padding-left: 1.45rem;
  margin: 0.85rem 0;
}

.article-editor-content li {
  margin: 0.35rem 0;
}

.article-editor-content blockquote {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 5px solid #0D8F81;
  background: #f0fdfa;
  color: #334155;
  border-radius: 14px;
  font-style: italic;
}

.article-editor-content hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 1.4rem 0;
}

.article-editor-content pre {
  background: #0f172a;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 14px;
  overflow: auto;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-editor-content code {
  background: #e2e8f0;
  color: #0f172a;
  padding: 0.12rem 0.28rem;
  border-radius: 6px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.92em;
}

.article-editor-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.article-editor-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  overflow: hidden;
  border-radius: 14px;
}

.article-editor-content table th,
.article-editor-content table td {
  border: 1px solid #cbd5e1;
  padding: 0.65rem;
  vertical-align: top;
}

.article-editor-content table th {
  background: #f1f5f9;
  font-weight: 900;
}

.article-editor-content img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 0.7rem 0;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.article-editor-content figure {
  margin: 1rem 0;
}

.article-editor-content figcaption {
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.82rem;
  text-align: center;
}

.article-editor-content .image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}

.article-editor-content .image-grid img {
  flex: 1 1 220px;
  min-width: 180px;
  object-fit: cover;
}

/* Math / fórmula */

.article-editor-content .math-formula,
.article-request-content .math-formula {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  overflow-x: auto;
  font-family: Consolas, Monaco, "Courier New", monospace;
  color: #0f172a;
}

/* =========================
   STATUS FLUTUANTE DE UPLOAD
========================= */

.floating-upload-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;

  background: #0f172a;
  color: #ffffff;
  padding: 0.8rem 1rem;
  border-radius: 14px;

  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.25);
  font-size: 0.9rem;
  font-weight: 900;
}

/* =========================
   MEUS ARTIGOS
========================= */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.article-request-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.article-request-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.article-request-header h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.article-request-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: center;
  margin-top: 0.45rem;
  color: #64748b;
  font-size: 0.8rem;
}

.article-request-cover {
  width: 108px;
  height: 76px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  flex: 0 0 auto;
  background: #f8fafc;
}

.article-request-summary {
  color: #475569;
  line-height: 1.55;
  margin: 0.85rem 0 0;
}

.article-request-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.article-request-tags span {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  font-size: 0.74rem;
  font-weight: 800;
}

.article-request-details {
  margin-top: 0.9rem;
  border-top: 1px solid #eef2f6;
  padding-top: 0.8rem;
}

.article-request-details summary {
  cursor: pointer;
  color: #0D8F81;
  font-size: 0.86rem;
  font-weight: 900;
}

.article-request-content {
  margin-top: 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  line-height: 1.65;
  max-height: 420px;
  overflow: auto;
  color: #1e293b;
}

.article-request-content img {
  max-width: 100%;
  border-radius: 12px;
}

.article-request-source,
.admin-note-box {
  margin-top: 0.85rem;
  padding: 0.9rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.article-request-source pre {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  color: #475569;
}

.admin-note-box {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.admin-note-box p {
  margin: 0.35rem 0 0;
}

.article-request-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

/* Botões pequenos, caso o CSS base não esteja ajudando */

.btn-small {
  border: none;
  border-radius: 999px;
  padding: 0.48rem 0.88rem;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.btn-small-edit {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.btn-small-delete {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.term-lock-message {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
}

/* Status dos cards */

.status-card-approved {
  border-left: 5px solid #16a34a;
}

.status-card-rejected {
  border-left: 5px solid #dc2626;
}

.status-card-needs_review {
  border-left: 5px solid #f97316;
}

.status-card-pending {
  border-left: 5px solid #2563eb;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.58rem;
  font-size: 0.72rem;
  font-weight: 900;
}

.status-pending {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-needs_review {
  background: #fff7ed;
  color: #c2410c;
}

.status-approved {
  background: #f0fdf4;
  color: #15803d;
}

.status-rejected {
  background: #fef2f2;
  color: #b91c1c;
}

/* =========================
   RESPONSIVO
========================= */

@media (max-width: 900px) {
  .article-editor-toolbar {
    position: static;
  }
}

@media (max-width: 760px) {
  .contributor-tabs {
    border-radius: 22px;
  }

  .contributor-tab-btn {
    flex: 1 1 calc(50% - 0.6rem);
  }

  .article-form-grid {
    grid-template-columns: 1fr;
  }

  .article-editor-content,
  .article-content-html {
    min-height: 360px;
    max-height: none;
    font-size: 1rem;
    padding: 1rem;
  }

  .article-editor-toolbar {
    gap: 0.3rem;
    padding: 0.5rem;
  }

  .article-editor-toolbar button,
  .article-editor-toolbar select,
  .article-editor-toolbar input[type="color"] {
    min-height: 34px;
    padding: 0.38rem 0.5rem;
    font-size: 0.78rem;
  }

  .article-request-header {
    flex-direction: column;
  }

  .article-request-cover {
    width: 100%;
    height: 160px;
  }

  .article-request-actions {
    justify-content: stretch;
  }

  .article-request-actions button {
    flex: 1 1 auto;
  }
}

@media (max-width: 460px) {
  .contributor-tab-btn {
    flex: 1 1 100%;
  }

  .article-editor-toolbar button,
  .article-editor-toolbar select {
    flex: 1 1 auto;
  }
}

.admin-note-box {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.admin-note-box strong {
  display: block;
  margin-bottom: 0.35rem;
}

.admin-note-box p {
  margin: 0;
  white-space: pre-wrap;
}