/* Reset y estilos base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background: #f0f2f5;
  color: #333;
  padding: 1rem;
}

/* Google Font para el chat (estilo Bob Esponja) */
#chat {
  font-family: 'Fredoka One', cursive;
}

/* Animaciones */
.animated {
  animation-duration: 0.6s;
  animation-fill-mode: both;
}

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

.fadeIn {
  animation-name: fadeIn;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Tarjetas y contenedores */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
}

/* Cabecera */
header {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: pulse 2s infinite;
}

.header-left {
  display: flex;
  align-items: center;
}

.app-logo {
  width: 50px;
  height: auto;
  margin-right: 10px;
  border-radius: 16px;
}

.header-buttons button {
  margin-left: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: #0056b3;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.header-buttons button:hover {
  background: #003f7f;
  transform: scale(1.05);
}

/* Formularios de autenticación */
#auth-section {
  max-width: 400px;
  margin: 2rem auto;
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#auth-section h2 {
  text-align: center;
  margin-bottom: 1rem;
}

#auth-section form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#auth-section input[type="email"],
#auth-section input[type="password"],
#auth-section input[type="text"],
#auth-section input[type="file"] {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#auth-section button {
  padding: 0.75rem;
  font-size: 1rem;
  color: #fff;
  background: #007bff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#auth-section button:hover {
  background: #0056b3;
}

/* Sección principal de la app */
#app-section {
  max-width: 800px;
  margin: 0 auto;
}

/* Chat de respuestas estilo Bob Esponja */
#chat {
  background: #ffeb3b;
  border: 2px solid #fbc02d;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#chat-history {
  max-height: 300px;
  overflow-y: auto;
  border: 1px dashed #f57f17;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 5px;
  background: #fffde7;
}

.message {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px dashed #f57f17;
  opacity: 0;
  transform: translateX(-20px);
  animation: slideIn 0.4s forwards;
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.message-header span {
  font-size: 0.9rem;
  color: #333;
}

.message-body {
  font-size: 1.1rem;
}

.chat-profile {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #d32f2f;
}

/* Formulario de mensaje */
#message-form {
  display: flex;
  gap: 0.5rem;
}

#message-input {
  flex: 1;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#message-form button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#message-form button:hover {
  background: #0056b3;
}

/* Temporizador */
#timer {
  margin-top: 0.5rem;
  font-size: 1rem;
  text-align: center;
  animation: pulse 1.5s infinite;
}

/* Estilos para la votación */
#voting-container {
  margin-top: 1rem;
  padding: 1rem;
  border: 2px solid #4caf50;
  border-radius: 8px;
  background: linear-gradient(135deg, #a8e063, #56ab2f);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.voting-user {
  display: inline-block;
  margin: 0.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  transition: transform 0.3s ease;
  background: rgba(255,255,255,0.2);
}

.voting-user:hover {
  transform: scale(1.05);
}

.vote-button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.vote-button span {
  margin-left: 0.5rem;
}
.candidate-photo {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 5px;
  vertical-align: middle;
}

.user-photo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}

/* Resultados de votación */
.result-item {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 5px;
}

.result-text {
  font-size: 1rem;
}

/* Votantes */
.voter-photos {
  display: flex;
  gap: 0.3rem;
  margin-top: 5px;
}

.voter-photo {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #fff;
}

/* Historial */
#history-section {
  max-width: 800px;
  margin: 1rem auto;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.history-item {
  margin-bottom: 1rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.history-toggle {
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: #1976d2;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.history-toggle:hover {
  background: #1565c0;
}

.history-messages {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f9f9f9;
}

.history-message {
  margin-bottom: 0.5rem;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 0.3rem;
}

/* Modal de Configuración de Cuenta */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: none; /* Se mostrará con display:flex vía JS */
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: fadeIn 0.5s;
}

.close-modal {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #333;
}

/* Estilos para la Configuración de Cuenta */
.settings-container {
  margin-top: 1rem;
}

.settings-section {
  margin-bottom: 1rem;
}

.settings-section h3 {
  margin-bottom: 0.5rem;
  color: #007bff;
}

.settings-section label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.settings-section input[type="text"],
.settings-section input[type="file"] {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.settings-save-btn {
  padding: 0.6rem;
  width: 100%;
  background: #28a745;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.settings-save-btn:hover {
  background: #218838;
}

/* Estilo modernizado para "Pregunta del Día" */
#daily-question {
  background: linear-gradient(135deg, #ff9a9e, #fad0c4);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  animation: slideInFromLeft 0.8s ease-out;
}

@keyframes slideInFromLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Confetti */
.confetti-piece {
  position: fixed;
  top: -10px;
  width: 10px;
  height: 10px;
  opacity: 0.8;
  animation-name: confetti-fall;
  animation-timing-function: ease-out;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Estilo para imágenes en el chat */
.chat-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 5px;
}

#logoutBtn {
  background: #ff5a81;
}
#settingsBtn {
  background: #4caf50;
}
#historyBtn {
  background: #2196f3;
}