/* Botón Guardar minimalista */
.btn-guardar {
  background: #2ba0ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1.2rem;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
}
.btn-guardar:hover {
  background: #238be6;
}
@media (prefers-color-scheme: dark) {
  .btn-guardar {
    background: #238be6;
    color: #fff;
  }
  .btn-guardar:hover {
    background: #2ba0ff;
  }
}
/* Minimalista y moderno estilo Notion, claro/oscuro */
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  color: #222;
  background: #fafbfc;
  transition: background 0.2s, color 0.2s;
}
@media (prefers-color-scheme: dark) {
  body {
    background: #18191a;
    color: #ececec;
  }
}
main {
  position: fixed;
  top: 3rem;
  left: 260px;
  right: 0;
  bottom: 0;
  background: transparent;
}
aside {
  position: fixed;
  width: 260px;
  top: 0;
  bottom: 0;
  left: 0;
  background: #fff;
  border-right: 1px solid #ececec;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 1000;
  overflow-y: auto;
}
@media (prefers-color-scheme: dark) {
  aside {
    background: #232324;
    border-right: 1px solid #232324;
  }
}
@media (min-width: 769px) {
  aside.sidebar-hidden {
    transform: translateX(-100%);
  }
  aside.sidebar-hidden ~ main,
  aside.sidebar-hidden ~ header {
    left: 0;
  }
  aside.sidebar-hidden ~ header #sidebarToggleBtn svg {
    transform: scaleX(-1);
    transition: transform 0.3s;
  }
}

/* Dark mode - aside */
@media (prefers-color-scheme: dark) {
  aside {
    background-color: #252525;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }
}

aside h2 {
  padding: 1.2rem 1.2rem 0 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #222;
  letter-spacing: 0.01em;
}
@media (prefers-color-scheme: dark) {
  aside h2 {
    color: #ececec;
  }
}
aside article {
  border-bottom: 1px solid #ececec;
  font-size: 13px;
  line-height: 1.5;
  padding: 1rem 1.2rem;
  background: none;
}
@media (prefers-color-scheme: dark) {
  aside article {
    border-bottom: 1px solid #232324;
  }
}
aside article:first-child {
  border-top: 1px solid #ececec;
}
@media (prefers-color-scheme: dark) {
  aside article:first-child {
    border-top: 1px solid #232324;
  }
}
aside article h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (prefers-color-scheme: dark) {
  aside article h3 {
    color: #ececec;
  }
}
aside article p {
  margin: 0 0 0.3rem;
  color: #666;
  font-size: 0.97em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
@media (prefers-color-scheme: dark) {
  aside article p {
    color: #b0b0b0;
  }
}
aside article div {
  font-size: 11px;
  color: #bbb;
}
@media (prefers-color-scheme: dark) {
  aside article div {
    color: #555;
  }
}
aside article img {
  display: block;
  width: 3.5rem;
  height: 3.5rem;
  object-fit: cover;
  float: right;
  margin-left: 0.5rem;
  border-radius: 8px;
}

header {
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
  height: 3rem;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  background: #fff;
  border-bottom: 1px solid #ececec;
  z-index: 1002;
}
@media (prefers-color-scheme: dark) {
  header {
    background: #18191a;
    border-bottom: 1px solid #232324;
  }
}
header > *:not(:last-child) {
  margin-right: 1.2rem;
}
#sidebarToggleBtn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 10px 0 0;
  margin-right: 8px;
  height: 40px;
  display: inline-flex;
  align-items: center;
}
header button {
  background: #f5f6fa;
  color: #222;
  border-radius: 6px;
  padding: 0.45rem 1.1rem;
  font-size: 14px;
  font-weight: 500;
  border: none;
  outline: none;
  user-select: none;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.2s, color 0.2s;
}
header button:hover {
  background: #e3e4e8;
}
@media (prefers-color-scheme: dark) {
  header button {
    background: #232324;
    color: #ececec;
  }
  header button:hover {
    background: #232324;
    color: #fff;
  }
}

ul.tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.3rem;
}
ul.tags li {
  display: block;
  background: #f5f6fa;
  padding: 0.18rem 0.7rem;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #888;
  transition: background 0.2s, color 0.2s;
}
@media (prefers-color-scheme: dark) {
  ul.tags li {
    background: #232324;
    color: #b0b0b0;
  }
}

/* Status guardado */
/* Status guardado */
/* Status guardando destacado */
#status-guardando,
#editor-status-act {
  position: fixed;
  top: 53px;
  right: 10px;
  background: #749cbd;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 15px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 2px 12px rgba(43,160,255,0.12);
  animation: none;
}
#status-guardando.show-status {
  opacity: 1;
  animation: pulse 1.2s infinite;
}
#editor-status-act.show-status {
  opacity: 1;
}
#editor-status-act {
  background: #4f926c;
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  #status-guardando,
  #editor-status-act {
    background: #55606a;
    color: #fff;
    box-shadow: 0 2px 12px rgba(43,160,255,0.18);
  }
  #editor-status-act {
    background: #478c4a;
    color: #fff;
  }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(43,160,255,0.3); }
  70% { box-shadow: 0 0 0 10px rgba(43,160,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(43,160,255,0); }
}

.tox-promotion {
  display: none;
}

/* Title input */
/* Title input */
#titulo-input {
  color: #222;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
  padding: 0.5rem 0;
  width: 100%;
  transition: color 0.2s;
}
#titulo-input::placeholder {
  color: #bbb;
  opacity: 1;
}
@media (prefers-color-scheme: dark) {
  #titulo-input {
    color: #ececec !important;
  }
  #titulo-input::placeholder {
    color: #555;
  }
}

/* Menu dots icon - dark mode */
@media (prefers-color-scheme: dark) {
  .menu-dots g[fill="#aaafb7"] {
    fill: #ececec !important;
  }
}

/* Dropdown menu */
/* Dropdown menu */
#dropdown-menu a:hover {
  background: #f5f6fa;
}
@media (prefers-color-scheme: dark) {
  #dropdown-menu {
    background: #232324 !important;
    border: 1px solid #232324 !important;
  }
  #dropdown-menu a {
    color: #ececec !important;
  }
  #dropdown-menu a[href*="logout"],
  #dropdown-menu a[href*="borrarnota"] {
    color: #dc3545 !important;
  }
  #dropdown-menu a:hover {
    background: #232324 !important;
  }
}


/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
  aside {
    transform: translateX(-100%);
    z-index: 1001;
  }
  aside.mobile-open {
    transform: translateX(0);
    transform: translateY(40px);
  }
  main {
    left: 0;
    top: 3rem;
  }
  header {
    left: 0;
    padding: 0 0.7rem;
  }
  header > *:not(:last-child) {
    margin-right: 0.5rem;
  }
  ul.tags {
    display: none;
  }
  header button {
    padding: 0.35rem 0.7rem;
    font-size: 12px;
  }
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #222;
  }
  @media (prefers-color-scheme: dark) {
    .mobile-menu-btn {
      color: #ececec;
    }
  }
  .mobile-menu-btn svg {
    width: 24px;
    height: 24px;
  }
  #sidebarToggleBtn {
    display: none;
  }
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }
  .mobile-overlay.active {
    display: block;
  }
}
@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }
  .mobile-overlay {
    display: none !important;
  }
}
