/* ── Glassmorphism base ─────────────────────────────────────────────── */
.glass-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ── Input / Textarea glass style ───────────────────────────────────── */
.input-glass {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  color: white;
  padding: 0.6rem 0.875rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  font-family: 'Noto Sans KR', sans-serif;
}

.input-glass::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.input-glass:focus {
  border-color: rgba(124, 58, 237, 0.6);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

/* ── Memo content rendering ─────────────────────────────────────────── */
.memo-content {
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
}

.memo-content p {
  margin-bottom: 0.75rem;
}

.memo-content pre {
  margin: 1rem 0;
  padding: 0;
  border-radius: 0.75rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.memo-content pre code,
.memo-content pre code.hljs {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 1.25rem !important;
  border-radius: 0;
  display: block;
  overflow: visible !important;
}

/* ── Scrollbar hide utility ─────────────────────────────────────────── */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Line clamp ─────────────────────────────────────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Toggle switch (handled by Tailwind peer, but extra smoothness) ─── */
input[type="checkbox"]:checked + div {
  background-color: #7c3aed;
}

/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.glass-card {
  animation: fadeIn 0.25s ease;
}

/* ── Mobile safe area ───────────────────────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pb-safe {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* ── Highlight.js overrides inside glass cards ──────────────────────── */
.hljs {
  background: rgba(0, 0, 0, 0.35) !important;
}

/* ── Cell editor ────────────────────────────────────────────────────── */
.sl-cell {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 0.625rem;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.15s;
}
.sl-cell:focus-within {
  border-color: rgba(124, 58, 237, 0.45);
}

.sl-cell-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sl-drag-handle {
  cursor: grab;
  color: rgba(255, 255, 255, 0.22);
  font-size: 1rem;
  padding: 0 0.2rem;
  user-select: none;
  flex-shrink: 0;
}
.sl-drag-handle:active { cursor: grabbing; }

.sl-badge {
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.sl-badge-text {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
}
.sl-badge-code {
  background: rgba(124, 58, 237, 0.22);
  color: rgba(167, 139, 250, 1);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.sl-cell-actions {
  margin-left: auto;
  display: flex;
  gap: 0.2rem;
}

.sl-btn {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.1s;
}
.sl-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.15);
}
.sl-btn-del:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.sl-cell-body { width: 100%; }

.sl-cell-textarea {
  width: 100%;
  min-height: 80px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  line-height: 1.75;
  padding: 0.75rem 1rem;
  outline: none;
  resize: none;
  border: none;
  font-family: 'Noto Sans KR', sans-serif;
}

/* CodeMirror 셀 */
.sl-code-body .CodeMirror {
  height: auto;
  min-height: 80px;
  background: #1e1d2e;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  border-radius: 0;
}
.sl-code-body .CodeMirror-scroll { min-height: 80px; }
.sl-code-body .CodeMirror-gutters { background: #18172a; border-right: 1px solid rgba(255,255,255,0.06); }
.sl-code-body .CodeMirror-linenumber { color: rgba(255,255,255,0.2); }

/* 드래그 상태 */
.sl-cell.sl-dragging { opacity: 0.45; }
.sl-cell.sl-drop-above { border-top: 2px solid rgba(124, 58, 237, 0.8); }
.sl-cell.sl-drop-below { border-bottom: 2px solid rgba(124, 58, 237, 0.8); }

/* 셀 추가 바 */
.sl-add-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.125rem 0;
}

.sl-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.sl-add-btn:hover {
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.1);
  color: rgba(167, 139, 250, 0.9);
}

.sl-lang-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #1a1830;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.6rem;
  padding: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 210px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.sl-lang-item {
  padding: 0.3rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.1s;
}
.sl-lang-item:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(124, 58, 237, 0.35);
  color: white;
}
