/* ============================================================
   🎨 ENLACES BÁSICOS
   ============================================================ */
a {
  color: var(--c-primary);
  text-decoration: none;
  transition: opacity 0.2s ease-in-out;
}
a:hover { opacity: 0.85; }
a.delete-link { color: crimson; }

/* ============================================================
   🧭 HEADER Y FOOTER
   ============================================================ */
header {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease-in-out;
}

footer {
  background: #0a0a0a;
  color: #ccc;
  border-top: 1px solid #222;
  text-align: center;
  padding: 20px 0;
  font-size: 0.9em;
}
footer a {
  color: var(--c-primary);
  font-weight: 500;
}
footer a:hover { text-decoration: underline; }

/* ============================================================
   🪟 MODAL EARVU
   ============================================================ */
   /*
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal.show { display: flex; }

.modal-content {
  background: #ffffff;
  color: #111111;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  max-width: 420px;
  text-align: center;
}
.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.modal-actions button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s ease-in-out, transform 0.1s ease-in-out;
}
.modal-actions button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
button#cancelDelete {
  background: #e0e0e0;
  color: #222;
}
button.danger {
  background: #e74c3c;
  color: #fff;
}


body.dark-mode .modal-content {
  background: #1f1f1f;
  color: #eaeaea;
}
body.dark-mode button#cancelDelete {
  background: #444;
  color: #eee;
  border: 1px solid #555;
}
body.dark-mode button.danger {
  background: #e15b4f;
  color: #fff;
  border: 1px solid #ff6b5a;
}
body.dark-mode button.danger:hover {
  background: #ff6b5a;
  border-color: #ffa89c;
}
*/
/* ============================================================
   📄 CONTENIDO Y ARTÍCULOS
   ============================================================ */
.article-list {
  list-style: none;
  padding: 0;
}
.article-list li {
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
  transition: background 0.3s ease;
}
.article-list li:hover {
  background: rgba(77, 163, 255, 0.06);
}
.content-detail h1 { font-size: 2em; margin-bottom: 0; }
.content-detail .subtitle { color: #666; margin-top: 0.2em; }
.not-found { text-align: center; padding: 60px 0; }
.not-found h1 { font-size: 4em; color: #999; }

/* ============================================================
   ⚡ MENSAJES FLASH
   ============================================================ */
.flash-container {
  max-width: 1100px;
  margin: 10px auto;
  padding: 0 16px;
}
.flash {
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 8px;
  color: #fff;
  font-weight: 500;
  animation: fadeInUp 0.4s ease-out;
  transition: opacity 0.4s ease-out;
}
.flash-info { background-color: var(--c-primary); }
.flash-success { background-color: #2ecc71; }
.flash-warning { background-color: #f39c12; }
.flash-danger, .flash-error { background-color: #e74c3c; }
.flash.hide {
  opacity: 0;
  transform: translateY(-10px);
}

/* ============================================================
   🎛️ BOTONES Y ACCIONES
   ============================================================ */
button,
a.btn,
a.delete-link,
a.edit-link {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease-in-out;
}
button {
  background: var(--c-primary);
  color: #fff;
}
button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
a.edit-link {
  background: #2980b9;
  color: #fff !important;
}
a.edit-link:hover { background: #3498db; }
a.delete-link {
  background: #c0392b;
  color: #fff !important;
}
a.delete-link:hover { background: #e74c3c; }

button[type="submit"],
a.btn.create {
  background: #27ae60;
  color: #fff;
}
button[type="submit"]:hover,
a.btn.create:hover {
  background: #2ecc71;
}

/* ============================================================
   🧩 FORMULARIOS
   ============================================================ */
form {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9em;
  width: 100%;
  max-width: 400px;
  background: #fff;
  color: #222;
  transition: all 0.2s ease-in-out;
}
input::placeholder,
textarea::placeholder { color: #888; }
input:focus,
textarea:focus,
select:focus {
  border-color: var(--c-primary);
  outline: none;
  box-shadow: 0 0 3px rgba(77, 163, 255, 0.4);
}

/* --- Corrección modo claro --- */
body:not(.dark-mode) input,
body:not(.dark-mode) textarea,
body:not(.dark-mode) select {
  background: #ffffff !important;
  color: #222 !important;
  border: 1px solid #ccc !important;
}
body:not(.dark-mode) main.container {
  background: #fafafa !important;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.08);
  padding: 20px;
  transition: all 0.3s ease-in-out;
}

/* ============================================================
   🧱 TABLAS Y LISTAS
   ============================================================ */
.content-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.content-table th,
.content-table td {
  border-bottom: 1px solid #eee;
  padding: 8px;
  text-align: left;
}
.content-table th {
  background: #fafafa;
  font-weight: bold;
}
.content-table tr:hover {
  background: rgba(77, 163, 255, 0.08);
}

/* ============================================================
   ✨ MICROANIMACIONES
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
button:hover,
a.btn:hover,
a.edit-link:hover,
a.delete-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   🌙 MODO OSCURO
   ============================================================ */
body.dark-mode {
  background: #121212;
  color: #e0e0e0;
}
body.dark-mode header { background: #1f1f1f; color: #fff; }
body.dark-mode footer {
  background: #0d0d0d;
  color: #bbb;
  border-top: 1px solid #222;
}
body.dark-mode a { color: #4da3ff; }

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background: #181a1b;
  color: #f1f3f5;
  border: 1px solid #3a3d40;
}
body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
  border-color: #4da3ff;
  box-shadow: 0 0 4px rgba(77,163,255,0.4);
}

body.dark-mode .content-table th { background: #1a1a1a; color: #eee; }
body.dark-mode .content-table td { border-bottom: 1px solid #333; }
body.dark-mode .content-table tr:hover {
  background: rgba(77,163,255,0.25);
}

body.dark-mode main.container {
  background: #1a1a1a;
  box-shadow: 0 0 12px rgba(0,0,0,0.6);
  border-radius: 8px;
  padding: 20px;
}

/* ============================================================
   🧭 HEADER PRINCIPAL (versión final con logo)
   ============================================================ */
.main-header {
  background: var(--c-primary);
  color: #fff;
  padding: 10px 0;
  transition: background 0.3s ease, color 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Logo + título */
.site-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-brand img { height: 26px; width: auto; display: block; }
.site-title {
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  font-size: 1.2em;
}

/* Acciones */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-panel,
.btn-login,
.btn-logout,
.btn-theme {
  background: #fff;
  color: var(--c-primary);
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-panel:hover,
.btn-login:hover,
.btn-logout:hover,
.btn-theme:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.username { font-size: 0.9em; color: #fff; }

/*body.dark-mode .main-header {
  background: #1f1f1f !important;
  color: #eaeaea !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}*/
body.dark-mode .site-title { color: #eaeaea !important; }
body.dark-mode .btn-panel,
body.dark-mode .btn-login,
body.dark-mode .btn-logout,
body.dark-mode .btn-theme {
  background: #2c2c2c !important;
  color: #eaeaea !important;
  border: 1px solid #444 !important;
}
body.dark-mode .btn-panel:hover,
body.dark-mode .btn-login:hover,
body.dark-mode .btn-logout:hover,
body.dark-mode .btn-theme:hover {
  background: #3a3a3a !important;
  border-color: #555 !important;
}
body.dark-mode .username { color: #eaeaea !important; }

/* ============================================================
   🧠 PANEL DE AYUDA (azul oscuro)
   ============================================================ */
.editor-side {
  background: #0d1b2a !important;
  border-left: 2px solid #1b263b !important;
  color: #e0e6ef !important;
}
body.dark-mode .editor-side {
  background: #0d1b2a !important;
  border-left: 2px solid #1b263b !important;
  color: #e0e6ef !important;
}
.editor-side h4 {
  color: #4da3ff;
  margin-bottom: 8px;
}
.editor-side ul {
  list-style: disc;
  margin-left: 20px;
}
.editor-side code {
  background: #112240;
  padding: 3px 5px;
  border-radius: 4px;
  color: #a0c4ff;
}

.editor-side h1,
.editor-side h2 {
  color: #4da3ff;
  border-bottom: 1px solid #1b263b;
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.editor-side h3 {
  color: #9cd2ff;
  margin-top: 12px;
}

.editor-side {
  background: #0d1b2a !important;
  border-left: 2px solid #1b263b !important;
  color: #e0e6ef !important;

  /* 👇 Añadido nuevo */
  padding: 18px 22px !important;
  overflow-y: auto;
  line-height: 1.55;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.4);
  border-radius: 0 8px 8px 0;
}


/* ============================================================
   📱 RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .footer-logo img { width: 140px; }
  .site-footer { font-size: 0.85em; padding: 16px 0; }
  header .container {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}
@media (max-width: 480px) {
  .footer-logo img { width: 120px; }
  .site-footer p { font-size: 0.75em; }
}

/* ============================================================
   OTROS
   ============================================================ */
button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
#slug-hint {
  display: block;
  margin-top: 4px;
  min-height: 1.1em;
  line-height: 1.1em;
}

/* ============================================================
   BOTONES DE IDIOMA
   ============================================================ */

.lang-switcher {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-lang {
  background: #fff;
  color: var(--c-primary);
  padding: 4px 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85em;
  transition: all 0.2s ease;
}

.btn-lang:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

body.dark-mode .btn-lang {
  background: #2c2c2c;
  color: #eaeaea;
  border: 1px solid #444;
}

body.dark-mode .btn-lang:hover {
  background: #3a3a3a;
}

.lang-small {
  background: #fff;
  color: var(--c-primary);
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 4px 8px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
}

.lang-small:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

body.dark-mode .lang-small {
  background: #2c2c2c;
  color: #eaeaea;
  border: 1px solid #444;
}

/* ============================================================
   🧩 LAYOUT DE DOS PANELES (contenido + ayuda)
   ============================================================ */

.two-panel-layout {
  display: grid;
  grid-template-columns: 1fr 28%;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1100px) {
  .two-panel-layout {
    grid-template-columns: 1fr;
  }
}

.main-panel {
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
  border-radius: 12px;
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode .main-panel {
  background: #181818;
}

/* ============================================================
   🌌 PANEL DE AYUDA CONTEXTUAL (versión premium, igual al dashboard)
   ============================================================ */
.panel-help {
  position: relative;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #e8ecf2;
  background: radial-gradient(circle at top left, #1c2a3a 0%, #0d1b2a 60%, #0a1626 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 22px;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease-in-out;
  overflow-y: auto;
  max-height: 80vh;
}

/* Encabezados */
.panel-help h1,
.panel-help h2,
.panel-help h3 {
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  color: #ffcb6b;
}
.panel-help h1 { font-size: 1.4rem; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 4px; }
.panel-help h2 { font-size: 1.2rem; color: #ffd479; }
.panel-help h3 { font-size: 1.05rem; color: #ffca85; }

/* Código */
.panel-help code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: monospace;
  color: #f8f8f2;
}
.panel-help pre code {
  display: block;
  padding: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  white-space: pre-wrap;
}

/* Enlaces */
.panel-help a {
  color: #77aaff;
  text-decoration: none;
}
.panel-help a:hover {
  text-decoration: underline;
  color: #a8caff;
}

/* Borde resplandeciente al pasar */
.panel-help:hover {
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.5),
    inset 0 0 24px rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

/* 🌞 Modo claro */
body:not(.dark-mode) .panel-help {
  background: linear-gradient(180deg, #f8fafc 0%, #e9edf3 100%);
  color: #222;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.08),
    inset 0 0 12px rgba(255, 255, 255, 0.3);
}
body:not(.dark-mode) .panel-help h1,
body:not(.dark-mode) .panel-help h2,
body:not(.dark-mode) .panel-help h3 {
  color: #333;
}


/* ============================================================
   🌈 Restauración del degradado visual en paneles de ayuda
   ============================================================ */
.editor-side,
.panel-help {
  background: linear-gradient(180deg, #0d1b2a 0%, #1b263b 100%) !important;
}

body:not(.dark-mode) .editor-side,
body:not(.dark-mode) .panel-help {
  background: linear-gradient(180deg, #f8fafc 0%, #e9edf3 100%) !important;
}



/* ============================================================
   🪶 ANIMACIÓN SUAVE DE ENTRADA
   ============================================================ */
.help-panel,
.main-panel {
  animation: fadeInUp 0.35s ease both;
}
