/* Animación de entrada */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* Cabecera */
.header {
  background: linear-gradient(90deg, #0e1e25, #23414d);
  padding: 2rem 1rem 3rem;
  color: #e0f7f4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Logo y texto alineados */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: #00b894;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 0 8px rgba(0, 184, 148, 0.3);
}

.logo-text {
  font-family: 'Poppins', sans-serif;
  color: #00e4b4;
  line-height: 1;
  transform: translateY(2px);
}

/* Botón idioma arriba a la derecha */
#langToggle {
  cursor: pointer;
  font-size: 1rem;
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 8px;
  background: transparent;
  color: #1de9b6;
  font-weight: 600;
  transition: all 0.3s ease;
}

#langToggle:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #1de9b6;
}

/* Subtítulo centrado debajo */
.header-subtitle {
  margin-top: 2rem;
  font-size: 1.15rem;
  font-weight: 400;
  color: #d0fdf6;
  text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* Contenedor principal */
.container {
  background: #ffffff;
  max-width: 640px;
  margin-top: 3rem;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

/* Formularios */
.formulario {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.campo label {
  font-weight: 600;
  margin-bottom: 0.6rem;
  display: block;
  font-size: 1.05rem;
  color: #222;
}

.campo select,
.campo textarea,
.campo input {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  border: 1px solid #cfd8dc;
  border-radius: 12px;
  background-color: #fdfefe;
  transition: 0.2s ease-in-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.campo select:focus,
.campo textarea:focus,
.campo input:focus {
  border-color: #00b894;
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.15);
  outline: none;
}

.formulario button[type="submit"] {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  padding: 14px 20px;
  background: linear-gradient(135deg, #00b894, #00cec9);
  color: white;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 184, 148, 0.25);
}

.formulario button[type="submit"]:hover {
  background: linear-gradient(135deg, #01a87b, #00b3b3);
}


.upgrade-block {
  margin-top: 2rem;
  background: #fff3f3;
  border: 1px solid #e74c3c;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
}


/* Caja de respuesta */
.respuesta {
  margin-top: 2rem;
  background: #f1fff9;
  border-left: 6px solid #00b894;
  color: #13433a;
  padding: 1.4rem;
  border-radius: 14px;
  white-space: pre-line;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  position: relative;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  color: #555;
  font-size: 1.1rem;
  animation: fadeIn 0.6s ease-out;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(0, 184, 148, 0.3);
  border-top: 4px solid #00b894;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* Botón copiar */
#copiarRespuesta {
  margin-top: 1.2rem;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: #00b894;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 184, 148, 0.2);
}

#copiarRespuesta:hover {
  background: #019170;
}

/* Login container */
#loginContainer {
  background: #fff;
  max-width: 420px;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  text-align: center;
}

.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem;
}

.auth-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.auth-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #333;
}

.auth-input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.auth-input:focus {
  outline: none;
  border-color: #007bff;
}

.auth-buttons {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-btn {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  background-color: #007bff;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

.auth-btn:hover {
  background-color: #0056b3;
}

.auth-btn.secondary {
  background-color: #6c757d;
}

.auth-btn.secondary:hover {
  background-color: #495057;
}

.auth-btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: white;
  border: 1px solid #ccc;
  color: #555;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.auth-btn-google:hover {
  background-color: #f5f5f5;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.auth-btn-google img {
  width: 20px;
  height: 20px;
}

.divider {
  margin: 1rem 0;
  font-weight: bold;
  color: #888;
}

/* Logout */
#logoutBtn {
  margin: 1rem auto 2rem;
  padding: 10px 20px;
  font-size: 1rem;
  background: #f2f2f2;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  transition: background 0.3s ease;
}

#logoutBtn:hover {
  background: #e0e0e0;
}

.logout-floating {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #fff;
  border: 2px solid #e74c3c;
  border-radius: 50%;
  padding: 0.8rem 1rem;
  font-size: 1.3rem;
  color: #e74c3c;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 1000;
  transition: background 0.3s;
}

.logout-floating:hover {
  background: #ffeaea;
}


/* Historial */
/* Historial profesionalizado */
.historial {
  margin-top: 2rem;
}

.historial-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.historial-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
}

.historial-titulo {
  flex: 1;
  text-align: center;
  color: #00b894;
}

.fecha-historial {
  font-size: 0.9rem;
  color: #999;
}

.contenido-historial {
  margin-top: 1rem;
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.contenido-historial.visible {
  display: block;
}

.btn-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-copiar {
  margin-top: 1rem;
  padding: 8px 14px;
  font-size: 0.95rem;
  background: #e0f8f3;
  color: #00b894;
  border: 2px solid #00b894;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s ease;
}

.btn-copiar:hover {
  background: #cdf5ea;
}



/* Panel PRO */
#adminPanel {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
  padding: 2rem;
  margin-top: 2rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  animation: fadeIn 0.6s ease-out;
}

#adminPanel h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #00b894;
  text-align: center;
  position: relative;
}

#adminPanel h2::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 3px;
  background-color: #00b894;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px;
}

.metricas-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.metrica-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0fef9;
  padding: 1rem 1.5rem;
  border-left: 5px solid #00b894;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.metrica-box span {
  font-weight: 600;
  font-size: 1rem;
  color: #333;
}

.metrica-box small {
  color: #666;
  font-size: 0.95rem;
}



/* Footer */
.footer {
  text-align: center;
  font-size: 0.9rem;
  padding: 2rem 1rem;
  color: #777;
}

.pro-status {
  padding: 1rem;
  border-radius: 12px;
  background: #e8fdf6;
  color: #0ab68b;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
  border: 2px solid #0ab68b;
}

.feedback-success {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #0ab68b;
  color: white;
  font-weight: bold;
  padding: 14px 24px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  font-size: 1rem;
  opacity: 0;
  z-index: 9999;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.feedback-success.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-copy {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #00b894;
  color: white;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  opacity: 0;
  z-index: 9999;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-copy.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pro-title {
  color: #0ab68b;
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.pro-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #0ab68b;
  margin: 0.5rem auto 0;
  border-radius: 5px;
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: #e6fdf5;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.metric-icon {
  font-size: 1.3rem;
}

.metric-text {
  font-size: 1rem;
  color: #333;
}

  .btn-pro {
    background-color: #0ab68b;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
  }
  .btn-pro:hover {
    background-color: #089d76;
  }




/* Responsive */
@media (max-width: 600px) {
  .container,
  #loginContainer {
    margin: 1rem;
    padding: 1.5rem;
  }

  .header-subtitle {
    margin-top: 1.5rem;
    font-size: 1rem;
  }

  header h1 {
    font-size: 1.8rem;
  }

  header p {
    font-size: 1rem;
  }

  #langToggle {
    font-size: 0.9rem;
    top: 1rem;
    right: 1rem;
  }
}



