/* ============================================================
   LIBRETIME UI — Slide Panel + Notification Center
   lt-panel.css
   ============================================================ */

/* ── Backdrop ─────────────────────────────────────────────── */
html.lt-panel-lock,
html.lt-panel-lock body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.lt-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 99960;
  overscroll-behavior: contain;
  touch-action: none;
}

@keyframes lt-backdrop-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes lt-backdrop-out { from { opacity: 1; } to { opacity: 0; } }

.lt-panel-backdrop           { animation: lt-backdrop-in  240ms var(--lt-ease) both; }
.lt-panel-backdrop.is-hiding { animation: lt-backdrop-out 220ms var(--lt-ease) both; }

/* ── Panel shell ──────────────────────────────────────────── */
.lt-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  background: var(--lt-surface);
  border-left: 1px solid var(--lt-border);
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  z-index: 99961;
  overflow: hidden;
  overscroll-behavior: contain;
}

/* Widths */
.lt-panel-xs  { width: 300px; max-width: 100vw; }
.lt-panel-sm  { width: 380px; max-width: 100vw; }
.lt-panel-md  { width: 520px; max-width: 100vw; }
.lt-panel-lg  { width: 62%;   max-width: 100vw; }
.lt-panel-xl  { width: 80%;   max-width: 100vw; }

@keyframes lt-panel-in {
  from { transform: translateX(calc(100% + 16px)); }
  to   { transform: translateX(0); }
}
@keyframes lt-panel-out {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(100% + 16px)); }
}

/* ease-out-quint — starts fast from off-screen, decelerates smoothly, no overshoot */
.lt-panel           { animation: lt-panel-in  420ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.lt-panel.is-settled:not(.is-hiding) { animation: none; transform: none; }
.lt-panel.is-hiding { animation: lt-panel-out 280ms cubic-bezier(0.55, 0, 1, 0.45) both; }

/* ── Header ───────────────────────────────────────────────── */
.lt-panel-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--lt-border);
  flex-shrink: 0;
  background: var(--lt-surface-2);
}

.lt-panel-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--lt-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--lt-accent-dim);
  color: var(--lt-accent);
}

.lt-panel-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--lt-text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.lt-panel-subtitle {
  font-size: 12px;
  color: var(--lt-text-faint);
  margin-top: 1px;
}

.lt-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.lt-panel-close {
  width: 32px;
  height: 32px;
  border-radius: var(--lt-radius-sm);
  background: var(--lt-surface-3);
  border: 1px solid var(--lt-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lt-text-muted);
  transition: color var(--lt-duration), background var(--lt-duration), border-color var(--lt-duration);
  flex-shrink: 0;
}
.lt-panel-close:hover {
  color: var(--lt-danger);
  background: var(--lt-danger-dim);
  border-color: var(--lt-danger-border);
}

/* ── Body ─────────────────────────────────────────────────── */
.lt-panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem 1.25rem;
}

.lt-panel-body::-webkit-scrollbar { width: 5px; }
.lt-panel-body::-webkit-scrollbar-track { background: transparent; }
.lt-panel-body::-webkit-scrollbar-thumb { background: var(--lt-surface-3); border-radius: 99px; }

/* ── Footer ───────────────────────────────────────────────── */
.lt-panel-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--lt-border);
  flex-shrink: 0;
  background: var(--lt-surface-2);
}

.lt-panel-footer-left {
  flex: 1;
}

/* ── Divider ──────────────────────────────────────────────── */
.lt-panel-divider {
  border: none;
  border-top: 1px solid var(--lt-border);
  margin: 1rem 0;
}

/* ── Section inside body ──────────────────────────────────── */
.lt-panel-section {
  margin-bottom: 1.5rem;
}

.lt-panel-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lt-text-faint);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--lt-border);
}

/* ══════════════════════════════════════════════════════════════
   NOTIFICATION CENTER PANEL
   ══════════════════════════════════════════════════════════════ */

/* Bell trigger button */
.lt-notify-bell {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: var(--lt-radius-sm);
  border: 1px solid var(--lt-border);
  background: var(--lt-surface-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lt-text-muted);
  transition: all var(--lt-duration) var(--lt-ease);
}

.lt-notify-bell:hover {
  border-color: var(--lt-border-hover);
  color: var(--lt-text);
  background: var(--lt-surface-3);
}

.lt-notify-bell.has-unread {
  color: var(--lt-accent);
  border-color: rgba(77,143,209,0.35);
  background: var(--lt-accent-dim);
}

/* Unread badge */
.lt-notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  background: var(--lt-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--lt-bg);
  animation: lt-scale-in 200ms var(--lt-ease-spring) both;
  font-family: var(--lt-font);
}

/* Notification items list */
.lt-notify-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lt-notify-list-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--lt-text-faint);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.lt-notify-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--lt-border);
  position: relative;
  animation: lt-fade-in 200ms var(--lt-ease) both;
  transition: background var(--lt-duration-fast);
}

.lt-notify-item:last-child { border-bottom: none; }
.lt-notify-item.is-unread  { background: var(--lt-accent-dim); border-radius: var(--lt-radius-sm); padding: 0.75rem 0.5rem; margin: 0 -0.5rem; }

.lt-notify-item-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lt-notify-item-icon.success { background: var(--lt-success-dim);   color: var(--lt-success); }
.lt-notify-item-icon.error,
.lt-notify-item-icon.danger  { background: var(--lt-danger-dim);    color: var(--lt-danger); }
.lt-notify-item-icon.warning { background: var(--lt-warning-dim);   color: var(--lt-warning); }
.lt-notify-item-icon.info    { background: var(--lt-accent-dim);    color: var(--lt-accent); }

.lt-notify-item-body { flex: 1; min-width: 0; }

.lt-notify-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--lt-text);
  line-height: 1.3;
  margin-bottom: 2px;
}

.lt-notify-item-msg {
  font-size: 12px;
  color: var(--lt-text-muted);
  line-height: 1.5;
}

.lt-notify-item-time {
  font-size: 10px;
  color: var(--lt-text-faint);
  margin-top: 3px;
  font-family: var(--lt-font-mono);
}

.lt-notify-item-remove {
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--lt-text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0;
  opacity: 0;
  transition: opacity var(--lt-duration-fast), color var(--lt-duration-fast), background var(--lt-duration-fast);
  flex-shrink: 0;
}

.lt-notify-item:hover .lt-notify-item-remove { opacity: 1; }
.lt-notify-item-remove:hover { color: var(--lt-danger); background: var(--lt-danger-dim); }

/* unread dot */
.lt-notify-item.is-unread::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lt-accent);
}

/* Light theme */
[data-theme="light"] .lt-panel { background: var(--lt-surface); }
