/* =========================================================
   Poosting - PÁGINA DE RECADOS
   ========================================================= */

.scraps-page {
  grid-template-columns: 170px minmax(0, 1fr) 260px;
}

.scraps-profile-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
}

.side-menu a.side-menu-item {
  text-decoration: none;
}

.scraps-main-card {
  overflow: hidden;
  min-height: 520px;
  border-radius: 0 38px 0 0;
}

.scraps-header {
  min-height: 82px;
  padding: 14px 18px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #c6d5e3;
}

.scraps-header h1 {
  margin: 0;
  color: #111;
  font-size: 30px;
  font-weight: 400;
}

.scraps-header p {
  margin: 5px 0 0;
  color: #6a7781;
  line-height: 1.35;
}

.scrap-count {
  flex: 0 0 auto;
  margin-top: 5px;
  padding: 5px 9px;
  border: 1px solid #c6d7e5;
  background: #eef6fc;
  color: #47718f;
  font-size: 12px;
  border-radius: 3px;
}


/* ESCREVER RECADO */

.write-scrap-section {
  border-bottom: 1px solid #c7d6e4;
}

.write-scrap-section .section-tab {
  margin-top: 5px;
}

.scrap-form {
  padding: 11px 14px 13px;
  background: #eef6fc;
}

.scrap-form textarea {
  width: 100%;
  min-height: 105px;
  padding: 9px 10px;
  display: block;
  resize: vertical;
  border: 1px solid #aac0d3;
  outline: none;
  background: #fff;
  color: #252a2f;
  line-height: 1.4;
}

.scrap-form textarea:focus {
  border-color: #6798c1;
  box-shadow: 0 0 0 2px rgba(84,137,183,.12);
}

.scrap-form-footer {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

#charCounter {
  color: #7b8993;
  font-size: 11px;
}

.send-scrap-button {
  padding: 7px 14px;
  border: 1px solid #4e7da5;
  border-radius: 3px;
  background: linear-gradient(#78a7cf, #5385af);
  color: white;
  cursor: pointer;
  text-shadow: 0 1px rgba(0,0,0,.18);
}

.send-scrap-button:hover {
  background: linear-gradient(#6d9fc8, #467ba8);
}

.send-scrap-button:disabled {
  opacity: .65;
  cursor: wait;
}

.form-message {
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  text-align: right;
}

.form-message.success {
  color: #23723f;
}

.form-message.error {
  color: #b32929;
}


/* FILTROS */

.owner-filters {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #f7fafc;
  border-bottom: 1px solid #d5e0e9;
}

.filter-button {
  padding: 6px 9px;
  border: 1px solid #b8cad9;
  border-radius: 3px;
  background: linear-gradient(#fff, #e7f0f7);
  color: #47718f;
  cursor: pointer;
}

.filter-button.active {
  border-color: #648fb3;
  background: linear-gradient(#73a0c5, #4d7fa9);
  color: white;
}

.filter-button span {
  display: inline-block;
  min-width: 18px;
  margin-left: 3px;
  padding: 1px 5px;
  background: rgba(0,0,0,.10);
  border-radius: 10px;
  font-size: 10px;
}


/* LISTA */

.scraps-loading {
  padding: 35px 14px;
  text-align: center;
  color: #73808a;
}

.scraps-list {
  width: 100%;
}

.scrap-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 128px;
  border-bottom: 1px solid #c4d5e3;
}

.scrap-card:nth-child(odd) {
  background: #e9f3fc;
}

.scrap-card:nth-child(even) {
  background: #dcecf9;
}

.scrap-card.pending {
  background:
    repeating-linear-gradient(
      -45deg,
      #fff8dc,
      #fff8dc 11px,
      #fff4c7 11px,
      #fff4c7 22px
    );
}

.scrap-sender {
  padding: 12px 8px;
  text-align: center;
  border-right: 1px solid rgba(164,188,207,.7);
}

.scrap-avatar-link {
  display: block;
  text-decoration: none;
}

.scrap-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 5px;
  display: block;
  object-fit: cover;
  border: 1px solid #aebdca;
  background: #edf2f7;
}

.scrap-sender-name {
  display: block;
  color: #326d91;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.scrap-content {
  min-width: 0;
  padding: 11px 13px 10px;
}

.scrap-meta {
  margin-bottom: 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: #7c8992;
  font-size: 11px;
}

.pending-badge,
.approved-badge {
  padding: 2px 6px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
}

.pending-badge {
  border: 1px solid #d8a93f;
  background: #fff0ad;
  color: #886400;
}

.approved-badge {
  border: 1px solid #8eb69a;
  background: #dff0e4;
  color: #27663a;
}

.scrap-message {
  margin: 0;
  color: #272d32;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  font-size: 14px;
}

.scrap-owner-actions {
  margin-top: 12px;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid rgba(152,178,199,.55);
}

.scrap-action {
  padding: 5px 9px;
  border: 1px solid #a9bdcd;
  border-radius: 3px;
  background: linear-gradient(#fff, #e7eff5);
  color: #47708e;
  cursor: pointer;
  font-size: 11px;
}

.scrap-action.approve {
  border-color: #719b7c;
  color: #347144;
}

.scrap-action.hide {
  color: #7d671f;
}

.scrap-action.delete {
  color: #a13d3d;
}

.scrap-action:disabled {
  opacity: .55;
  cursor: wait;
}


/* EMPTY */

.scraps-empty {
  min-height: 260px;
  padding: 45px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #74818b;
}

.scraps-empty .empty-icon {
  margin-bottom: 8px;
  font-size: 32px;
}

.scraps-empty strong {
  margin-bottom: 5px;
  color: #516572;
  font-size: 15px;
}

.approval-info-card p,
.right-help-text {
  color: #66747f;
  font-size: 12px;
  line-height: 1.45;
}


/* TABLET */

@media (max-width: 1000px) {
  .scraps-page {
    grid-template-columns: 155px minmax(0, 1fr);
  }
}


/* MOBILE */

@media (max-width: 700px) {

  .scraps-page {
    display: flex;
  }

  .scraps-main-card {
    border-radius: 7px;
  }

  .scraps-header {
    min-height: auto;
    padding: 12px;
  }

  .scraps-header h1 {
    font-size: 24px;
  }

  .scrap-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .scrap-sender {
    padding: 10px 5px;
  }

  .scrap-avatar {
    width: 54px;
    height: 54px;
  }

  .scrap-content {
    padding: 10px;
  }

  .owner-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .filter-button {
    white-space: nowrap;
  }
}


@media (max-width: 420px) {

  .scraps-header {
    flex-direction: column;
  }

  .scrap-count {
    margin-top: 0;
  }

  .scrap-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .scrap-avatar {
    width: 45px;
    height: 45px;
  }

  .scrap-sender-name {
    font-size: 10px;
  }

  .scrap-form-footer {
    align-items: flex-end;
  }
}


/* CORREÇÃO: esconder corretamente o estado vazio de recados */
.scraps-empty[hidden],
.recados-empty[hidden],
.empty-scraps[hidden],
.empty-state[hidden] {
  display: none !important;
}

#emptyState[hidden] {
  display: none !important;
}

/* =========================================================
   RESPOSTA DO DONO AO RECADO
   ========================================================= */
.scrap-reply-compose,
.scrap-reply-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(152,178,199,.55);
}

.scrap-reply-toggle,
.scrap-reply-submit {
  padding: 5px 10px;
  border: 1px solid #4e7da5;
  border-radius: 3px;
  background: linear-gradient(#78a7cf, #5385af);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  text-shadow: 0 1px rgba(0,0,0,.16);
}

.scrap-reply-toggle:hover,
.scrap-reply-submit:hover {
  background: linear-gradient(#6d9fc8, #467ba8);
}

.scrap-reply-submit:disabled {
  opacity: .6;
  cursor: wait;
}

.scrap-reply-form {
  margin-top: 8px;
}

.scrap-reply-form textarea {
  width: 100%;
  min-height: 72px;
  padding: 8px 9px;
  resize: vertical;
  border: 1px solid #aac0d3;
  background: #fff;
  color: #252a2f;
  line-height: 1.4;
  box-sizing: border-box;
}

.scrap-reply-form-footer {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.scrap-reply-counter {
  color: #7b8993;
  font-size: 10px;
}

.scrap-reply-feedback {
  min-height: 16px;
  margin-top: 5px;
  color: #23723f;
  font-size: 11px;
  text-align: right;
}

.scrap-reply-feedback.error {
  color: #b32929;
}

.scrap-reply-box {
  margin-left: 14px;
  padding: 9px 10px;
  border: 1px solid #bed0df;
  border-radius: 3px;
  background: rgba(255,255,255,.7);
}

.scrap-reply-title {
  color: #47718f;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
}

.scrap-reply-meta {
  margin-top: 2px;
  color: #86939c;
  font-size: 10px;
}

.scrap-reply-message {
  margin: 6px 0 0;
  color: #30373c;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.4;
  font-size: 13px;
}

@media (max-width: 640px) {
  .scrap-reply-box {
    margin-left: 0;
  }
}
