/* ================================================================
   Admin Live — Styles for admin interactive modules on public pages
   ================================================================ */

/* ==================== TOOLBAR ==================== */

.admin-toolbar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9990;
}

.admin-toolbar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--primary, #0f766e);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: background 0.2s, transform 0.15s;
}

.admin-toolbar-btn:hover {
  background: var(--primary-dark, #0d6357);
  transform: scale(1.1);
}

.admin-toolbar-btn.active {
  background: #b91c1c;
}

.admin-toolbar-btn svg {
  pointer-events: none;
}

/* ==================== EDIT MODE ==================== */

.admin-edit-mode [data-admin-editable] {
  outline: 2px dashed var(--primary, #0f766e);
  outline-offset: 4px;
  cursor: pointer;
  border-radius: 4px;
  transition: outline-color 0.2s;
}

.admin-edit-mode [data-admin-editable]:hover {
  outline-color: #b91c1c;
  background: rgba(185, 28, 28, 0.05);
}

/* ==================== ADMIN MODAL ==================== */

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.admin-modal.open {
  opacity: 1;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.admin-modal-dialog {
  position: relative;
  background: var(--surface, #fff);
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.admin-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.admin-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted, #6b7280);
  line-height: 1;
  padding: 0 4px;
}

.admin-modal-close:hover {
  color: var(--text, #111);
}

.admin-modal-body {
  padding: 20px;
}

.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border, #e5e7eb);
}

.admin-modal-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 12px 0 4px;
  color: var(--text, #111);
}

.admin-modal-label:first-child {
  margin-top: 0;
}

.admin-modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--bg, #fff);
  color: var(--text, #111);
  box-sizing: border-box;
}

.admin-modal-input:focus {
  outline: none;
  border-color: var(--primary, #0f766e);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

textarea.admin-modal-input {
  resize: vertical;
}

select.admin-modal-input {
  cursor: pointer;
}

/* ==================== ANNOUNCEMENT BANNERS ==================== */

.announcements-wrapper {
  margin-bottom: 4px;
}

.announcement-banner {
  padding: 12px 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  border-left: 4px solid;
}

.announcement-banner + .announcement-banner {
  margin-top: 2px;
}

.announcement-info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

.announcement-warning {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.announcement-promo {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

/* ==================== OFFICIAL REPLY ==================== */

.official-reply {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface-alt, #f0fdf4);
  border-left: 3px solid var(--primary, #0f766e);
  border-radius: 0 6px 6px 0;
}

.official-reply-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.official-reply-badge {
  display: inline-block;
  background: var(--primary, #0f766e);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.03em;
}

.official-reply-admin {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text, #111);
}

.official-reply-date {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
}

.official-reply-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text, #111);
  line-height: 1.5;
}

/* ==================== REVIEW PINNED ==================== */

.review-pinned {
  border: 1px solid var(--primary, #0f766e);
  border-radius: 8px;
}

.review-pinned-badge {
  display: inline-block;
  background: var(--primary, #0f766e);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 8px;
  margin-right: 6px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

/* ==================== INLINE MODERATION BUTTONS ==================== */

.admin-mod-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.admin-btn-inline {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.75rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 4px;
  background: var(--surface, #fff);
  color: var(--text, #374151);
  cursor: pointer;
  transition: background 0.15s;
}

.admin-btn-inline:hover {
  background: var(--surface-hover, #f3f4f6);
}

.admin-btn-reply { border-color: var(--primary, #0f766e); color: var(--primary, #0f766e); }
.admin-btn-pin { border-color: #f59e0b; color: #92400e; }
.admin-btn-delete { border-color: #ef4444; color: #ef4444; }
.admin-btn-delete:hover { background: #fef2f2; }

/* ==================== SIMULATE USER ==================== */

.admin-simulate-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #1e293b;
  color: #e2e8f0;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.85rem;
  z-index: 10001;
}

.admin-simulate-bar button {
  background: none;
  border: 1px solid #e2e8f0;
  color: #e2e8f0;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 8px;
  font-size: 0.8rem;
}

.admin-simulate-bar button:hover {
  background: rgba(255,255,255,0.1);
}

.admin-simulate-user .admin-toolbar {
  display: none !important;
}

.admin-simulate-user .admin-mod-actions {
  display: none !important;
}

.admin-simulate-user [data-admin-editable] {
  outline: none !important;
  cursor: default !important;
}

.admin-simulate-user body {
  padding-top: 36px;
}

.admin-simulate-user .site-header {
  top: 36px;
}

/* ==================== FEATURE LOCKED MESSAGE ==================== */

.feature-locked-msg {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.88rem;
  margin-top: 8px;
}

/* ==================== ANNOUNCEMENTS ADMIN LIST ==================== */

.admin-ann-add-btn {
  width: 100%;
  margin-bottom: 12px;
}

.admin-ann-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-ann-item {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
}

.admin-ann-item-header {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.admin-ann-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 8px;
  letter-spacing: 0.03em;
}

.admin-ann-badge-info { background: #dbeafe; color: #1e40af; }
.admin-ann-badge-warning { background: #fef3c7; color: #92400e; }
.admin-ann-badge-promo { background: #d1fae5; color: #065f46; }
.admin-ann-badge-active { background: #d1fae5; color: #065f46; }
.admin-ann-badge-inactive { background: #f3f4f6; color: #6b7280; }

.admin-ann-page {
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
}

.admin-ann-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.admin-ann-content {
  font-size: 0.82rem;
  color: var(--text-muted, #6b7280);
  margin-bottom: 6px;
}

.admin-ann-actions {
  display: flex;
  gap: 6px;
}

/* ==================== FEATURE LOCKS ADMIN ==================== */

.admin-lock-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.admin-lock-item:last-child {
  border-bottom: none;
}

.admin-lock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.admin-lock-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-lock-msg {
  font-size: 0.85rem;
}

/* Toggle switch */
.admin-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.admin-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.admin-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  transition: background 0.2s;
}

.admin-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.admin-toggle input:checked + .admin-toggle-slider {
  background: var(--primary, #0f766e);
}

.admin-toggle input:checked + .admin-toggle-slider::before {
  transform: translateX(18px);
}

/* ==================== DARK THEME OVERRIDES ==================== */

[data-theme="dark"] .announcement-info,
.dark .announcement-info {
  background: #1e3a5f;
  color: #93c5fd;
}

[data-theme="dark"] .announcement-warning,
.dark .announcement-warning {
  background: #451a03;
  color: #fcd34d;
}

[data-theme="dark"] .announcement-promo,
.dark .announcement-promo {
  background: #064e3b;
  color: #6ee7b7;
}

[data-theme="dark"] .official-reply,
.dark .official-reply {
  background: rgba(15, 118, 110, 0.1);
}

[data-theme="dark"] .feature-locked-msg,
.dark .feature-locked-msg {
  background: #451a03;
  border-color: #92400e;
  color: #fcd34d;
}

[data-theme="dark"] .admin-modal-dialog,
.dark .admin-modal-dialog {
  background: var(--surface, #1f2937);
}

[data-theme="dark"] .admin-ann-item,
.dark .admin-ann-item {
  border-color: var(--border, #374151);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 640px) {
  .admin-toolbar {
    bottom: 12px;
    right: 12px;
  }
  .admin-toolbar-btn {
    width: 38px;
    height: 38px;
  }
  .admin-modal-dialog {
    width: 95%;
  }
}
