/* ============================================
   ADMIN EDITING UI
   ============================================ */

body.admin-mode .editable-block {
  outline: 2px dashed rgba(0, 151, 167, 0);
  outline-offset: -8px;
  transition: outline-color 0.25s ease;
}

body.admin-mode .editable-block:hover {
  outline-color: rgba(0, 151, 167, 0.55);
}

.admin-edit-trigger {
  display: none;
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 20;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 151, 167, 0.95);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 151, 167, 0.28);
  backdrop-filter: blur(8px);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

body.admin-mode .editable-block:hover .admin-edit-trigger {
  display: inline-flex;
}

.admin-edit-trigger:hover {
  transform: translateY(-2px) scale(1.05);
  background: #007b86;
  box-shadow: 0 16px 34px rgba(0, 151, 167, 0.38);
}

.admin-edit-trigger svg {
  width: 18px;
  height: 18px;
}

/* Floating admin toolbar */
.admin-toolbar {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 3000;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(9, 25, 43, 0.94);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(10px);
  font-family: inherit;
}

body.admin-mode .admin-toolbar {
  display: flex;
}

.admin-toolbar span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.admin-toolbar button,
.admin-toolbar a {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.admin-toolbar button:hover,
.admin-toolbar a:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

/* Modal */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(9, 25, 43, 0.72);
  backdrop-filter: blur(8px);
}

.admin-modal.show {
  display: flex;
}

.admin-modal-card {
  width: min(640px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(0, 151, 167, 0.18);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.admin-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
}

.admin-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.admin-modal-close:hover {
  background: #e5e7eb;
}

.admin-form {
  padding: 24px;
}

.admin-form-group {
  margin-bottom: 18px;
}

.admin-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: #374151;
  margin-bottom: 8px;
}

.admin-form-group input,
.admin-form-group textarea {
  width: 100%;
  border: 1.5px solid #d1d5db;
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #111827;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-form-group textarea {
  min-height: 110px;
  resize: vertical;
}

.admin-form-group input:focus,
.admin-form-group textarea:focus {
  border-color: #0097a7;
  box-shadow: 0 0 0 4px rgba(0, 151, 167, 0.11);
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

.admin-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-btn:hover {
  transform: translateY(-1px);
}

.admin-btn-primary {
  background: #0097a7;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 151, 167, 0.22);
}

.admin-btn-secondary {
  background: #f3f4f6;
  color: #111827;
}

.admin-status {
  margin-top: 12px;
  min-height: 20px;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-status.success {
  color: #047857;
}

.admin-status.error {
  color: #b91c1c;
}
/* ============================================
   FIXED ADMIN HOVER CONTROLS
   ============================================ */

body.admin-mode .editable-block {
  position: relative !important;
}

body.admin-mode .hero-overlay {
  pointer-events: none;
}

.admin-control-cluster {
  display: none;
  position: absolute;
  right: 26px;
  bottom: 26px;
  z-index: 2500;
  gap: 10px;
  align-items: center;
}

body.admin-mode .editable-block:hover .admin-control-cluster {
  display: flex;
}

.admin-control-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  background: rgba(0, 151, 167, 0.96);
  box-shadow: 0 14px 32px rgba(0, 151, 167, 0.34);
  backdrop-filter: blur(10px);
  transition: transform 0.24s ease, background 0.24s ease, box-shadow 0.24s ease;
}

.admin-control-btn:hover {
  transform: translateY(-3px) scale(1.05);
  background: #007d8a;
  box-shadow: 0 18px 40px rgba(0, 151, 167, 0.46);
}

.admin-control-btn svg {
  width: 18px;
  height: 18px;
}

.admin-control-btn.admin-add {
  background: rgba(16, 185, 129, 0.96);
}

.admin-control-btn.admin-add:hover {
  background: #059669;
}

.admin-control-btn.admin-remove {
  background: rgba(239, 68, 68, 0.96);
}

.admin-control-btn.admin-remove:hover {
  background: #dc2626;
}

@media (max-width: 768px) {
  .admin-control-cluster {
    right: 16px;
    bottom: 16px;
  }

  .admin-control-btn {
    width: 40px;
    height: 40px;
  }
}
/* ============================================
   LAB HIGHLIGHTS VISIBILITY FIX
   This prevents dynamic Lab cards from disappearing
   after JavaScript renders them.
   ============================================ */

#homeLabGrid {
  min-height: 320px;
}

#homeLabGrid .lab-col {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
  min-height: 320px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 151, 167, 0.16), rgba(9, 25, 43, 0.94));
}

#homeLabGrid .lab-col:hover {
  transform: translateY(-6px);
}

#homeLabGrid .lab-col img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

#homeLabGrid .lab-image-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #ffffff;
  background:
    radial-gradient(circle at 22% 20%, rgba(0,151,167,0.38), transparent 30%),
    radial-gradient(circle at 78% 25%, rgba(255,107,53,0.20), transparent 28%),
    linear-gradient(135deg, #09192b 0%, #10364a 100%);
}

#homeLabGrid .lab-image-fallback span {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.24);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

#homeLabGrid .lab-image-fallback small {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

#homeLabGrid .lab-col:not(.lab-image-missing) .lab-image-fallback {
  display: none;
}

#homeLabGrid .lab-col .layer {
  z-index: 2;
}

body.admin-mode #homeLabGrid .index-admin-item:hover > .admin-item-controls {
  display: flex;
}