@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body, html { width: 100%; height: 100%; font-family: 'Poppins', sans-serif; overflow: hidden; background: #000; }

/* Header superior izquierdo */
.page-header {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 12px;
  background: transparent;
  z-index: 1000;
  height: 40px; /* altura fija para alinear con top-bar */
}

.page-icon {
  width: 32px;
  height: 32px;
}

.page-title {
  font-size: 1.5em;
  line-height: 1;
}

/* Barra superior derecha */
.top-bar {
  position: fixed; /* mismo top que header para alinear */
  top: 20px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  height: 40px; /* misma altura que header */
}

/* Botones de top-bar: Telegram y Settings */
.telegram-btn,
#settings-btn {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent; 
  border: none;
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  padding: 10px;           /* del CSS antiguo */
}

.telegram-btn img {
  width: 24px;
  height: 24px;
}

.telegram-btn:hover,
#settings-btn:hover {
  transform: scale(1.1);
  /*background: rgba(255,255,255,0.25);
  box-shadow: 0 4px 10px rgba(0,0,0,0.6);*/
}

/* FAB (botón flotante) */
.fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: transparent;
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: 0.3s;
  z-index: 1000;
}
.fab:hover {
   transform: scale(1.1);
}

/* Ventana del chat */
#liveChat {
  position: fixed;
  bottom: 60px;
  right: 20px;
  width: 320px;
  height: 420px; 
  backdrop-filter: blur(14px);
  background: rgba(20,20,30,0.9);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: "Segoe UI", sans-serif;
  transition: all 0.3s ease;
}
#liveChat.hidden { display: none; }

.hidden {
  display: none !important;
}

#chatHeader {
  background: rgba(80, 50, 200, 0.8);
  padding: 6px 10px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0; /* siempre visible */
}
#chatHeader button {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

/* Contenedor de mensajes */
#messages {
  flex: 1; /* ocupa todo el espacio disponible */
  padding: 6px 10px;
  overflow-y: auto;
  font-size: 13px;
}

/* Mensajes individuales */
.chat-message {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.chat-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}
.chat-user { color: #ffb400; font-weight: bold; }
.chat-time { color: rgba(255,255,255,0.6); font-size: 11px; }
.chat-body { color: #fff; font-size: 13px; white-space: pre-wrap; }

/* Controles de input */
#chatInputs {
  padding: 6px 10px;
  background: rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0; /* siempre visible */
}
#chatInputs input[type="text"] {
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  font-size: 13px;
  width: 100%;
  background-color: #222;
  color: #fff;
}
#chatInputs button {
  background: #4b27ff;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

/* Bienvenida */
#chatWelcome {
  flex: 1; /* ocupa el espacio total cuando se muestra */
  text-align: center;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
#chatWelcome input {
  padding: 8px;
  border-radius: 8px;
  border: none;
  text-align: center;
  background-color: #222;
  color: #fff;
}
#chatWelcome button {
  background: #4b27ff;
  color: white;
  border: none;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}


.page-icon { width:32px; height:32px; border-radius:6px; object-fit:cover; }
.page-title { font-family:'Poppins',sans-serif; font-weight:600; font-size:1.2rem; color:#fff; text-transform:lowercase; }

/* Hero + overlay */
.hero { position: relative; min-height: 100vh; width: 100%; background-image: url(bg2.gif); background-position: center; background-repeat: no-repeat; background-size: cover; transition: background-image 0.4s ease-in-out; color: #fff; }
.overlay { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.55); z-index:0; }

/* Main content */
.main-content { display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; z-index:2; height:calc(100% - 120px); }

/* Contenedor del artwork */
.artwork-container {
  position: relative;
  width: 220px;
  height: 220px;
  cursor: pointer;
  margin: 80px auto 0 auto; /* margen superior para separarlo del header, centrado horizontalmente */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Imagen */
.artwork-container img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  position: relative;
  z-index: 2;
}

/* Overlay */
.artwork-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
  z-index: 3;
}

#visualizer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index:1; /* detrás del artwork */
  border-radius:12px;
}

/* Metadata */
.metadata { text-align:center; margin-top:15px; }
.metadata h2 { font-size:1.4rem; }
.metadata p { color:#ccc; font-size:0.9rem; }

/* Bottom controls */
.bottom-controls {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  backdrop-filter: blur(10px);
  background: rgba(30,30,30,0.5);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  gap: 8px;
  z-index: 3;
}

.progress-container { display:flex; align-items:center; gap:8px; width:90%; max-width:400px; accent-color:#baefca; font-size:0.9rem; }
.progress-container input[type=range] { flex:1; cursor:pointer; }
.controls { display:flex; gap:12px; }
.controls button { border:none; border-radius:50%; display:flex; justify-content:center; align-items:center; cursor:pointer; transition:0.2s; width:50px; height:50px; font-size:28px; }
#play-pause { background: green; color: white; } /* cambia dinámicamente en JS */
#mute, #next { background: transparent; color: white; }

.controls button:hover { transform:scale(1.1); }

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  backdrop-filter: blur(5px); /* efecto moderno de fondo difuminado */
}

.modal-content {
  background: #1e1e1e;
  padding: 25px 20px;
  border-radius: 16px;
  text-align: center;
  width: 80%;
  max-width: 400px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.6); /* sombra suave */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-content h3 {
  margin-bottom: 15px;
  font-size: 1.6em;
  color: #fff;
}

.modal-content p {
  margin-bottom: 15px;
  font-size: 1.0em;
  color: #b2b1b1;
}

.bg-options {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 15px 0;
}

.bg-btn {
  background: #2a2a2a;
  border: none;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.bg-btn:hover {
  background: #444;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.action-btn, .close-btn {
  background: #2a2a2a;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  margin: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.25s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.action-btn:hover, .close-btn:hover {
  background: #444;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

hr {
  border: 0;
  height: 1px;
  background: #333;
  margin: 20px 0;
}

/* Mobile */
@media (max-width:768px){
  .artwork-container { width:160px; height:160px; }
  #visualizer { width:160px; height:160px; }
  .controls button { font-size:26px; width:45px; height:45px; }
  .progress-container { width:90%; }
}
