@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Press+Start+2P&family=Silkscreen:wght@400;700&display=swap");

html,
body {
  min-height: 100vh;
  position: relative;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "IBM Plex Mono", monospace;
  background-color: #fff;
  color: #000;
  flex: 1;
}

body h1 {
  font-size: 24px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #5300c8;
  padding: 20px;
  gap: 10px;
}

header img {
  margin-right: 10px;
  width: 130px;
}

header h1 {
  color: white;
  font-size: 24px;
}

h1 {
  font-family: "Press Start 2P", cursive;
  text-align: center;
}

/* Main */
main {
  flex: 1;
  display: flex;
  justify-content: space-around;
  margin: 100px;
}

.products,
.add-product {
  background: #fff;
  padding: 20px;
}

.products {
  width: 710px;
  height: 971px;
  overflow-y: auto;
  box-shadow: 10px 10px 0 0 rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  border: solid 3px black;
}

.products::-webkit-scrollbar {
  width: 8px;
}

.products::-webkit-scrollbar-thumb {
  background-color: #d6d6d6;
  border-radius: 10px;
}

.products::-webkit-scrollbar-button {
  display: none;
}

.product-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #5300c8;
  color: white;
  box-shadow: 10px 10px 0 0 rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  border: solid 3px black;
  width: 196px;
  height: 258px;
  text-align: start;
  overflow: hidden;
  align-items: center;
}

.card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.card .card-header h5 {
  height: 30px;
  padding: 5px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 0;
}

.card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 5px;
  height: 30px;
}

.card img {
  object-fit: cover;
  border: solid 4px black;
  border-radius: 8px;
}

.card-footer img.trash-icon {
  width: 20px;
  height: auto;
  cursor: pointer;
  border: none;
}

.add-product {
  width: 20%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.add-product h1 {
  display: flex;
  align-items: center;
  text-align: center;
}

.add-product form {
  padding: 20px;
}

.add-product input {
  display: block;
  width: 350px;
  height: 30px;
  padding: 10px;
  margin-bottom: 30px;
  border: 3px solid #03318c;
  border-radius: 50px;
}

.buttons {
  display: flex;
  justify-content: space-between;
}

.submit-btn {
  background: #03318c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  width: 160px;
  height: 50px;
  font-size: 18px;
  box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.5);
}

.reset-btn {
  background: white;
  color: #03318c;
  border: 3px solid #03318c;
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  width: 160px;
  height: 50px;
  font-size: 18px;
  box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.5);
}

/* Footer */
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #5300c8;
  color: white;
  padding: 20px;
  width: 100%;
}

a {
  text-decoration: none;
  color: black;
}

footer h1 {
  font-size: 24px;
}

footer img {
  width: 138px;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* Responsividad móviles */
@media (max-width: 768px) {
  html,
  body {
    flex-direction: column;
    align-items: center;
  }

  header {
    width: 100%;
    align-items: center;
    justify-content: center;
    display: flex;
    max-width: 100%;
    flex-shrink: 0;
  }

  main {
    flex-direction: column;
    align-items: center;
    margin: 10px;
    gap: 100px;
  }

  .buttons {
    align-items: center;
  }

  .add-product {
    width: 90%;
    margin-bottom: 20px;
    order: 1;
  }

  .products {
    width: 90%;
    height: 550px;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-top: 50px;
  }

  .space {
    order: 2;
  }

  .product-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-flow: column;
    grid-template-rows: repeat(2, auto);
    gap: 20px;
    width: 560px;
    max-width: 560px;
  }

  .products::-webkit-scrollbar {
    height: 8px;
  }

  .products::-webkit-scrollbar-thumb {
    background-color: #d6d6d6;
    border-radius: 10px;
  }

  footer {
    position: relative;
    bottom: 0;
    height: auto;
    margin-top: 40px;
  }
}

/* Estilos para los modales */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
  position: relative;
}

.modal-content.add-product {
  background-color: #e5e5e5;
  padding: 32px;
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 20px;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* Estilos para los botones de acción */
.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.action-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  transition: color 0.3s ease;
}

.edit-button {
  color: #2a7ae4;
}

.delete-button {
  color: #e53935;
}

.action-button:hover {
  opacity: 0.8;
}

/* Estilos para los botones del modal */
.modal-content .buttons {
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin-top: 16px;
  justify-content: space-between;
}

.modal-content .buttons button {
  flex: 1;
}

.cancel-btn {
  background: white;
  color: #03318c;
  border: 3px solid #03318c;
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  width: 160px;
  height: 50px;
  font-size: 18px;
  box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.5);
}

.cancel-btn:hover {
  background-color: #f5f5f5;
}

#confirm-delete {
  background: #e53935;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  width: 160px;
  height: 50px;
  font-size: 18px;
  box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.5);
}

#confirm-delete:hover {
  background-color: #c62828;
}
