/* ==========================================================================
   📌 HAKE Global Index Memo Module (Near-Square Aspect Ratio & Clean Brand Labeling)
   100% Smooth Single-Transform Motion - Compact Square Memo Card - Fixed Palette
   ========================================================================== */

/* 1. Global Host Container */
#global-memo-root {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", Roboto, sans-serif;
  pointer-events: none;
}

#global-memo-root * {
  box-sizing: border-box;
  pointer-events: auto;
}

.hake-memo-host-hidden {
  display: none !important;
}

/* 2. Slide-Out Yellow Sticky Note Card (Near-Square Dimensions) */
.hake-memo-drawer {
  position: fixed;
  top: 50%;
  right: 0;
  width: 350px;          /* Near-Square Width */
  height: 340px;         /* Near-Square Height */
  max-height: 80vh;
  z-index: 99999;
  background: #fff3a0;   /* Exact Pastel Yellow Note Card */
  border: 1px solid #ebd976;
  border-right: none;
  border-radius: 18px 0 0 18px;
  box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  transform: translateY(-50%) translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: visible;     /* CRITICAL: Allows tab to stick out on the left */
}

.hake-memo-drawer.open {
  transform: translateY(-50%) translateX(0);
}

/* 3. Single Attached Vertical Bookmark Tab (Moves TOGETHER with the Panel) */
.hake-memo-bookmark-tab {
  position: absolute;
  top: 24px;
  left: -36px;          /* Exactly 36px wide peeking out on the left */
  width: 36px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  background: linear-gradient(180deg, #d8d1a4 0%, #c9c193 100%);
  color: #2b3240;
  border: 1px solid #b8b082;
  border-right: none;
  border-radius: 14px 0 0 14px;
  box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.hake-memo-bookmark-tab:hover {
  background: linear-gradient(180deg, #dfd8ad 0%, #d1c89a 100%);
  box-shadow: -6px 4px 16px rgba(0, 0, 0, 0.18);
}

.tab-text-vertical {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #2c3340;
}

/* 4. Textarea Body (Compact Square) */
.hake-memo-body {
  flex: 1;
  padding: 16px 16px 10px 16px;
  display: flex;
  flex-direction: column;
  border-top-left-radius: 18px;
}

.hake-memo-textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  color: #2b3240;
  border: none;
  outline: none;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  font-family: inherit;
  font-weight: 500;
}

.hake-memo-textarea::placeholder {
  color: #8c8352;
  opacity: 0.75;
}

/* 5. Minimal Bottom Action Bar */
.hake-memo-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fff3a0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom-left-radius: 18px;
}

/* Compact Yellow Pill Button ("접기") */
.hake-memo-pill-btn {
  background: #f5d76e;
  color: #433912;
  border: none;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, background 0.2s ease;
}

.hake-memo-pill-btn:hover {
  transform: scale(1.04);
  background: #f3cf54;
}

.hake-memo-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hake-memo-tool-btn {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #2b3240;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: background 0.2s ease;
}

.hake-memo-tool-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.hake-memo-status-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #6b6339;
  font-weight: 700;
}

.hake-memo-sync-badge {
  color: #059669;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .hake-memo-drawer {
    width: 85vw;
    height: 320px;
  }
}
