/* admin-mode.css - Admin mode overlay styles (toolbar, media edit, text editor) */

/* ========== Admin Mode Base ========== */
.admin-mode .media-slot {
  position: relative;
}

/* ========== Media Edit Button (변경 버튼 - label 기반) ========== */
.media-edit {
  display: inline-block;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  padding: 8px 18px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.2s;
  letter-spacing: 1px;
  backdrop-filter: blur(4px);
  line-height: 1.2;
  box-sizing: border-box;
  user-select: none;
}

.media-edit:hover {
  background: rgba(0, 0, 0, 0.9);
  border-color: #fff;
  transform: scale(1.05);
}

/* Hero area media edit positioning */
.main-hero > .media-edit {
  top: calc(10px + var(--header-height, 100px));
  right: 10px;
}

/* 권장 사이즈 힌트 */
.media-edit .media-size-hint {
  display: block;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 3px;
  letter-spacing: 0;
}

.media-input {
  display: none;
}

/* ========== Hero Slide Labels (관리자 모드 슬라이드 번호) ========== */
.slide-admin-label {
  display: none;
}

.admin-mode .slide-admin-label {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  font-weight: 900;
  font-family: 'Inter', 'Kanit', sans-serif;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 8px;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  user-select: none;
}

/* ========== Admin Toolbar (하단 고정 바) ========== */
.admin-toolbar {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #11151b;
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  row-gap: 8px;
  flex-wrap: wrap;
  max-width: min(92vw, 560px);
  z-index: 999;
  font-size: 13px;
  font-family: var(--font-kr, 'Noto Sans KR', sans-serif);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.admin-toolbar button {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-toolbar button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.6);
}

.admin-toolbar .admin-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.admin-toolbar.saved {
  box-shadow: 0 0 0 3px rgba(180, 204, 255, 0.6), 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* ========== Admin Panel (히어로 편집 패널) ========== */
.admin-panel {
  position: fixed;
  right: 16px;
  bottom: 78px;
  width: min(420px, 92vw);
  background: #11151b;
  color: #fff;
  border-radius: 16px;
  padding: 16px;
  display: none;
  box-shadow: 0 16px 36px rgba(15, 20, 26, 0.3);
  z-index: 1000;
  font-family: var(--font-kr, 'Noto Sans KR', sans-serif);
}

.admin-panel.open {
  display: block;
}

.admin-panel-header {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-panel-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-panel-section:last-child {
  margin-bottom: 0;
}

.admin-panel button {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.admin-panel button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.6);
}

.admin-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.admin-radio:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.admin-panel-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.admin-panel-item {
  display: grid;
  gap: 6px;
}

.admin-panel-item input[type="file"] {
  display: none;
}

.admin-panel-help {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

/* ========== Hero Settings (슬라이드 개수/시간) ========== */
.admin-panel-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-setting-row span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.admin-setting-row select {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
}

.admin-setting-row select option {
  background: #1a1a2e;
  color: #fff;
}

.admin-panel-input {
  display: none;
}

.admin-panel-upload {
  display: inline-block;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.admin-panel-upload:hover {
  background: rgba(255, 255, 255, 0.15);
}

.admin-panel-item label {
  display: inline-block;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  text-align: center;
}

.admin-panel-item label:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ========== Text Editing (더블클릭 텍스트 편집) ========== */
.admin-mode .text-editable {
  outline: 1px dashed rgba(180, 204, 255, 0.5);
  outline-offset: 4px;
  cursor: text;
  transition: background 0.2s;
}

.admin-mode .text-editable:hover {
  background: rgba(180, 204, 255, 0.08);
  outline-color: rgba(180, 204, 255, 0.8);
}

.text-editing {
  outline: 2px solid #b4ccff !important;
  outline-offset: 4px;
  background: rgba(180, 204, 255, 0.1) !important;
}

/* ========== Text Editor Panel (텍스트 편집 패널) ========== */
.text-editor {
  position: fixed;
  z-index: 1001;
  width: 320px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #ddd;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  padding: 14px;
  display: none;
  font-family: var(--font-kr, 'Noto Sans KR', sans-serif);
}

.text-editor-header {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #000;
}

.text-editor textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 10px 12px;
  font-family: var(--font-kr, 'Noto Sans KR', sans-serif);
  font-size: 14px;
  resize: vertical;
  color: #333;
  line-height: 1.6;
  box-sizing: border-box;
}

.text-editor textarea:focus {
  outline: none;
  border-color: #b4ccff;
  box-shadow: 0 0 0 3px rgba(180, 204, 255, 0.3);
}

.text-editor-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.text-editor-actions button {
  border-radius: 999px;
  padding: 7px 16px;
  border: 1px solid #ddd;
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.text-editor-actions button:hover {
  background: #f5f5f5;
}

.text-editor-actions .text-editor-save {
  background: #000;
  color: #ffffff;
  border-color: transparent;
}

.text-editor-actions .text-editor-save:hover {
  background: #222;
}

/* ========== Admin Warning ========== */
.admin-warning {
  position: fixed;
  top: calc(var(--header-height, 100px) + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff3f3;
  color: #c01820;
  border: 1px solid rgba(192, 24, 32, 0.2);
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 999;
  font-size: 13px;
  white-space: nowrap;
}

/* ========== Responsive ========== */
@media (max-width: 780px) {
  .admin-toolbar {
    right: 8px;
    bottom: 8px;
    padding: 8px 12px;
    gap: 8px;
    max-width: calc(100vw - 16px);
  }

  .admin-panel {
    right: 8px;
    bottom: 68px;
    width: calc(100vw - 16px);
  }

  .text-editor {
    width: calc(100vw - 24px);
    left: 12px !important;
  }

  .admin-mode .slide-admin-label {
    font-size: 48px;
    letter-spacing: 4px;
  }
}
