/* ===== News Detail ===== */
.news-detail-panel {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--white);
  display: flex; flex-direction: column;
  animation: slideInRight 0.25s ease;
}
.news-detail-header {
  padding: 52px 16px 12px;
  border-bottom: 1px solid var(--slate-50);
  display: flex; align-items: center;
}
.news-detail-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 20px 20px 40px;
}
.news-detail-image {
  width: 100%; max-height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--slate-100);
}
.news-detail-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-detail-image .placeholder {
  width: 100%; height: 180px;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-300); font-size: 48px;
}
.news-detail-title {
  font-size: 20px; font-weight: 700; color: var(--slate-800);
  line-height: 1.4; margin-bottom: 8px;
}
.news-detail-meta {
  font-size: 12px; color: var(--slate-400);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--slate-100);
}
.news-detail-body {
  font-size: 15px; line-height: 1.8; color: var(--slate-600);
}
.news-detail-body p { margin-bottom: 12px; }
.news-detail-body img { max-width: 100%; border-radius: 12px; margin: 12px 0; display: block; }
.news-detail-body figure { margin: 16px 0; text-align: center; }
.news-detail-body figure img { margin: 0 auto; }

/* ===== Admin Overlay (shared backdrop) ===== */
.admin-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 100;
  display: none;
  backdrop-filter: blur(4px);
}
.admin-overlay.active { display: block; }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ===== Toast ===== */
#toast {
  position: fixed;
  bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 22px;
  font-size: 13px; font-weight: 500;
  color: var(--white);
  background: rgba(0,0,0,0.8);
  border-radius: var(--radius-full);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 1000;
  pointer-events: none;
}
#toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
#toast.success { background: #10B981; }
#toast.error { background: #EF4444; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-300); }

.chat-clear-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(139, 92, 246, 0.28);
  background: linear-gradient(145deg, #F5F3FF, #FFFFFF);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.14);
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s, transform 0.2s;
}
.chat-clear-btn:hover {
  color: #6D28D9;
  background: var(--primary-light);
  border-color: rgba(124, 58, 237, 0.48);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.24);
  transform: translateY(-1px);
}
.chat-clear-btn:active { transform: translateY(0) scale(0.94); }
.chat-clear-btn:focus-visible {
  outline: 3px solid rgba(139, 92, 246, 0.24);
  outline-offset: 2px;
}

/* ===== Message Actions ===== */
.msg-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 6px;
  max-width: 100%;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.msg.bot:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 0; min-height: 28px; padding: 4px 6px;
  font-size: 11px; font-weight: 600;
  color: var(--slate-400);
  background: transparent; border: 0;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg-action-btn:hover { color: var(--primary); background: var(--primary-light); }
.msg-action-btn i { font-size: 13px; }
.msg-action-btn:active { transform: scale(0.95); }
.msg-action-btn:focus-visible,
.msg-feedback-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.msg-feedback-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
  padding-left: 5px;
  border-left: 1px solid var(--slate-200);
}

/* ===== Feedback Buttons ===== */
.msg-feedback-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 6px;
  font-size: 13px;
  color: var(--slate-400);
  background: none; border: none;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.msg-feedback-btn:hover:not(:disabled) { color: var(--primary); background: var(--primary-light); }
.msg-feedback-btn.active { color: var(--primary); }
.msg-feedback-btn.active[onclick*="1"] { color: #059669; }
.msg-feedback-btn.active[onclick*="0"] { color: #EF4444; }
.msg-feedback-btn:disabled { opacity: 0.5; cursor: default; }
.msg-feedback-btn:active:not(:disabled) { transform: scale(0.95); }

@media (hover: none), (max-width: 520px) {
  .msg-actions { opacity: 1; }
}
