:root {
  --verde: #3c8c5a;
  --celeste: #7ec8e3;
  --amarillo: #ffd166;
  --fondo: #f5f7f4;
  --texto: #222;
  --gris-claro: #e6e6e6;
  --sombra: rgba(0, 0, 0, 0.15);
  --font-size-base: 1rem;
  --font-size-heading: 1.6rem;
  --font-size-large: 2rem; /* Tamaño para las categorías */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", "Arial", sans-serif;
}

html, body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
  font-size: var(--font-size-base);
  margin: 0;
  padding: 0;
}

/* ===== HEADER Y MENÚ ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 3px solid var(--verde);
  padding: 1em 2em;
  position: sticky;
  top: 0;
  z-index: 20;
}

header .logo img {
  height: 65px;
  width: auto;
}

.menu-toggle {
  display: none;
  font-size: 32px;
  background: none;
  border: 2px solid transparent;
  color: var(--verde);
  cursor: pointer;
  border-radius: 8px;
  padding: 0.5em 1em;
}

.menu-toggle:hover {
  color: var(--celeste);
}

nav.menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1em;
}

nav.menu a {
  text-decoration: none;
  color: var(--texto);
  font-weight: 600;
  padding: 0.8em 1.2em;
  border-radius: 10px;
  border: 2px solid var(--verde);
  background: linear-gradient(135deg, var(--celeste), var(--amarillo));
  transition: all 0.25s ease;
}

nav.menu a:hover,
nav.menu a.activo {
  background: var(--verde);
  color: #fff;
}

/* ===== CATEGORÍAS ===== */
.foro-categorias {
  display: flex;
  justify-content: space-between;
  gap: 1em; /* Espacio entre los botones */
  margin-bottom: 2em;
  flex-wrap: wrap;
  justify-content: center;
}

.foro-categorias button {
  padding: 0.6em 1em; /* Hacer los botones más anchos */
  font-size: var(--font-size-large);/* Aumentar el tamaño de la fuente */
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: #4CAF50;
  color: white;
  transition: background-color 0.3s;
  min-width: 90px; /* Establecer un tamaño mínimo para los botones */
  text-align: center; /* Asegura que el texto se mantenga centrado */
}

/* Aseguramos que el espacio entre los botones se mantenga en pantallas pequeñas */
.foro-categorias button:hover {
  background-color: #79ff80;
}

.foro-categorias button.activo {
  background-color: #ffeb39; /* Color para el botón activo */
  font-weight: bold; /* Destacar el botón seleccionado */
}

#forum {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
}

.post {
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 1.2em;
  background-color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.post-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
}

.post-header .username {
  font-weight: bold;
}

.post-header .date {
  margin-left: auto;
  font-size: 0.9rem;
  color: #888;
}

.post p {
  margin: 1em 0;
}

.post img {
  width: 100%;
  max-width: 100%;
  border-radius: 5px;
  margin-top: 1em;
}

.post-footer {
  display: flex;
  justify-content: flex-start;
  gap: 1em;
  margin-top: 1em;
}

.post-footer button {
  padding: 0.8em 1.5em;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: #f44336;
  color: white;
  transition: background-color 0.3s;
}

.post-footer button:hover {
  background-color: #e53935;
}

/* ===== RESPONDER A UN POST ===== */
.reply-form {
  margin-top: 1.5em;
  padding: 1em;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
}

.reply-form input, .reply-form textarea {
  width: 100%;
  padding: 10px;
  margin: 0.5em 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
}

.reply-form button {
  padding: 0.8em 1.5em;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.reply-form button:hover {
  background-color: #45a049;
}

/* ===== NUEVO POST ===== */
.new-post {
  margin-top: 2em;
  padding: 1.5em;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.new-post input, .new-post textarea {
  display: block;
  width: 100%;
  margin-bottom: 1em;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 1rem;
}

.new-post button {
  padding: 0.8em 2em;
  border: none;
  border-radius: 5px;
  background-color: #4CAF50;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

.new-post button:hover {
  background-color: #45a049;
}

footer {
  background: var(--celeste);
  color: #000;
  font-size: 0.9rem;
  text-align: center;
  padding: 2em;
  line-height: 1.4em;
}

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

  nav.menu {
    display: none;
    flex-direction: column;
    background: white;
    padding: 15px;
    position: absolute;
    top: 55px;
    left: 0;
    width: 100%;
    z-index: 10;
  }

  nav.menu.active {
    display: flex;
  }

  nav.menu a {
    font-size: 1.2em;
    margin: 8px 0;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .foro-categorias {
    flex-direction: column;
    gap: 1em; /* Leve espacio entre los botones cuando están apilados */
  }

  .foro-categorias button {
    width: 100%; /* Los botones ocuparán todo el ancho del contenedor */
    padding: 1em; /* Hacer los botones más grandes y cómodos */
    font-size: 1.2rem; /* Aumentar el tamaño de la fuente para mejor visibilidad */
  }
}

  .post {
    padding: 1em;
}

@media (min-width: 601px) and (max-width: 1024px) {
  .foro-categorias {
    justify-content: space-evenly;
  }

  .foro-categorias button {
    padding: 0.8em 1.6em;
    font-size: 1rem;
  }

  .post {
    padding: 1.5em;
  }

  h2 {
    font-size: 1.4em;
  }

  main {
    padding: 2em;
  }
}

@media (min-width: 1025px) {
  main {
    max-width: 1200px;
    padding: 3em;
  }

  .foro-categorias {
    justify-content: center;
    gap: 2em;
  }

  .foro-categorias button {
    padding: 0.4em 0.8em;
    font-size: var(--font-size-large);
    min-width: 100px;
  }

  .post {
    padding: 2em;
    font-size: 1.2rem;
  }
}