/* ============================================================
   Hotel Map Admin Panel — Apple Design System
   ============================================================ */

:root {
  --color-bg: #f5f5f7;
  --color-surface: #ffffff;
  --color-text: #1d1d1f;
  --color-text-secondary: #86868b;
  --color-text-tertiary: #aeaeb2;
  --color-accent: #0071e3;
  --color-separator: #d2d2d7;
  --color-separator-subtle: #e5e5ea;
  --color-danger: #ff3b30;
  --font-display: 'Inter Tight', 'Noto Sans TC', sans-serif;
  --font-body: 'Inter', 'Noto Sans TC', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 980px;
  --nav-height: 52px;
}

.hidden { display: none !important; }

/* --- Admin App Wrapper — fix height chain for map --- */
.admin-app {
  height: 100%;
}

/* --- Login Screen --- */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--color-bg);
}

.login-card {
  background: var(--color-surface);
  border-radius: 20px;
  padding: 48px 40px;
  width: 360px;
  text-align: center;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.login-icon { font-size: 40px; margin-bottom: 16px; }
.login-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 24px; }

.login-input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-size: 15px;
  border: 1px solid var(--color-separator);
  border-radius: var(--radius-md);
  outline: none;
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 0.3em;
}
.login-input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(0,113,227,0.15); }

.login-btn {
  width: 100%;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  border-radius: var(--radius-md);
  transition: opacity 0.15s;
}
.login-btn:hover { opacity: 0.9; }

.login-error { font-size: 12px; color: var(--color-danger); margin-top: 8px; }

/* --- Admin Nav Bar --- */
.admin-nav {
  position: relative;
  z-index: 300;
  height: var(--nav-height);
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-separator-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.admin-nav-left { display: flex; align-items: center; gap: 10px; }
.admin-nav-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.admin-nav-badge { font-size: 10px; font-weight: 500; background: var(--color-bg); padding: 3px 8px; border-radius: var(--radius-pill); color: var(--color-text-secondary); }
.admin-nav-right { display: flex; gap: 16px; }
.admin-nav-link { font-size: 13px; color: var(--color-text-secondary); font-weight: 500; transition: color 0.15s; text-decoration: none; cursor: pointer; }
.admin-nav-link:hover { color: var(--color-text); }

/* --- Admin Sidebar Overrides --- */
/* Make room for the note editor at the bottom */
.admin-app .sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-app .hotel-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* --- Note Editor Panel --- */
.note-editor {
  flex-shrink: 0;
  border-top: 1px solid var(--color-separator);
  background: var(--color-surface);
  transition: max-height 0.3s ease;
  max-height: 320px;
  overflow-y: auto;
}

.note-editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--color-text-secondary);
  gap: 4px;
}
.note-editor-empty-icon { font-size: 28px; }
.note-editor-empty-title { font-size: 13px; font-weight: 600; color: var(--color-text); }
.note-editor-empty-desc { font-size: 12px; }

.note-editor-form { padding: 16px; }

.note-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.note-editor-hotel-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  line-height: 1.3;
}
.note-editor-hotel-type {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.note-editor-hotel-type.hotel {
  background: rgba(0,113,227,0.08);
  color: var(--color-accent);
}
.note-editor-hotel-type.guesthouse {
  background: rgba(147,51,234,0.08);
  color: #9333ea;
}

.note-editor-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--color-separator);
  border-radius: var(--radius-sm);
  resize: vertical;
  outline: none;
  background: var(--color-bg);
  font-family: var(--font-body);
  margin-bottom: 10px;
}
.note-editor-textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.1);
  background: var(--color-surface);
}

.note-editor-colors {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: var(--color-text); box-shadow: 0 0 0 3px rgba(0,0,0,0.1); }

.note-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.note-editor-btn {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-family: var(--font-body);
}
.note-editor-btn.primary { color: #fff; background: var(--color-accent); }
.note-editor-btn.primary:hover { opacity: 0.9; }
.note-editor-btn.danger { color: var(--color-danger); background: none; }
.note-editor-btn.danger:hover { background: rgba(255,59,48,0.06); }

/* Save status toast */
.save-status {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: #34c759;
  color: #fff;
  position: absolute;
  bottom: 8px;
  right: 16px;
  transition: opacity 0.3s;
  pointer-events: none;
}
.note-editor-form { position: relative; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .admin-nav { padding: 0 14px; }
  .admin-nav-title { font-size: 14px; }
  .admin-nav-right { gap: 10px; }
  .admin-nav-link { font-size: 12px; }

  .note-editor { max-height: 200px; }
  .note-editor-form { padding: 12px; }
  .note-editor-hotel-name { font-size: 14px; }
  .note-editor-textarea { font-size: 12px; }

  .login-card { width: 300px; padding: 36px 28px; }

  /* Hide note editor when sidebar collapsed */
  .admin-app .sidebar.collapsed .note-editor {
    display: none;
  }

  /* Note editor mobile collapsed (compact header) */
  .note-editor.mobile-collapsed {
    max-height: 44px;
    overflow: hidden;
  }
  .note-editor.mobile-collapsed .note-editor-form,
  .note-editor.mobile-collapsed .note-editor-empty {
    display: none;
  }

  /* Note editor toggle button */
  .note-editor-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-separator-subtle);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .note-editor-toggle:active {
    background: var(--color-bg);
  }
  .note-editor-toggle svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
  }
  .note-editor.mobile-collapsed .note-editor-toggle svg {
    transform: rotate(180deg);
  }
}
