@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap');

:root {
  --primary-color: #407BFF;
  --secondary-color: #FFD700;
  --text-color: #333;
  --bg-color: #f9f9f9;
  --header-bg: linear-gradient(135deg, #76bd1e, #568a15);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* -------------------------
   RESET Y ESTILOS BASE 
------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding-bottom: 80px;
}

/* -------------------------
   HEADER Y NAVEGACIÓN (DESKTOP)
------------------------- */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--header-bg);
  padding: 15px 30px;
  color: #fff;
}

.logo img {
  max-height: 90px;
  display: block;
}

.nav-wrapper {
  display: flex;
  align-items: center;
}

nav {
  margin-left: auto;
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: var(--secondary-color);
}

/* Ícono hamburguesa (oculto en desktop) */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  height: 3px;
  width: 25px;
  background: #fff;
  margin: 4px 0;
  transition: 0.4s;
}

/* -------------------------
   HEADER - RESPONSIVE (MÓVILES)
------------------------- */
@media (max-width: 768px) {
  .header-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
  }
  .logo {
    flex: 1;
    text-align: left;
  }
  .logo img {
    margin: 0;
  }
  nav {
    display: none !important;
  }
  .hamburger {
    display: flex;
  }
  /* Panel desplegable del menú */
  #nav-menu.open {
    display: block !important;
    background: var(--header-bg);
    position: absolute;
    top: 70px; /* Ajusta según la altura del header */
    left: 0;
    width: 100%;
    padding: 10px 0;
    z-index: 1000;
    animation: slideDown 0.3s ease-in-out;
  }
  #nav-menu.open ul {
    flex-direction: column;
    margin: 0;
  }
  #nav-menu.open ul li {
    margin: 10px 0;
    text-align: center;
  }
}

/* Animación para el menú desplegable */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------
   HERO SECTION (BIENVENIDA)
------------------------- */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 30px auto;
  padding: 40px 30px;
  gap: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.hero-text {
  flex: 1;
}

.hero-text h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.hero-text p {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 20px;
}

.hero-text .hero-button {
  padding: 12px 25px;
  background: #b300ad;
  border-radius: 5px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s;
}

.hero-text .hero-button:hover {
  background: #0056b3;
}

.hero-image {
  flex: 1;
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

@media (max-width: 768px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
  }
  .hero-image {
    width: 100%;
  }
}

/* -------------------------
   BLOG CARDS (VISTA PÚBLICA)
------------------------- */
.blog-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  justify-items: center;
}

@media (max-width: 768px) {
  .blog-container {
    grid-template-columns: 1fr;
  }
}

.blog-post {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post:hover {
  transform: translateY(-3px);
  box-shadow: 0px 6px 20px rgba(0,0,0,0.15);
}

.image-container {
  width: 100%;
  height: 200px; /* Altura fija para la imagen de portada */
  overflow: hidden;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-post-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.blog-post-content h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--primary-color);
  font-weight: 600;
}

.blog-post-content h2 a {
  text-decoration: none;
  color: var(--primary-color);
}

.blog-post-content h2 a:hover {
  text-decoration: underline;
}

.blog-post-content p {
  font-size: 1rem;
  color: #555;
  margin: 0;
}

.blog-post-content .date {
  font-size: 0.85rem;
  color: #888;
  text-align: right;
  margin-top: 8px;
}

/* -------------------------
   BOTÓN DE LIKE (Vista Individual, estilo Facebook)
------------------------- */
.post-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 20px;
  background: #f0f2f5;
  border: 1px solid #ccd0d5;
  border-radius: 20px;
  font-size: 1rem;
  color: #407BFF;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}

.post-like-btn:hover {
  background: #e4e6eb;
  border-color: #b0b3b8;
}

/* -------------------------
   PÁGINA DE PUBLICACIÓN INDIVIDUAL
------------------------- */
.blog-single {
  max-width: 800px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.blog-single h1 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.blog-single p.date {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 20px;
}

.blog-single img {
  width: 100%;
  display: block;
  margin: 20px 0;
  border-radius: 10px;
}

.blog-single .content {
  font-size: 1rem;
  line-height: 1.8;
}

/* -------------------------
   SECCIÓN DE COMENTARIOS
------------------------- */
.comment-section {
  background: #fff;
  padding: 20px;
  margin-top: 30px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.comment-section h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

.comment-section form {
  display: flex;
  flex-direction: column;
}

.comment-section input[type="text"],
.comment-section input[type="email"],
.comment-section textarea {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 15px;
  font-size: 1rem;
}

.comment-section button {
  padding: 12px 25px;
  background:  #b300ad;
  border: none;
  border-radius: 5px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.comment-section button:hover {
  background: #0056b3;
}

.comment-list {
  margin-top: 20px;
}

.comment {
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.comment:last-child {
  border-bottom: none;
}

.comment .author {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 5px;
}

/* Agregar icono de usuario */
.comment .author::before {
  content: "\1F464";
  margin-right: 5px;
  font-size: 1rem;
  vertical-align: middle;
}

.comment .date {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 10px;
}

/* -------------------------
   FORMULARIOS (ADMIN/DASHBOARD)
------------------------- */
.login-container,
.admin-form {
  max-width: 600px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.login-container h2,
.admin-form h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.login-container form,
.admin-form form {
  display: flex;
  flex-direction: column;
}

.login-container form label,
.admin-form form label {
  margin: 10px 0 5px;
}

.login-container form input,
.admin-form form input,
.admin-form form textarea,
.admin-form form select {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
}

.login-container form button,
.admin-form form button {
  margin-top: 20px;
  padding: 12px;
  background: #b300ad;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
  font-weight: 600;
}

.login-container form button:hover,
.admin-form form button:hover {
  background: #0056b3;
}

.error {
  color: red;
  text-align: center;
}

/* -------------------------
   PIE DE PÁGINA
------------------------- */
footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 20px 0;
  position: fixed;
  bottom: 0;
  width: 100%;
}

/* -------------------------
   ANIMACIONES
------------------------- */
.fade-in {
  animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------
   DASHBOARD (ADMIN)
------------------------- */
.admin-dashboard {
  max-width: 900px;
  margin: 40px auto;
  background: #fff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.admin-dashboard h2 {
  font-size: 2rem;
  color: #444;
  text-align: center;
  margin-bottom: 20px;
}

.admin-dashboard p {
  text-align: center;
  font-size: 1rem;
  color: #666;
  margin-bottom: 20px;
}

/* Welcome Card */
.welcome-card {
  color: #fff;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
}

.welcome-card h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.welcome-card p {
  font-size: 1.1rem;
}

/* Botones en Dashboard con iconos */
.admin-dashboard .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 25px;
  margin: 10px 5px;
  font-size: 1rem;
  color: #fff;
  background-color: var(--primary-color);
  text-decoration: none;
  border-radius: 5px;
  box-shadow: var(--shadow);
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.admin-dashboard .btn:hover {
  background-color: #0056b3;
}

.admin-dashboard table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 30px;
  font-size: 0.9rem;
}

.admin-dashboard table thead th {
  background-color: var(--primary-color);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px;
  border-bottom: 2px solid #0056b3;
}

.admin-dashboard table tbody td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
}

.admin-dashboard table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.admin-dashboard table tbody tr:hover {
  background-color: #f1f1f1;
}

/* -------------------------
   IMÁGENES ADICIONALES Y CONTENIDO
------------------------- */
.extra-images-display {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.extra-image {
  border: 1px solid #ddd;
  padding: 5px;
  border-radius: 5px;
}

.extra-image img {
  max-width: 150px;
  height: auto;
  display: block;
}

.content img {
  max-width: 100%;
  margin-top: 15px;
}

/* -------------------------
   RESPONSIVE GENERAL
------------------------- */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
  }
  .admin-dashboard .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* -------------------------
   VISTA PREVIA DE IMÁGENES ADICIONALES
------------------------- */
.extra-images-display {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
  justify-content: center;
}

.extra-image {
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 5px;
  text-align: center;
  width: 150px;
  background: #fff;
  box-shadow: var(--shadow);
}

.extra-image img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 5px;
  border-radius: 3px;
}

.extra-image p {
  font-size: 0.9rem;
  color: #555;
  margin: 0;
}
