/* ============================================
   RESEARCH ADMIN UI
   Clean replacement
   ============================================ */

.research-admin-topbar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 auto 28px;
  padding: 14px 16px;
  border: 1px dashed rgba(0, 151, 167, 0.45);
  border-radius: 16px;
  background: rgba(0, 151, 167, 0.055);
}

body.admin-mode .research-admin-topbar {
  display: flex;
}

.research-admin-main-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  color: #ffffff;
  background: #0097a7;
  box-shadow: 0 8px 20px rgba(0, 151, 167, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.research-admin-main-btn:hover {
  transform: translateY(-2px);
  background: #007d8a;
  box-shadow: 0 12px 26px rgba(0, 151, 167, 0.28);
}

.research-admin-main-btn.secondary {
  background: #111827;
}

.research-admin-main-btn.secondary:hover {
  background: #0f172a;
}

.research-admin-main-btn.warning {
  background: #f97316;
}

.research-admin-main-btn.warning:hover {
  background: #ea580c;
}

/* ============================================
   ITEM-LEVEL CONTROLS
   Existing add/edit/remove item system
   ============================================ */

.research-admin-item,
.research-project-list-item,
.research-method-dynamic-item,
.research-tool-dynamic-item {
  position: relative !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.research-item-controls {
  display: none;
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 30;
  gap: 8px;
}

body.admin-mode .research-admin-item:hover > .research-item-controls {
  display: flex;
}

.research-project-list-item .research-item-controls,
.research-method-dynamic-item .research-item-controls,
.research-tool-dynamic-item .research-item-controls {
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
}

body.admin-mode .research-project-list-item:hover .research-item-controls,
body.admin-mode .research-method-dynamic-item:hover .research-item-controls,
body.admin-mode .research-tool-dynamic-item:hover .research-item-controls {
  display: flex;
}

body.admin-mode .research-project-list-item,
body.admin-mode .research-method-dynamic-item,
body.admin-mode .research-tool-dynamic-item {
  padding-right: 94px;
}

.research-tool-dynamic-item {
  display: inline-flex;
}

/* ============================================
   SHARED ADMIN ICON BUTTON
   ============================================ */

.research-admin-icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  background: rgba(0, 151, 167, 0.96);
  box-shadow: 0 10px 24px rgba(0, 151, 167, 0.28);
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.research-admin-icon-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: #007d8a;
  box-shadow: 0 14px 30px rgba(0, 151, 167, 0.38);
}

.research-admin-icon-btn.delete {
  background: rgba(239, 68, 68, 0.96);
}

.research-admin-icon-btn.delete:hover {
  background: #dc2626;
}

.research-admin-icon-btn svg {
  width: 17px;
  height: 17px;
}

/* ============================================
   SECTION-LEVEL TEXT EDIT CONTROLS
   Replaces old single Modify Page Text button
   ============================================ */

.research-page-editable-section {
  position: relative !important;
}

.research-section-text-controls {
  display: none;
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 45;
  gap: 8px;
}

body.admin-mode .research-section-text-controls {
  display: flex;
}

.research-section-text-controls .research-admin-icon-btn {
  width: 42px;
  height: 42px;
}

/* Hero section needs stronger overlay position */
.hero.research-page-editable-section .research-section-text-controls {
  right: 24px;
  bottom: 24px;
  top: auto;
}

/* Keep section edit button above card grids */
.research-themes-section .research-section-text-controls,
.research-projects-section .research-section-text-controls,
.methods-section .research-section-text-controls,
.join-section .research-section-text-controls {
  right: 10px;
  top: 10px;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.research-dynamic-empty {
  max-width: 760px;
  margin: 24px auto;
  padding: 24px;
  border-radius: 18px;
  border: 1px dashed var(--color-gray-300);
  background: var(--color-white);
  text-align: center;
  color: var(--color-gray-500);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ============================================
   ADMIN FORM
   ============================================ */

.admin-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-form-group select {
  width: 100%;
  border: 1.5px solid #d1d5db;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #111827;
  outline: none;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-form-group select:focus {
  border-color: #0097a7;
  box-shadow: 0 0 0 4px rgba(0, 151, 167, 0.11);
}

.admin-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 18px;
  color: #374151;
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-checkbox-row input {
  width: 18px;
  height: 18px;
  accent-color: #0097a7;
}

/* ============================================
   ADMIN VISIBILITY SAFETY
   ============================================ */

body.admin-mode .theme-card,
body.admin-mode .project-panel,
body.admin-mode .methods-panel,
body.admin-mode .join-content {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .research-section-text-controls {
    right: 12px;
    top: 12px;
  }

  .hero.research-page-editable-section .research-section-text-controls {
    right: 16px;
    bottom: 16px;
  }

  .research-section-text-controls .research-admin-icon-btn {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 640px) {
  .admin-form-row {
    grid-template-columns: 1fr;
  }

  .research-item-controls {
    right: 8px;
    top: 8px;
  }

  .research-admin-icon-btn {
    width: 34px;
    height: 34px;
  }

  body.admin-mode .research-project-list-item,
  body.admin-mode .research-method-dynamic-item,
  body.admin-mode .research-tool-dynamic-item {
    padding-right: 78px;
  }
}