/* ==========================================================================
   LINKPAD - EDITOR STYLES (Minimal Design)
   ========================================================================== */

/* ========== Editor Layout ========== */
.editor-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ========== Header ========== */
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  flex-shrink: 0;
}

.editor-header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}

.editor-header__logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(
    135deg,
    var(--color-accent),
    var(--color-secondary)
  );
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
  flex-shrink: 0;
}

.editor-header__brand:hover .editor-header__logo-icon {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

.editor-header__title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
}

.editor-header__spacer {
  flex: 1;
}

.editor-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.editor-header__history {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.editor-header__divider {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 var(--space-2);
}

/* Button with text */
.btn--with-text {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.btn--with-text i {
  width: 16px;
  height: 16px;
}

/* ========== Status Pill ========== */
.status-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg-tertiary);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.status-pill__indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-text-muted);
  flex-shrink: 0;
}

.status-pill__indicator.saved {
  background: var(--color-success);
}

.status-pill__indicator.saving {
  background: var(--color-warning);
  animation: pulse 1s infinite;
}

.status-pill__indicator.error {
  background: var(--color-error);
}

.status-pill__divider {
  color: var(--color-text-muted);
  opacity: 0.5;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ========== Full-Page Editor ========== */
.editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  overflow: auto;
}

.editor {
  flex: 1;
  width: 100%;
  max-width: 100%;
  padding: var(--space-4) var(--space-8);
  background: transparent;
  border: none;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  outline: none;
}

/* Placeholder styling */
.editor:empty::before {
  content: attr(data-placeholder);
  color: var(--color-text-muted);
  pointer-events: none;
}

/* Editor content styling */
.editor h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
  line-height: 1.2;
}

.editor h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
}

.editor h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
}

.editor h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-medium);
  margin-bottom: var(--space-2);
}

.editor p {
  margin-bottom: var(--space-4);
}

.editor ul,
.editor ol {
  margin-bottom: var(--space-4);
  padding-left: 0;
  margin-left: var(--space-6);
  list-style-position: outside;
}

.editor ul {
  list-style-type: disc;
}

.editor ol {
  list-style-type: decimal;
}

.editor li {
  margin-bottom: var(--space-2);
  padding-left: var(--space-2);
}

.editor blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-4);
  margin: var(--space-4) 0;
  color: var(--color-text-secondary);
  font-style: italic;
}

.editor strong,
.editor b {
  font-weight: var(--font-bold);
}

.editor em,
.editor i {
  font-style: italic;
}

.editor u {
  text-decoration: underline;
}

/* ========== Slash Command Menu (Horizontal Toolbar) ========== */
.slash-menu {
  position: fixed;
  z-index: var(--z-dropdown);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
}

.slash-menu[hidden] {
  display: none;
}

.slash-menu__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.slash-menu__btn:hover,
.slash-menu__btn:focus,
.slash-menu__btn.active {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  outline: none;
}

.slash-menu__btn i {
  width: 18px;
  height: 18px;
}

/* Font size group */
.slash-menu__size-group {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-1);
}

.slash-menu__btn--size {
  width: 28px;
  height: 28px;
}

.slash-menu__btn--size i {
  width: 14px;
  height: 14px;
}

.slash-menu__select {
  width: 50px;
  padding: var(--space-1) var(--space-1);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.slash-menu__select:hover,
.slash-menu__select:focus {
  border-color: var(--color-accent);
  outline: none;
}

/* Divider in slash menu */
.slash-menu__divider {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  margin: 0 var(--space-1);
}

/* ========== Toast ========== */
.copy-toast {
  position: fixed;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: var(--space-3) var(--space-6);
  background: var(--color-success);
  color: white;
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all var(--transition-base);
  z-index: var(--z-toast);
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
  .editor-header {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-2);
  }

  .editor-header__title {
    display: none;
  }

  .editor-header__history {
    display: none;
  }

  .editor-header__divider {
    display: none;
  }

  .btn--with-text span {
    display: none;
  }

  .btn--with-text {
    padding: var(--space-2);
  }

  .status-pill {
    padding: var(--space-2) var(--space-3);
    font-size: 10px;
  }

  .editor-main {
    padding: var(--space-4);
  }

  .editor {
    font-size: var(--text-base);
    padding: var(--space-2) var(--space-4);
  }

  .slash-menu {
    left: var(--space-3) !important;
    right: auto !important;
    flex-wrap: wrap;
    max-width: calc(100vw - var(--space-6));
  }
}

@media (max-width: 480px) {
  .editor-header__logo-icon {
    width: 28px;
    height: 28px;
  }

  .status-pill__divider:last-of-type,
  .status-pill span:last-child {
    display: none;
  }

  .editor {
    padding: var(--space-2);
  }

  .slash-menu__btn {
    width: 32px;
    height: 32px;
  }
}
