/* Oculto todas las ventanas para iniciar */        
.step {        
    display: none;      /* todas ocultas al inicio */        
    opacity: 0;         /* opacidad inicial */        
    transition: opacity 0.3s ease;        
}        
        
        
.step.active {        
    display: block;     /* se muestra */        
    opacity: 1;         /* fade-in */        
}        
        
        
.step.fade-in {        
    opacity: 1;        
}        
        
        
.step.fade-out {        
    opacity: 0;        
}        
        
        
/* Loader pantalla completa */            
#loader {            
  position: fixed;            
  top: 50%;            
  left: 50%;            
  transform: translate(-50%, -50%);        
  width: 100%;            
  height: 100%;            
  background-color: rgb(0, 5, 25, 1);            
  display: flex;            
  justify-content: center;            
  align-items: center;            
  z-index: 9999;            
  opacity: 0;            
  animation: fadeIn 1s forwards;            
}            
        
        
        
        
/* Logo girando con zoom */            
#loader-logo {            
  width: 120px;            
  height: 120px;            
  opacity: 0;            
  transform: scale(0.5);            
  animation: zoomIn 1s forwards, spin 2s linear infinite 1s;            
}            
        
        
        
        
html, body {          
    margin: 0;          
    height: 100vh;          
    width: 100vw;          
    padding: 0;          
    min-height: 100vh;            
    min-width: 100vw;          
}          
        
        
        
        
body {            
    font-family: Trebuchet MS;          
    display: flex;          
    justify-content: center;          
    align-items: center;          
    flex-direction: column; /* útil si hay más de un elemento vertical */          
}            
        
        
        
        
.container {              
    position: fixed;          
    background-color: rgba(15, 8, 31, 0.350);            
    border-radius: 10px;            
    box-shadow: 0 6px 15px rgba(32, 150, 219, 0.4);            
    display: flex;            
    flex-direction: column;            
    align-items: center;            
    justify-content: center;        
    z-index: 1;            
    opacity: 0;            
    visibility: hidden;            
    transition: opacity 0.25s ease-in;          
    width: 50%;                      
    max-width: 325px;                 
    min-width: 275px;          
    padding: 20px;                    
    box-sizing: border-box;           
    font-size: clamp(50%, 65%, 90%);           
    top: 20%;        
}              
        
        
        
        
.container.active {              
    display: flex !important;              
    opacity: 1;              
    visibility: visible;              
    animation: fadeIn 0.5s forwards;              
}              
        
        
        
        
.container.fade-out {            
    animation: fadeOut 0.5s forwards;            
}            
        

/* Login */        
        
h1 {            
    font-family: Trebuchet MS;            
    color: white;            
    text-align: center;
    cursor: default;
    user-select: none;
    
}            
#h2login img {            
    min-width: 45px;            
    max-width: 45px;            
    height: auto;        
    margin-top: 20px;            
}            
#loginbutton {          
    align-items: center;          
}       

#link-forgot {        
    color: white; 
    cursor: pointer;
} 
#step-placeholders-login {
cursor: text;
color: white;
}    
#login-tipo {
cursor: pointer;    
background-color: rgba(32, 150, 219, 0.10);
padding: 8px;              
margin: auto;              
border-radius: 5px;              
border: 1px solid rgba(32, 150, 219, 0.3);              
width: 100%;  /* ajuste para que siempre se adapte al container */            
box-sizing: border-box;          
color: white;          
outline: 1px solid rgba(32, 150, 219, 0.225);         
margin-bottom: 5px;            
}
select option {
background-color: rgba(32, 150, 219, 0.10);
color: rgba(32, 150, 219, 0.10);
    
}

select focus {
background-color: rgba(32, 150, 219, 0.10);
color: rgba(32, 150, 219, 0.10);
    
}   

select option:hover {
background-color: rgba(32, 150, 219, 0.10);    
color: rgba(32, 150, 219, 0.10);
    
}    

  
.no-account {          
  font-size: 14px;          
  color: white;          
  text-align: center; 
  cursor: default;
}            

.no-account a {          
  color: rgba(32, 150, 219, 0.9);          
  text-decoration: underline;          
  cursor: pointer;          
}            

#new-tipo {        
 padding: 8px;              
    margin: auto;              
    border-radius: 5px;              
    border: 1px solid rgba(32, 150, 219, 0.3);              
    width: 100%;  /* ajuste para que siempre se adapte al container */            
    box-sizing: border-box;          
    background-color: rgb(32, 150, 219, 0.10);           
    color: white;          
    outline: 1px solid rgba(32, 150, 219, 0.225);         
    margin-bottom: 5px;             
}        

.checkbox-container {
    display: flex;
    align-items: center; /* centra verticalmente */
    gap: 5px;
    width: auto;
    color: white;
    align-self: flex-start;
    margin-left: 8px;
    font-size: clamp(50%, 125%, 125%);
}
.checkbox-container input[type="checkbox"] {
    margin: 0; /* quitar márgenes extra del checkbox */
}


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

@keyframes fadeOut {            
    from {opacity:1; transform: translateX(0);}            
    to {opacity:0; transform: translateX(-50px);}            
}            
        
        
        
        
hr { width: 100%; margin: 20px 0; }              
        

#header-user{
    display:none;
}
/* ==========================
   Chat principal
   ========================== */
#step-chat.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    box-sizing: border-box;
    z-index: 10;
    min-width: 100vw;
    min-height: 100dvh;
    justify-content: flex-end;
    padding: 0;
}


#borde-chat {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 90%;
    margin: 0;
    box-sizing: border-box;
    background-color: rgba(32, 150, 219, 0.05);
    border: 1px solid rgba(32, 150, 219, 0.3);
    box-shadow: 0px -1px 8px rgba(32, 150, 219, 0.3);
    border-radius: 18px;
    z-index: 10;
    overflow: hidden;
    min-width: 100%;
    min-height: 90%;
}


/* Chat interno scrollable */
#chat {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 4px 2px 4px;
    box-sizing: border-box;
    overflow-y: auto;
    scrollbar-width: none;
    scroll-behavior: smooth;
}


/* Ocultar scroll visual */
#chat::-webkit-scrollbar { width: 0px; background: transparent; }


/* Botón enviar */
#send-btn-chat {
    padding: 0;
    border-radius: 20px;
    border: 1px solid rgba(32, 150, 219, 0.12);
    box-sizing: border-box;
    background-color: rgba(32, 150, 219, 0.12);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    width: 70px;
    min-width: 60px;
    font-size: clamp(50%, 175%, 175%);
    height: 100%;
}
#send-btn-chat:hover { background-color: rgba(32, 150, 219, 0.4); }

/* Botón adjuntar */
#attach-btn {
    padding: 0;
    border-radius: 20px;
    border: 1px solid rgba(32, 150, 219, 0.12);
    box-sizing: border-box;
    background-color: rgba(32, 150, 219, 0.12);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    width: 60px;
    min-width: 50px;
    font-size: clamp(50%, 250%, 225%);
    height: 100%;
}
#attach-btn:hover { background-color: rgba(32, 150, 219, 0.4); }

/* Input */
#user-input {
    resize: none !important;
    border-radius: 12px;
    font-size: 15px;
    width: 100%;
    font-family: 'roboto', sans-serif;
    background-color: rgba(15, 8, 31, 0.35);
    border-color: transparent;
    box-shadow: 0 6px 15px rgba(32, 150, 219, 0.4);
    border: 1px solid rgba(32, 150, 219, 0.3);
    padding: 10px;
    color: white;
    min-height: 2.5em;
    line-height: 1em;
    max-height: 30vh;
    box-sizing: border-box;
    overflow-y: hidden;
}
#user-input:focus { outline: none; }


/* Contenedor del input (sticky al fondo) */
#input-container {
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-height: 7%;
    position: sticky;
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 20;
}


/* Burbuja de mensaje */
.message {
    max-width: 75%;
    padding: 10px 12px 4px 12px;
    border-radius: 20px;
    word-break: break-word;
    position: relative;
    opacity: 0;
    transform: translateY(15px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    font-family: 'Helvetica', 'Arial', sans-serif;
    font-size: clamp(50%, 110%, 130%);
    display: flex;
    flex-direction: column;
    user-select: none;
    transition: transform 3s ease; /* animación lenta al moverse */
}


/* Meta dentro de la burbuja */
.message .meta {
    margin-top: 6px;
    font-size: clamp(50%, 65%, 90%);
    color: white;
    opacity: 0.7;
    user-select: none;
}


/* Burbuja usuario */
.user {
    background-color: rgba(32, 150, 219, 0.1);
    box-shadow: 0 3px 2px rgba(32, 150, 219, 0.4);
    color: white;
    text-align: right;
    border-bottom-right-radius: 2px;
    border-bottom-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top-left-radius: 20px;
}


/* Burbuja IA */
.ia {
    background-color: rgba(32, 150, 219, 0.3);
    box-shadow: 0 2px 2px rgba(32, 150, 219, 0.5);
    color: white;
    text-align: left;
    border-bottom-left-radius: 2px;
    border-bottom-right-radius: 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}


/* Selección múltiple de mensajes */
.message.selected {
    outline: 2px solid rgba(32, 150, 219, 0.7);
    background-color: rgba(32, 150, 219, 0.2) !important;
}


#file-chip-container{
  position: absolute;
  left: 12px;
  bottom: calc(100% + 8px); 
  display: flex;
  gap: 8px;
  z-index: 30;
}


.file-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.25);
  color: #fff;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  max-width: calc(100vw - 100px);
  overflow: hidden;
}


.file-chip .name{
  display: inline-block;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.file-chip .remove{
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}



/* Menú sobre burbuja */
.message-menu {
    display: flex;
    gap: 5px;
    position: absolute;
    top: -28px;
    right: 0;
    background: rgba(0,0,0,0.05);
    padding: 2px 4px;
    border-radius: 6px;
    z-index: 9999;
}
.message-menu div {
    cursor: pointer;
    font-size: 16px;
}

.media-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  justify-content: flex-start;
}

.media-image {
  width: 140px;
  height: auto;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.media-image:hover {
  transform: scale(1.05);
}

.media-video-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.media-video-embed {
  width: 420px;
  height: 236px;
  max-width: 100%;
  border-radius: 12px;
  background: #000;
  margin-top: 6px;
}

.media-video {
  width: 420px;
  max-width: 100%;
  border-radius: 12px;
  margin-top: 6px;
}

/* 🔹 NUEVO: tarjeta de noticia */
.media-news-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px;
  width: 220px;
  transition: background 0.2s ease;
}
.media-news-card:hover {
  background: rgba(255,255,255,0.08);
}

.media-news-thumb {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 6px;
}

.media-news-link {
  color: #66aaff;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 500;
  word-break: break-word;
}
.media-news-link:hover {
  text-decoration: underline;
}

.media-link {
  display: block;
  color: #66aaff;
  text-decoration: underline;
  margin-top: 4px;
  font-size: 0.9em;
}  
        
/* Botón menú usuario */              
#user-menu-btn {              
    position: fixed;              
    top: 4px;
    right: 6px;              
    width: 50px;              
    height: 50px;              
    border-radius: 50%;              
    overflow: hidden;              
    border: 2px solid rgba(32, 150, 219, 0.6); 
    box-shadow: 0 5px 12px rgba(32, 150, 219, 0.4);
    cursor: pointer;              
    transition: all 0.3s;              
    z-index: 999;              
    display:none;  
    color: white;
}              
#user-menu-btn img { width: 100%; height: 100%; object-fit: cover; }              
#user-menu-dropdown {              
    position: fixed;              
    top: 70px;              
    right: 15px;              
    background: #fff;              
    border-radius: 8px;              
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);              
    display: none;              
    flex-direction: column;              
    min-width: 150px;              
    z-index: 999;  
    background-color: rgba(32, 150, 219, 0.10);
    color:white;
}              
#user-menu-dropdown button {              
    background: none;              
    border: none;              
    padding: 10px;              
    text-align: left;              
    cursor: pointer;              
    width: 100%;    
    background-color: rgba(32, 150, 219, 0.10);
    color:white;
}              
#user-menu-dropdown button:hover { background-color: #f0f0f0; }              
        
/* Spinner loader */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top: 2px solid #2196f3; /* color primario */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-top: 6px;
  opacity: 0.7;
}


@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
   


p {        
    color: white;        
}        
        
        
/* ==============================
   Modal de Perfil - Estilo Tarjeta
   ============================== */
.modal {
    display: none; /* Se muestra con JS */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5); /* Fondo semi-transparente */
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
}


/* Contenido modal */
.modal .modal-content {
    background-color: rgba(8, 37, 64, 0.99);
    margin: auto;
    padding: 25px 30px;
    border-radius: 12px;
    width: 360px;
    max-width: 90%;
    box-shadow: 0 5px 12px rgba(32, 150, 219, 0.4);
    position: relative;
    text-align: center;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* Botón cerrar */
.modal .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
}


/* Foto de perfil */
.profile-header {
    margin-bottom: 20px;
}
.profile-pic-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 15px auto;
    
}
.profile-pic-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(32, 150, 219, 0.6);
    box-shadow: 0 5px 12px rgba(32, 150, 219, 0.4);
}


/* Botón de cámara */
.camera-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: rgba(32, 150, 219, 0.6);
    border: 2px solid rgba(32, 150, 219, 0.6);
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 12px rgba(32, 150, 219, 0.4);
}


/* Datos de usuario */
.profile-field {
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    width: 100%;
}
.profile-field label {
    font-weight: bold;
}
.profile-field a {
    color: white;
    text-decoration: none;
    font-size: 13px;
}
.profile-field a:hover {
    text-decoration: underline;
}

.profile-info {
    color: white;
}

/* Fade-in y fade-out para modal */
.fade-in {
    animation: fadeIn 0.3s forwards;
}


.fade-out {
    animation: fadeOut 0.3s forwards;
}


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


@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

        
@keyframes zoomIn {            
  from { opacity: 0; transform: scale(0.5); }            
  to { opacity: 1; transform: scale(1); }            
}            
        
        
        
        
@keyframes spin {            
  from { transform: rotate(0deg); }            
  to { transform: rotate(360deg); }            
}            
        
        
        
        
@keyframes fadeIn {            
  from { opacity: 0; }            
  to { opacity: 1; }            
}            
        
        
        
        
#loader.fade-out {            
  opacity: 0;            
  transition: opacity 2s ease;            
  pointer-events: none;            
}            
        
        
        
        
#loader.fade-out #loader-logo {            
  animation: zoomOut 3s forwards;            
}            
        
        
        
        
@keyframes zoomOut {            
  from { opacity: 1; transform: scale(1) rotate(0deg); }            
  to { opacity: 0; transform: scale(0.5) rotate(360deg); }            
}            

/* Fade in */              
@keyframes fadeMenu { from {opacity:0; transform: translateY(-10px);} to {opacity:1; transform: translateY(0);} }          


/* Input normal */
input {              
    padding: 8px;              
    margin: auto;              
    border-radius: 5px;              
    border: 1px solid rgba(32, 150, 219, 0.3);              
    width: 100%;            
    box-sizing: border-box;          
    background-color: rgba(32, 150, 219, 0.10);         
    color: white;          
    outline: 1px solid rgba(32, 150, 219, 0.225);         
    margin-bottom: 5px;            
    transition: background-color 0.3s, color 0.3s;
}


input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active{
    -webkit-background-clip: text;
    -webkit-text-fill-color: #ffffff;
    transition: background-color 5000s ease-in-out 0s;
    box-shadow: inset 0 0 20px 20px rgba(32, 150, 219, 0.10);
}



button {              
    padding: 10px;              
    border-radius: 5px;              
    border: 1px solid rgba(32, 150, 219, 0.2);              
    width: 100px;              
    box-sizing: border-box;          
    background-color: rgba(32, 150, 219, 0.2);          
    box-shadow: 0 5px 12px rgba(32, 150, 219, 0.4);          
    color: white;          
    cursor: pointer;          
    transition: all 0.3s; 
    margin: 0 auto;
    }          
  
button:hover { background-color: rgba(32, 150, 219, 0.5); }          
     

#login-msg {        
  color: white;        
  margin-top: 0;        
          
}  

/* efectos fondo web */          
@keyframes move {          
  100% {          
    transform: translate3d(0, 0, 1px) rotate(360deg);          
  }          
}          
  
  
/* Fondo principal */          
.background {          
  position: fixed;              
  top: 50%;              
  left: 50%;              
  transform: translate(-50%, -50%);        
  width: 100vw;          
  height: 100vh;          
  background: rgb(0, 5, 25);          
  overflow: hidden;          
  z-index: -1;          
  display: flex;          
  justify-content: center;          
  align-items: center;          
}  

/* Bola */        
.ball {        
  position: absolute;        
  width: 80vmin;        
  height: 80vmin;        
  border-radius: 80%;        
  animation: move linear infinite;        
  background: radial-gradient(circle, rgba(47, 141, 196, 0.2) 0%, rgba(47, 141, 196, 0) 70%);        
}        
        
        
        
        
/* Colores individuales con gradiente */        
.ball:nth-child(odd) {        
  background: radial-gradient(circle, rgba(47, 141, 196, 0.2) 0%, rgba(47, 141, 196, 0) 70%);        
}        
        
        
        
        
.ball:nth-child(even) {        
  background: radial-gradient(circle, rgba(47, 141, 196, 0.2) 0%, rgba(47, 141, 196, 0) 70%);        
}        
        
        
        
        
/* Posiciones y animaciones individuales */        
.ball:nth-child(1) {        
  top: 77%;        
  left: 88%;        
  animation-duration: 20s;        
  animation-delay: -3s;        
  transform-origin: 16vw -2vh;        
}        
.ball:nth-child(2) {        
  top: 42%;        
  left: 2%;        
  animation-duration: 33s;        
  animation-delay: -29s;        
  transform-origin: -19vw 21vh;        
}        
.ball:nth-child(3) {        
  top: 28%;        
  left: 18%;        
  animation-duration: 29s;        
  animation-delay: -8s;        
  transform-origin: -22vw 3vh;        
}        
.ball:nth-child(4) {        
  top: 50%;        
  left: 79%;        
  animation-duration: 16s;        
  animation-delay: -21s;        
  transform-origin: -17vw -6vh;        
}        
.ball:nth-child(5) {        
  top: 46%;        
  left: 15%;        
  animation-duration: 16s;        
  animation-delay: -40s;        
  transform-origin: 4vw 0vh;        
}        
.ball:nth-child(6) {        
  top: 77%;        
  left: 16%;        
  animation-duration: 15s;        
  animation-delay: -10s;        
  transform-origin: 18vw 4vh;        
}        
.ball:nth-child(7) {        
  top: 22%;        
  left: 17%;        
  animation-duration: 35s;        
  animation-delay: -6s;        
  transform-origin: 1vw -23vh;        
}        
.ball:nth-child(8) {        
  top: 41%;        
  left: 47%;        
  animation-duration: 23s;        
  animation-delay: -28s;        
  transform-origin: 25vw -3vh;        
}        
 
/* Dropdowns */

.dropdown {
  position: relative;
  width: 99%;
  font-family: sans-serif; 
  user-select: none;
  margin-bottom: 10px;
  border: 2px solid rgba(32, 150, 219, 0.3);
  border-radius: 5px;
  font-size: clamp(50%, 115%, 115%);
  color: rgba(150, 150, 150, 0.8);
  line-height: 0.8;
  
}


.dropdown-selected {
  background: rgba(32, 150, 219, 0.10); /* fondo transparente */
  color: #fff; 
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  color: white;
  
}


.dropdown-options {
  position: absolute;
  top: 110%;
  left: 0;
  width: 100%;
  background: rgba(4, 7, 27, 1);
  color: #fff;
  border-radius: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  display: none; /* oculto por defecto */
  z-index: 1000;
  max-height: 200px; /* scroll si hay muchas */
  overflow-y: auto;
  
}


.dropdown-options li {
  padding: 10px;
  cursor: pointer;
  background-color: rgba(32, 150, 219, 0.10);
  border-radius: 5px; 
  border: 1px solid rgba(32, 150, 219, 0.3);
}


.dropdown-options li:hover {
  background-color: rgba(32, 150, 219, 0.50);
  border-radius: 5px; 
  border: 1px solid rgba(32, 150, 219, 0.3);
  }
