/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #5a4b3c;
}

/* Fondo general: muy claro, con suaves degradados y sensación de luz */
body {
  background: linear-gradient(135deg, #fff9f0 0%, #fff2e6 100%);
  min-height: 100vh;
  display: flex;
  color: #6b543f;
}

/* Sidebar: fondo blanco translúcido con sombras suaves */
.sidebar {
  width: 240px;
  background: rgba(255 250 240 / 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 30px rgb(255 250 240 / 0.3);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  border-radius: 0 20px 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

/* Títulos sidebar */
.sidebar h2 {
  font-weight: 700;
  font-size: 1.8rem;
  color: #b88a31; /* dorado oscuro */
  text-align: center;
  margin-bottom: 1rem;
}

/* Enlaces del menú con transiciones y hover */
.sidebar a {
  color: #8c6b28;
  font-weight: 600;
  text-decoration: none;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  transition: background-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 0 0 transparent;
}

.sidebar a:hover,
.sidebar a:focus {
  background-color: #f9eed5;
  color: #8c6b28;
  box-shadow: 0 4px 8px rgba(140, 107, 40, 0.3);
  outline: none;
}

/* Contenido principal */
main {
  flex-grow: 1;
  padding: 3rem 4rem;
  background: #fff9f0dd;
  border-radius: 0 0 0 30px;
  box-shadow: 4px 0 40px rgba(140, 107, 40, 0.05);
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 1rem auto 3rem auto;
}

/* Títulos */
h1, h2 {
  color: #b88a31;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

/* Párrafos con line-height relajado y color suave */
p {
  line-height: 1.8;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #7a6541;
}

/* Formulario con fondo blanco, bordes redondeados y sombra suave */
form {
  background: #fdf6e3;
  padding: 2rem 2.5rem;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgb(184 138 49 / 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Input file estilizado */
input[type="file"] {
  border: 2px dashed #b88a31;
  border-radius: 12px;
  padding: 1rem;
  font-size: 1rem;
  cursor: pointer;
  color: #8c6b28;
  background: #fff8e1dd;
  transition: background-color 0.3s ease;
  width: 100%;
  text-align: center;
}

input[type="file"]:hover,
input[type="file"]:focus {
  background: #fff3b0;
  outline: none;
}

/* Botón con colores suaves y sombra */
button {
  background-color: #b88a31;
  color: #fff9f0;
  border: none;
  padding: 0.9rem 2rem;
  font-size: 1.1rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 12px rgb(184 138 49 / 0.3);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  max-width: 250px;
}

button:hover,
button:focus {
  background-color: #8c6b28;
  box-shadow: 0 10px 20px rgb(140 107 40 / 0.5);
  outline: none;
}

/* Mensajes y resultados */
main pre {
  background: #fff8e1;
  border-radius: 15px;
  padding: 1.5rem;
  font-size: 1rem;
  font-family: 'Courier New', Courier, monospace;
  color: #8c6b28;
  box-shadow: inset 0 0 15px #f9eed5;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}

/* Overlay carga */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(255 255 240 / 0.85);
  color: #b88a31;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: wait;
}

body.waiting {
  cursor: wait !important;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    background: linear-gradient(180deg, #fff9f0 0%, #fff2e6 100%);
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-radius: 0 0 20px 20px;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
  }

  main {
    max-width: 100%;
    padding: 2rem 1rem;
    border-radius: 0;
    box-shadow: none;
  }

  form {
    max-width: 100%;
  }

  .sidebar a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}
