/* VARIABLES GLOBALES */
:root {
  --bg-color: #faf8f8e0;
  --card-bg: #ffffff;
  --primary-color: #55aff8fb;
  --hover-color: #479edc;
  --text-color: #333;
  --border-color: #e0e0e0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --section-separator: #dddddd;
}

/* RESET Y TIPOGRAFÍA */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-bottom: 30px;

}

/* FORMULARIO */
form {
  background-color: var(--card-bg);
  padding: 40px 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 500px;
  margin: 30px auto;
  transition: all 0.3s ease;
}

h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 24px;
  color: var(--primary-color);
}

input[type="text"],
input[type="number"],
input[type="file"],
select {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 15px;
  background: #fff;
  transition: all 0.3s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px #55aff872;
}

/* BOTÓN */
button {
  width: 100%;
  padding: 14px;
  background-color: var(--primary-color);
  color: white;
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.3s ease, transform 0.2s;
}

button:hover {
  background-color: var(--hover-color);
  transform: translateY(-1px);
}

/* SPINNER */
#spinner {
  display: none;
  font-size: 2rem;
  animation: spin 1.2s infinite linear;
  text-align: center;
  margin-top: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* VISTA PREVIA DE IMÁGENES */
#imagePreview {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-container {
  position: relative;
}

.preview-container img {
  max-width: 90px;
  max-height: 90px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.remove-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  background: red;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  padding: 0;
}

/* NAVBAR */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 10px;
  background-color: #1c1c1e;
  position: relative;
  flex-wrap: wrap;
}

.navbar-center {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding-top: 18px;
}

.menu-icon {
  font-size: 28px;
  border: none;
  background: transparent;
  color: var(--primary-color);
  cursor: pointer;
}

.imagen {
  width: 120px;
  height: auto;
  padding-bottom: 10px;
  padding-top: 3px;
}

/* FILTROS */
.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 30px 20px;
  border-bottom: 1px solid var(--section-separator);
  animation: fadeIn 0.6s ease;
}

.filtros input,
.filtros select {
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-size: 14px;
  background-color: white;
  transition: box-shadow 0.3s ease;
}

.filtros input:focus,
.filtros select:focus {
  box-shadow: 0 0 5px var(--primary-color);
  outline: none;
}

.filtros input {
  width: 250px;
}

.filtros select {
  width: 150px;
}

/* MENU LATERAL */
.side-menu {
  position: fixed;
  top: 0;
  left: -250px;
  width: 250px;
  height: 100%;
  background-color: #262626;
  color: white;
  padding-top: 2rem;
  transition: left 0.3s ease;
  z-index: 1000;
}

.side-menu.open { left: 0; }
.side-menu ul { list-style: none; padding: 0; }
.side-menu ul li { padding: 1rem; }
.side-menu ul li a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
}
.side-menu ul li:hover { background-color: #333; }
.side-menu a.active {
  background-color: #444;
  font-weight: bold;
  border-left: 5px solid var(--primary-color);
}

.rede { height: 1.8em; vertical-align: middle; }
.redee { height: 2.2em; background-color: #c0392b; border-radius: 5px; }

/* LIGHTBOX */
.lightbox, .lightbox img {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px #000;
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
}

/* BOTÓN FLOTANTE */
.btn-flotante {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #56bafd;
  color: white;
  font-size: 28px;
  padding: 14px 18px;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 999;
  transition: background-color 0.3s ease;
}

.btn-flotante:hover {
  background-color: #090909;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  body {
    padding: 0 12px 20px;
  }

  form {
    padding: 25px 20px;
    margin-top: 20px;
  }

  h2 {
    font-size: 20px;
  }

  input[type="text"],
  input[type="number"],
  input[type="file"],
  select {
    font-size: 16px;
    padding: 12px;
  }

  button {
    font-size: 16px;
  }

  .preview-container img {
    max-width: 70px;
    max-height: 70px;
  }

  .remove-btn {
    width: 18px;
    height: 18px;
    font-size: 12px;
  }
}
