/* ------------------------
   RESET & BASE
------------------------ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
  font-family: Arial, sans-serif;
  text-decoration: none;
}

:root {
  --primary: #ff0303c9;
  --background: #ffffff;
  --text-dark: #333;
  --text-light: #ffffff;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  margin: 20px 10px;
  flex: 1;
}

/* ------------------------
   HEADER
------------------------ */
.site-header {
  background-color: var(--background);
  border-bottom: 4px solid var(--primary);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo img {
  height: 60px;
}

.navbar ul {
  display: flex;
  gap: 1.5rem;
}

.navbar a {
  font-size: 18px;
  color: var(--primary);
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 8px;
  transition: background-color 0.3s, color 0.3s;
}

.navbar a:hover {
  background-color: var(--primary);
  color: var(--text-light);
}

#menu-toggle {
  display: none;
}

.menu-icon {
  display: none;
  cursor: pointer;
}

.menu-icon img {
  width: 36px;
}

@media (max-width: 991px) {
  .menu-icon {
    display: block;
  }

  .navbar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--background);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 10px 0;
    margin-top: 8px;
    display: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.3s ease-in-out;
  }

  .navbar ul {
    flex-direction: column;
    align-items: center;
  }

  .navbar ul li {
    width: 100%;
    text-align: center;
  }

  .navbar ul li a {
    display: block;
    width: 100%;
  }

  #menu-toggle:checked ~ .navbar {
    display: block;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------
   FORMULARIO
------------------------ */
.mod {
  display: flex;
  margin: auto;
  width: 90%;
  border-radius: 15px;
  flex-direction: column;
  padding: 15px;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

h2 {
  text-align: center;
  margin: 10px;
  color: var(--primary);
}

section {
  margin-bottom: 20px;
}

.titulo,
.nota {
  color: var(--primary);
}

input[type="text"],
textarea {
  width: 100%;
  padding: 15px;
  margin-top: 10px;
  margin-bottom: 15px;
  border: none;
  border-radius: 8px;
  background: #fafafa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12),
              0 1px 2px rgba(0, 0, 0, 0.24);
}

textarea {
  height: 200px;
  resize: vertical;
}

.cub {
  text-align: center;
  padding: 15px;
  margin: 10px;
}

.cub input[type="checkbox"] {
  margin-right: 5px;
}

input[type="submit"] {
  display: block;
  margin: auto;
  padding: 10px 20px;
  background-color: var(--primary);
  color: white;
  border: solid 1px white;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12),
              0 1px 2px rgba(0, 0, 0, 0.24);
  transition: background-color 0.3s, color 0.3s, border 0.3s;
}

input[type="submit"]:hover {
  background-color: white;
  color: var(--primary);
  border: solid 1px black;
}

.highlight-link {
  color: #007bff;
  text-decoration: underline;
}

/* ------------------------
   DESCRIPCIÓN
------------------------ */
.ff {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0;
}

.ff .descripcion {
  width: 90%;
  padding: 10px;
}

.ff .descripcion .texto {
  text-align: center;
  font-size: 15px;
  color: var(--text-dark);
}

/* ------------------------
   FOOTER
------------------------ */
.site-footer {
  background: var(--primary);
  color: var(--text-light);
  padding: 2rem 1rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-logo {
  width: 48px;
  height: auto;
  margin-right: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25));
}

.footer-nav ul {
  display: flex;
  gap: 1.25rem;
}

.footer-nav a {
  color: var(--text-light);
  text-decoration: none;
  position: relative;
  transition: transform .2s ease;
}

.footer-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: var(--text-light);
  transition: width .3s ease;
}

.footer-nav a:hover,
.footer-nav a:focus {
  transform: translateY(-2px);
}

.footer-nav a:hover::after,
.footer-nav a:focus::after {
  width: 100%;
}

.site-footer .copyright {
  display: block;
  margin-top: 1rem;
  text-align: center;
  font-size: .875rem;
  opacity: .9;
}

@media (max-width: 600px) {
  .footer-container {
    flex-direction: column;
    text-align: center;
  }

  .footer-logo {
    margin: 0 auto 0.75rem;
  }

  .footer-nav ul {
    flex-direction: column;
    gap: .75rem;
    margin-top: 1rem;
  }
}
/* ===========================================
   NUEVO.PHP – BLOQUES, ENLACES Y BOTONES
   =========================================== */

/* 1 — Caja base */
.box{
  width:90%;
  max-width:600px;
  margin:30px auto;          /* aire uniforme arriba/abajo */
  padding:24px;
  border-radius:20px;
  background:#fff;
  box-shadow:0 6px 20px rgba(0,0,0,.08);
  text-align:center;
}

/* 2 — Títulos dentro de la caja */
.box h2{
  font-size:26px;
  margin-bottom:18px;
  color:var(--primary);
}

/* 3 — Input del enlace */
.box .in{
  width:100%;
  padding:14px 16px;
  font-size:16px;
  border:2px solid #ececec;
  border-radius:10px;
  background:#fafafa;
  color:#444;
  box-shadow:inset 0 1px 3px rgba(0,0,0,.05);
}

/* 4 — Botón genérico reutilizable */
.btn-e,
.btn{
  display:inline-block;
  padding:10px 22px;
  border-radius:10px;
  font-size:16px;
  font-weight:600;
  color:#fff;
  text-decoration:none;
  transition:background .25s,transform .25s;
}

/* 4a — Variantes */
.btn-e,
.btn-copy        {background:var(--primary);}
.btn1            {background:#181890;}     /* Editar */
.btn2            {background:#e90202;}     /* Borrar */

.btn-e:hover,
.btn:hover{
  background:rgba(255,90,90,.95);          /* tono más oscuro */
  transform:translateY(-2px);
}

/* 5 — Espaciados internos */
.btn-copy{margin-top:16px;}
.preview-title{
  font-size:22px;
  color:var(--primary);
  margin-bottom:8px;
  word-break:break-word;
}
.preview-body{
  white-space:pre-line;
  font-size:16px;
  line-height:1.55;
  color:var(--text-dark);
  margin-bottom:16px;
}

/* 6 — Grupo de botones Editar/Borrar */
.bi{
  display:flex;
  justify-content:center;
  gap:20px;
  margin-top:10px;
}
.bi .btn:hover{opacity:.9;}

/* 7 — Icono + fecha */
.bi span{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  color:#666;
}

/* 8 — Pequeño ajuste móvil */
@media(max-width:600px){
  .box{padding:20px 18px;}
  .box h2{font-size:22px;}
  .preview-title{font-size:20px;}
  .preview-body{font-size:15px;}
}
/* ===========================================
   NOTA.PHP – Tarjeta de nota pública
   =========================================== */

.note-card {
  background: #ffffff;
  width: 90%;
  max-width: 700px;
  margin: 30px auto;
  padding: 25px 30px;
  border-radius: 15px;
  box-shadow: 0 5px 18px rgba(0,0,0,.08);
}

.note-title {
  font-size: 28px;
  color: var(--primary);
  text-align: center;
  margin-bottom: 20px;
  word-break: break-word;
}

.note-body {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-dark);
  white-space: pre-wrap;          /* respeta saltos de línea */
  word-wrap: break-word;
}

/* Botón/enlace detectado dentro del contenido */
.btn-e {
  display: inline-block;
  margin: 4px 0;
  padding: 6px 10px;
  background: var(--primary);
  color: var(--text-light);
  border-radius: 8px;
  font-size: 15px;
  text-decoration: none;
  transition: background .3s;
}
.btn-e:hover {
  background: #ff5c5c;
}

/* Pie con fecha */
.note-meta {
  width: 90%;
  max-width: 700px;
  margin: 0 auto 40px;
  text-align: right;
}
.note-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 600px) {
  .note-card {
    padding: 20px 18px;
  }
  .note-title {
    font-size: 24px;
  }
  .note-body {
    font-size: 16px;
  }
}
/* ===========================================
   PERFIL (notas-dispositivo.php)
   =========================================== */

/* Tarjeta de perfil */
.profile-card{
  width:90%;max-width:700px;margin:30px auto;
  padding:24px;border-radius:20px;
  background:#fff;box-shadow:0 6px 20px rgba(0,0,0,.08);
  display:flex;align-items:center;gap:20px;
}
.profile-pic{
  width:90px;height:90px;border-radius:50%;
  object-fit:cover;flex-shrink:0;
}
.profile-info{flex:1}
.profile-name{font-size:26px;color:var(--primary);margin:0 0 8px}

/* Aviso */
.profile-warning{
  width:90%;max-width:700px;margin:10px auto 30px;
  text-align:center;font-size:15px;color:#555
}

/* Listado de notas */
.note-list{
  width:90%;max-width:700px;margin:0 auto 40px;display:grid;
  gap:20px
}
.note-item{
  padding:20px;border-radius:15px;background:#fff;
  box-shadow:0 4px 15px rgba(0,0,0,.06);text-align:center
}
.note-item h3{
  font-size:20px;color:var(--primary);margin-bottom:6px;
  word-break:break-word
}
.note-date{
  font-size:13px;color:#777;margin-bottom:12px
}

/* Botón heredado (.btn-e) ya definido */
/* ===========================================
   PERFIL: Ajuste para nombres largos
   =========================================== */

.profile-name {
  font-size: 22px;
  color: var(--primary);
  margin: 0 0 8px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

@media (max-width: 600px) {
  .profile-name {
    font-size: 18px;
  }
}
/* ===========================================
   NOTA.PHP – Meta (fecha + vistas)
   =========================================== */
/* NOTA.PHP – Meta (fecha y vistas con íconos, responsive y alineado) */
.note-meta {
  width: 90%;
  max-width: 700px;
  margin: 0 auto 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95em;
  color: #666;
  padding: 0 10px;
}

.note-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-meta svg {
  fill: currentColor;
  height: 1.2em;
  width: 1.2em;
}
/* ===========================================
   NAVEGADOR – Listado público (versión final)
   =========================================== */
.public-list {
  width: 90%;
  max-width: 800px;
  margin: 30px auto;
  display: grid;
  gap: 22px;
}

.public-item {
  padding: 20px 24px;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.public-item h3 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--primary);
  word-break: break-word;
}

.public-link {
  color: inherit;
  text-decoration: none;
}

.public-link:hover {
  text-decoration: underline;
}

.public-date {
  font-weight: 600;
}

/* Meta y fragmento */
.public-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #555;
  margin-top: 5px;
  overflow: hidden;
}

.public-snippet {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: italic;
  font-size: 13px;
  color: #666;
  max-width: 100%;
}

/* Vistas */
.public-views {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #666;
}

.public-views svg {
  height: 1.1em;
  width: 1.1em;
  fill: currentColor;
}

/* Paginación */
.pager {
  width: 90%;
  max-width: 800px;
  margin: 20px auto 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
}

.pager-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.25s;
}

.pager-btn:hover {
  background: #ff5c5c;
}

.pager-info {
  font-size: 14px;
  color: #444;
}

/* Layout horizontal en pantallas ≥ 600 px */
@media (min-width: 600px) {
  .public-meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .public-snippet {
    text-align: right;
    max-width: 60%;
  }
}