/* ==========================================================================
   ARKH STUDIO — MODO ADMINISTRADOR & EDITOR VISUAL (admin.css)
   ========================================================================== */

/* 1. DISCREET TRIGGER BUTTON */
.arkh-admin-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a0a0a0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9990;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.arkh-admin-trigger:hover {
  background: #c97a5e;
  color: #fff;
  border-color: #c97a5e;
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(201, 122, 94, 0.4);
}
.arkh-admin-trigger svg {
  width: 18px;
  height: 18px;
}

/* 2. AUTH MODAL */
.arkh-admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.arkh-admin-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.arkh-admin-modal {
  background: #141414;
  border: 1px solid rgba(201, 122, 94, 0.4);
  border-radius: 12px;
  padding: 2.5rem;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(201, 122, 94, 0.15);
  text-align: center;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.arkh-admin-modal-backdrop.active .arkh-admin-modal {
  transform: translateY(0);
}
.arkh-admin-modal-logo {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
  margin-bottom: 0.5rem;
}
.arkh-admin-modal-subtitle {
  font-size: 0.85rem;
  color: #a0a0a0;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
}
.arkh-admin-input-group {
  margin-bottom: 1.5rem;
}
.arkh-admin-pin-input {
  width: 100%;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 1rem;
  font-size: 1.6rem;
  letter-spacing: 8px;
  text-align: center;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.arkh-admin-pin-input:focus {
  border-color: #c97a5e;
  box-shadow: 0 0 12px rgba(201, 122, 94, 0.3);
}
.arkh-admin-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}
.arkh-btn-admin-primary {
  background: #c97a5e;
  color: #fff;
  border: none;
  padding: 0.75rem 1.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}
.arkh-btn-admin-primary:hover {
  background: #b5674c;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(201, 122, 94, 0.4);
}
.arkh-btn-admin-secondary {
  background: transparent;
  color: #888;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.arkh-btn-admin-secondary:hover {
  color: #fff;
  border-color: #fff;
}
.arkh-admin-error {
  color: #ff5252;
  font-size: 0.85rem;
  margin-top: 1rem;
  display: none;
}

/* 3. TOP ADMIN TOOLBAR */
body.arkh-editing-active {
  padding-top: 58px !important;
}
body.arkh-editing-active #navbar {
  top: 58px !important;
}
.arkh-admin-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: rgba(14, 14, 14, 0.96);
  border-bottom: 1px solid rgba(201, 122, 94, 0.4);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  font-family: 'Montserrat', sans-serif;
  backdrop-filter: blur(12px);
}
.arkh-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.arkh-bar-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(201, 122, 94, 0.15);
  border: 1px solid #c97a5e;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #c97a5e;
  text-transform: uppercase;
}
.arkh-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: arkhPulse 1.8s infinite;
}
@keyframes arkhPulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.arkh-bar-center {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.arkh-bar-btn {
  background: #222;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #eee;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.arkh-bar-btn:hover {
  background: #2e2e2e;
  border-color: rgba(201, 122, 94, 0.6);
  color: #fff;
}
.arkh-bar-btn.primary {
  background: #c97a5e;
  border-color: #c97a5e;
  color: #fff;
  font-weight: 700;
}
.arkh-bar-btn.primary:hover {
  background: #b5674c;
  box-shadow: 0 2px 12px rgba(201, 122, 94, 0.4);
}
.arkh-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.arkh-save-status {
  font-size: 0.75rem;
  color: #999;
}
.arkh-bar-btn.exit {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: #bbb;
}
.arkh-bar-btn.exit:hover {
  background: rgba(255, 50, 50, 0.15);
  border-color: #ff5252;
  color: #ff5252;
}

/* 4. IN-PLACE EDITABLE TEXTS */
body.arkh-editing-active [data-arkh-editable="true"] {
  outline: 1px dashed transparent;
  transition: outline 0.2s, background-color 0.2s;
  cursor: text !important;
  border-radius: 4px;
}
body.arkh-editing-active [data-arkh-editable="true"]:hover {
  outline: 1px dashed rgba(201, 122, 94, 0.65) !important;
  background-color: rgba(201, 122, 94, 0.08) !important;
}
body.arkh-editing-active [data-arkh-editable="true"]:focus {
  outline: 2px solid #c97a5e !important;
  background-color: rgba(201, 122, 94, 0.14) !important;
}

/* 5. SECTION CONTROLS */
body.arkh-editing-active section {
  position: relative !important;
  transition: opacity 0.3s ease;
}
.arkh-section-badge {
  position: absolute;
  top: 10px;
  right: 15px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(201, 122, 94, 0.4);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  color: #c97a5e;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  user-select: none;
}
.arkh-section-toggle-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s;
}
.arkh-section-toggle-btn:hover {
  background: #c97a5e;
}
section.arkh-section-hidden {
  opacity: 0.25 !important;
  filter: grayscale(0.8);
  position: relative;
}
section.arkh-section-hidden::after {
  content: "SECCIÓN OCULTA (NO VISIBLE PARA VISITANTES)";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(200, 30, 30, 0.85);
  color: #fff;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.85rem;
  z-index: 99;
  pointer-events: none;
}

/* 6. SLIDE DRAWER (SECCIONES) */
.arkh-drawer {
  position: fixed;
  top: 58px;
  right: -360px;
  width: 350px;
  height: calc(100vh - 58px);
  background: #141414;
  border-left: 1px solid rgba(201, 122, 94, 0.3);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 99990;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.arkh-drawer.open {
  right: 0;
}
.arkh-drawer-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.arkh-drawer-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.arkh-drawer-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
}
.arkh-drawer-close:hover {
  color: #fff;
}
.arkh-drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.arkh-section-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 0.8rem;
  transition: border-color 0.2s;
}
.arkh-section-item:hover {
  border-color: rgba(201, 122, 94, 0.5);
}
.arkh-section-info {
  display: flex;
  flex-direction: column;
}
.arkh-section-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}
.arkh-section-id {
  font-size: 0.7rem;
  color: #777;
}

/* Switch toggle */
.arkh-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.arkh-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.arkh-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #333;
  transition: 0.3s;
  border-radius: 24px;
}
.arkh-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}
.arkh-switch input:checked + .arkh-slider {
  background-color: #c97a5e;
}
.arkh-switch input:checked + .arkh-slider:before {
  transform: translateX(20px);
}

/* 7. PORTFOLIO ITEM EDIT/DELETE CONTROLS */
body.arkh-editing-active .portfolio-item {
  position: relative;
}
.arkh-delete-item-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(220, 38, 38, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  opacity: 0.9;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.arkh-delete-item-btn:hover {
  background: #ef4444;
  transform: scale(1.15);
}
.arkh-delete-item-btn svg {
  width: 16px;
  height: 16px;
}

/* 8. ADD RENDER MODAL */
.arkh-renders-grid-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.arkh-picker-thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #252525;
}
.arkh-picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.arkh-picker-thumb.selected {
  border-color: #c97a5e;
  box-shadow: 0 0 10px rgba(201, 122, 94, 0.6);
}
.arkh-form-group {
  margin-bottom: 1rem;
  text-align: left;
}
.arkh-form-group label {
  display: block;
  font-size: 0.75rem;
  color: #aaa;
  margin-bottom: 0.4rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.arkh-form-input, .arkh-form-select {
  width: 100%;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.65rem 0.9rem;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
}
.arkh-form-input:focus, .arkh-form-select:focus {
  border-color: #c97a5e;
}

/* 9. TOAST NOTIFICATIONS */
.arkh-toast-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.arkh-toast {
  background: #1c1c1c;
  border: 1px solid rgba(201, 122, 94, 0.6);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}
.arkh-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.arkh-toast.success {
  border-color: #22c55e;
}
.arkh-toast.error {
  border-color: #ef4444;
}

/* 10. MOBILE OVERRIDES: HIDE SIMILAR PROJECT BUTTON & ENABLE TAP TO FULLSCREEN */
@media (max-width: 768px) {
  .portfolio-overlay a.portfolio-btn,
  .portfolio-overlay .portfolio-btn:not([onclick*="open360"]) {
    display: none !important;
  }
  .portfolio-overlay {
    pointer-events: none !important;
  }
  .portfolio-overlay button {
    pointer-events: auto !important;
  }
  body.arkh-editing-active .portfolio-overlay {
    pointer-events: auto !important;
  }
}

