/* Estilos para el header y nav */
header {
  background-color: var(--header-bg);
  padding: 1rem 2rem;
  box-shadow: 0 2px 5px var(--shadow-color);
  position: relative;
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

nav ul {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

nav ul li {
  margin: 0 1rem;
}

nav ul li a {
  color: var(--header-text);
  font-family: 'Arial', sans-serif;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease, background-color 0.3s ease;
}

nav ul li a:hover {
  color: var(--link-color);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

/* Estilo para el botón de cambio de tema */
#theme-toggle {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.5rem;
  font-size: 1.2rem;
  background-color: var(--link-color);
  color: var(--header-text);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

#theme-toggle:hover {
  background-color: var(--link-hover);
}

/* Media query para responsividad del navbar */
@media (max-width: 768px) {
  header {
      padding: 0.5rem;
  }

  nav {
      justify-content: flex-start;
      flex-wrap: nowrap;
      width: 100%;
      padding: 0 0.5rem;
  }

  nav ul {
      justify-content: space-around;
      margin: 0 0 0 2.5rem;
      width: calc(100% - 2.5rem);
      padding: 0;
  }

  nav ul li {
      margin: 0 0.25rem;
  }

  nav ul li a {
      font-size: 0.8rem;
      padding: 0.3rem 0.5rem;
  }

  #theme-toggle {
      position: absolute;
      left: 0.5rem;
      width: 30px;
      height: 30px;
      font-size: 1rem;
      padding: 0.3rem;
  }
}

/* Estilos para el main */
main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

main h1 {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 2rem;
  text-align: center;
}

article {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

article h2 {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Estilos para redes sociales */
.social-links {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
}

.social-links ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-links li a {
  font-size: 1.2rem;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  transition: color 0.3s ease, background-color 0.3s ease;
  display: block;
}

.social-links li a:hover {
  color: var(--link-color);
  background-color: rgba(0, 180, 216, 0.1);
  border-radius: 5px;
}

/* Estilos para el formulario */
.contact-form {
  flex: 2;
  min-width: 300px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

input[type="email"] {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--text-tertiary);
  border-radius: 5px;
  max-width: 50%;
  box-sizing: border-box;
  background-color: var(--section-bg);
  color: var(--text-primary);
}

input[type="text"],
textarea {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--text-tertiary);
  border-radius: 5px;
  width: 100%;
  box-sizing: border-box;
  background-color: var(--section-bg);
  color: var(--text-primary);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

button {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  color: var(--header-text);
  background-color: var(--link-color);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  align-self: flex-start;
}

button:hover {
  background-color: var(--link-hover);
}

/* Responsividad */
@media (max-width: 768px) {
  article {
      flex-direction: column;
      align-items: center;
  }

  .social-links {
      text-align: center;
  }

  .social-links ul {
      flex-direction: column;
      align-items: center;
      gap: 1rem;
  }

  .contact-form {
      width: 100%;
  }

  input[type="email"] {
      max-width: 100%;
  }

  button {
      align-self: center;
  }
}

/* Contenedor para el botón y el spinner */
.button-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Estilo para el spinner */
.spinner {
  width: 30px;
  height: 30px;
  border: 4px solid #ccc;
  border-top: 4px solid var(--link-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Animación de giro */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}