/* Share Panel — popup component for public link sharing */

.sp-popup {
  position: fixed;
  z-index: 600;
  width: 300px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  color: var(--fg);
  overflow: hidden;
}

.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev-2);
}

.sp-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--fg);
}

.sp-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--fg-mute);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.sp-close:hover {
  background: var(--hover);
  color: var(--fg);
}

.sp-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sp-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sp-toggle-label {
  font-weight: 500;
  color: var(--fg);
}

.sp-toggle-sub {
  font-size: 11px;
  color: var(--fg-mute);
  line-height: 1.4;
}

/* Custom toggle switch */
.sp-switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.sp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.sp-track {
  display: block;
  width: 36px;
  height: 20px;
  background: var(--line-2, var(--line));
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
  position: relative;
}

.sp-switch input:checked + .sp-track {
  background: var(--accent);
}

.sp-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--dur) var(--ease);
  pointer-events: none;
}

.sp-switch input:checked ~ .sp-track .sp-thumb,
.sp-switch input:checked + .sp-track .sp-thumb {
  transform: translateX(16px);
}

.sp-link-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sp-url-input {
  flex: 1;
  font-size: 11px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--bg-elev-2);
  color: var(--fg-dim, var(--fg-mute));
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
  user-select: all;
}

.sp-url-input:focus {
  border-color: var(--accent);
}

.sp-status {
  font-size: 11px;
  color: var(--fg-mute);
  min-height: 16px;
  text-align: center;
}

.sp-status.error {
  color: var(--danger);
}

.sp-status.success {
  color: #34d399;
}
