/* General Reset y Fuentes | General Reset and Fonts */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: inherit;
}

html {
  font-family: 'Montserrat', sans-serif; /* Fuente base del sitio */
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif; /* Fuente principal para el contenido */
  background-color: var(--background);
  color: var(--text);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- MODO CLARO (Predeterminado) | LIGHT MODE (Default) --- */
:root {
  --background: #e8f0fe;
  --text: #1c1c1c;
  --button-bg: #5c7cfa;
  --button-text: #fff;
  --button-hover: #4c6ef5;
  --textarea-bg: #ffffff;
  --textarea-border: #b0c4de;
  --card-bg: #ffffff;
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* --- Modo Oscuro | Dark Mode --- */
:root.dark-theme {
  --background: #1f1f2e;
  --text: #eaeaea;
  --button-bg: #3b3f5c;
  --button-text: #ffffff;
  --button-hover: #2f324a;
  --textarea-bg: #2a2a3d;
  --textarea-border: #555;
  --card-bg: #24243a;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Header Con BotóN De Cambio De Tema | Header With Theme Toggle Button */
header {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  padding: 1rem 2rem 0 2rem;
}

.theme-toggle {
  padding: 0.5rem 1rem;
  background-color: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.theme-toggle:hover {
  background-color: var(--button-hover);
}

/* Main - Contenedor Principal Centrado | Main - Centered Container */
main.container {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4vh;
  padding-bottom: 4vh;
}

/* SeccióN De TransformacióN De Texto | Section For Text Transformation */
.text-transformer {
  width: 100%;
  max-width: 700px;
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

.text-transformer h1 {
  font-size: 2rem;
  text-align: center;
}

textarea {
  width: 100%;
  height: 200px;
  padding: 1rem;
  font-size: 1rem;
  border: 1px solid var(--textarea-border);
  border-radius: 10px;
  background-color: var(--textarea-bg);
  color: var(--text);
  resize: vertical;
}

/* Botones De AccióN | Action Buttons */
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.buttons button {
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  background-color: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.buttons button:hover {
  background-color: var(--button-hover);
}

/* Notificaciones Toast (Mensajes Temporales)  | Toast Notifications (Temporary Messages) */
#toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.toast {
  background-color: #323232;
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  animation: fadeInOut 3s ease forwards;
}

.toast.error {
  background-color: #d32f2f;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  10%, 90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* DiseñO Responsivo | Responsive Design */

/* --- Para pantallas pequeñas (móviles) | For small screens (mobile) --- */
@media (max-width: 480px) {
  .text-transformer {
    padding: 1.5rem 1rem;
  }

  .buttons {
    flex-direction: column;
    width: 100%;
  }

  .buttons button {
    width: 100%;
  }

  header {
    padding: 1rem;
  }
}

/* --- Para pantallas medianas (tabletas) | For medium screens (tablets) --- */
@media (min-width: 481px) and (max-width: 768px) {
  main.container {
    padding: 2rem 1.5rem;
  }

  .buttons {
    justify-content: center;
  }
}
