@import url(color-palette.css);

/* Universal Box Sizing */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--light-blue-200);
  font-family: 'Roboto', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Ensure body takes at least full viewport height */
}

header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header img {
  padding-left: 1rem;
  padding-top: 1rem;
}

button {
  width: 20rem;
  height: 4.375rem;
  border-radius: 1.5rem;
  padding: 1.5rem;
  text-align: center;
  font-size: 1rem;
  border: 0.0625rem solid var(--dark-blue-300);
  font-family: inherit;
  transition: 0.2s;
}

button:hover {
  cursor: pointer;
  transition: 0.2s;
}

/*Contenedor principal*/
.main-conteiner {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  flex-grow: 1; /* Allows it to take available space */
  display: flex;
  justify-content: space-between;
  padding: 1rem 1rem 2rem 3rem; /* 40px = 2.5rem, 270px = 16.875rem */
  gap: 2rem; /* Added gap between left and right containers */
}

/*Aside izquierdo*/
.left-conteiner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1; /* Allows left container to grow */
  max-width: 60%; /* Limit left container width */
}

/*Contenedor del logo*/
header {
  height: 4rem; /* 48px */
  width: 100%;
  padding: 1rem 0; /* Adjust padding */
  box-sizing: border-box;
}

/*Area para ingresar texto*/
#text-box {
  resize: none;
  width: 100%; /* Make it responsive */
  max-width: 37.5rem; /* 600px */
  height: 18.75rem; /* 300px */
  color: var(--dark-blue-300);
  line-height: 1.5;
  font-size: 2rem; /* 32px */
  font-family: inherit;
  background-color: var(--light-blue-200);
  text-align: left;
  border: none;
}

#text-box:hover {
  cursor: pointer;
}

#text-box:focus {
  outline-style: solid;
  outline-color: var(--light-blue-200);
  outline-width: 0.125rem; /* Add a subtle outline */
}

#text-box::placeholder {
  color: var(--dark-blue-300);
  opacity: 0.8;
}

/*Contenedores para botones de enciptar y desencriptar*/
.conteiner-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/*Icono de signo de explamación y su caption*/
.figure-exclamation-circle {
  display: flex;
  align-items: center; /* Vertically align icon and text */
  gap: 0.5rem;
  width: 100%; /* Make it responsive */
  max-width: 18.75rem;
  margin-bottom: 1rem; /* Add some space below */
}

.figure-exclamation-circle figcaption {
  color: var(--grey-400);
  font-family: inherit;
  font-size: 0.875rem; /* Adjusted font size */
}

/*Botones de enciptar y desencriptar*/
.conteiner-btns {
  width: 100%;
  max-width: 41.875rem; /* 670px */
  height: auto; /* Allow height to adjust */
  display: flex;
  align-items: center;
  justify-content: left;
  gap: 1.5rem;
  padding-bottom: 1.375rem;
  flex-wrap: wrap; /* Allow buttons to wrap */
}

.btn1 {
  color: white;
  background-color: var(--dark-blue-300);
}

.btn1:hover {
  background-color: var(--dark-blue-400);
}

.btn1:active {
  background-color: var(--dark-blue-500);
  transform: scale(1.02); /* Use transform for smooth scaling */
}

.btn2,
.copy-btn {
  color: var(--dark-blue-300);
  background-color: transparent;
}

.btn2:hover {
  background-color: var(--light-blue-300);
}

.btn2:active {
  background-color: var(--light-blue-400);
  transform: scale(1.02);
}

.clean-btn {
  background-color: var(--light-blue-200);
  color: var(--dark-blue-300);
}

.clean-btn:hover {
  background-color: var(--light-blue-300);
}

.clean-btn:active {
  background-color: var(--light-blue-400);
  transform: scale(1.02);
}

.copy-btn:hover {
  background-color: var(--light-blue-200);
}

.copy-btn:active {
  background-color: var(--light-blue-300);
  transform: scale(1.02);
}

/*Aside derecho*/
.right-conteiner {
  box-sizing: border-box;
  background-color: white;
  width: 25rem; /* 400px */
  min-width: 20rem; /* Minimum width for smaller screens */
  height: 80vh;
  border-radius: 1.875rem;
  padding: 1rem;
  margin: 0;
  transition: 0.2s;
  box-shadow: 0 1.5rem 2rem -0.5rem rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center; /* Center text within this container */
}

/*While there is no message*/
/*Main image*/
.right-conteiner .dibujo {
  box-sizing: border-box;
  text-align: center;
  font-family: inherit;
  padding: 32px;
}

.right-conteiner .dibujo img {
  width: 330px;
  height: 300px;
  max-width: 100%; /* Make image responsive */
  height: auto; /* Maintain aspect ratio */
}

.right-conteiner .dibujo b {
  font-weight: bold;
  font-size: 1.5rem; /* 24px */
  line-height: 1.25; /* 30px */
  margin-bottom: 1rem; /* Space below bold text */
  display: block; /* Make it a block element to apply margin */
}

.right-conteiner .dibujo p {
  line-height: 1.5; /* 24px */
  font-size: 1rem; /* 16px */
  color: var(--grey-400);
}

/*While there is a message*/
/*Decrypted message*/
#message-des {
  color: var(--grey-400);
  text-align: left;
  font-size: 1.5rem;
  display: block;
  line-height: 1.5;
  padding: 1rem; /* Add padding for text */
  word-wrap: break-word; /* Ensure long words break */
  white-space: pre-wrap; /* Preserve whitespace and wrap text */
  flex-grow: 1; /* Allow message to take space */
}

/*Button to copy text*/
.copy-btn {
  display: none; /* Initially hidden */
  width: 100%;
  max-width: 20rem; /* Limit copy button width */
  margin-top: 1rem; /* Space above copy button */
}

/* Ensure figure.dibujo is shown initially */
.right-conteiner figure.dibujo {
  display: block;
}

/* Mobile View */
@media only screen and (max-width: 640px) {
  body {
    padding: 0 1rem; /* Add horizontal padding to body */
  }

  .main-conteiner {
    flex-direction: column;
    padding: 1rem 0; /* Adjust padding for mobile */
    height: auto; /* Allow height to adjust based on content */
    align-items: center; /* Center content horizontally */
    gap: 1.5rem; /* Adjust gap */
  }

  .left-conteiner {
    width: 100%; /* Take full width */
    max-width: none; /* Remove max-width restriction */
    padding: 0 0.5rem; /* Add some padding */
  }

  header {
    width: auto; /* Auto width */
    padding: 0.5rem 0; /* Adjust padding */
    text-align: left;
  }

  #text-box {
    width: 100%; /* Full width on mobile */
    max-width: none;
    height: 12.5rem; /* Adjust height for mobile */
    font-size: 1.5rem; /* Smaller font size for mobile */
  }

  .figure-exclamation-circle {
    width: 100%;
    justify-content: center; /* Center icon and caption */
    font-size: 0.75rem;
  }

  .conteiner-btns {
    flex-direction: column; /* Stack buttons vertically */
    width: 100%;
    max-width: none;
    padding-bottom: 0; /* Remove bottom padding */
    align-items: center; /* Center buttons horizontally */
    gap: 1rem; /* Adjust gap between stacked buttons */
  }

  button {
    width: 100%; /* Full width for buttons on mobile */
    height: 3.5rem; /* Adjust button height */
    padding: 0.8rem; /* Adjust padding */
    font-size: 1rem; /* Adjust font size */
  }

  .right-conteiner {
    width: 100%; /* Full width on mobile */
    height: auto; /* Auto height for content */
    min-height: 10rem; /* Minimum height for the right container */
    padding: 1rem;
    margin-top: 1rem; /* Space from elements above */
  }

  .right-conteiner .dibujo {
    padding: 1rem; /* Adjusted padding */
  }

  .right-conteiner .dibujo img {
    display: none; /* Hide image on mobile */
  }

  .right-conteiner .dibujo b {
    font-size: 1.25rem; /* Smaller font size */
    line-height: 1.3;
  }

  .right-conteiner .dibujo p {
    font-size: 0.875rem; /* Smaller font size */
    line-height: 1.4;
  }

  #message-des {
    font-size: 1.2rem; /* Adjusted font size for mobile */
    text-align: center; /* Center text when displayed */
    padding: 0.5rem; /* Adjust padding */
  }

  .copy-btn {
    width: 100%; /* Full width for copy button */
    height: 3.5rem; /* Adjust height */
    margin: 1rem auto 0 auto; /* Center button with margin */
    font-size: 1rem; /* Adjust font size */
  }
}
