/* ============================================================
   🎨 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;
  }
}

/* ============================================================
   🧩 HELP HEADER – versión refinada EarVu
   ============================================================ */
.help-panel-wrapper .helpContent .help-header {
  text-align: center !important;
  margin-bottom: 14px !important;
}

.help-panel-wrapper .helpContent .help-header small {
  display: block !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: #4da3ff !important;
  line-height: 1.4 !important;
}

/* Icono ligeramente más presente */
.help-panel-wrapper .helpContent .help-header small:first-child {
  opacity: 0.85 !important;
}

/* Título de contexto */
.help-panel-wrapper .helpContent .help-header strong {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #bcdcff !important;
}

/* === Tablas dentro de la ayuda contextual === */
.help-panel-wrapper .helpContent table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.help-panel-wrapper .helpContent th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  color: #6cb4ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.help-panel-wrapper .helpContent td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: inherit;
}

.help-panel-wrapper .helpContent tr:last-child td {
  border-bottom: none;
}

/* ========================================================= */
/*  Mobile · Header App (WEB / ADMIN)                        */
/* ========================================================= */

.mobile-notice {
  display: none;
}

@media (max-width: 768px) {

  /* Ocultar iconos decorativos */
  .header-center .icon {
    display: none;
  }

  /* Compactar botones */
  .header-center a {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  /* Ajuste leve del header */
  .main-header {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .site-logo {
    transform: scale(0.9);
  }

  /* Aviso visible solo en móvil */
  .mobile-notice {
    display: block;
    font-size: 0.75rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 10px;
  }
}

