/* ========================================
   RESET Y ESTILOS BASE
   ======================================== */

/* Reset global para elementos comunes */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Buena práctica para el modelo de caja */
}

/* Configuración base del documento */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  background-color: #000000;
  color: #fefefe;
  overflow: auto;

}

/* ========================================
   PANTALLA DE SPLASH (CARGA)
   ======================================== */

#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgb(0, 0, 0);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

#splash-screen .logo {
  width: 114px;
  animation: fadeIn 1.5s ease-in-out;
}

/* Animación de entrada del logo */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================
   BARRA DE NAVEGACIÓN SUPERIOR
   ======================================== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0px;
  /* Altura fija definida */
  background-color: rgba(0, 0, 0, 0);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  z-index: 10000;
  color: rgb(250, 250, 250);
  font-family: sans-serif;
}

#topbar {
  display: none;
  /* Oculto por defecto */
}

/* Navegación de texto en la barra superior */
.nav-textos {
  display: flex;
  align-items: center;
  gap: 5px;
  /* Espacio más consistente entre enlaces */
  font-size: 14px;
}



.icono-svg {
  width: 2rem;
  /* Tamaño similar a Bootstrap Icons */
  height: 20rem !important;
  fill: currentColor;
  /* Usa el color del texto del padre */
  vertical-align: middle;
  filter: invert();
  /* Invierte los colores para que se vean bien en fondo oscuro */

}


.activo .icono-svg {
  filter: invert() drop-shadow(0 2px 4px rgba(45, 45, 45, 0.959));
  transform: scale(1.1);
  transition: all 0.3s ease;
}



.nav-textos a {
  margin-right: 14px;
  cursor: pointer;
  font-size: 16px;
  opacity: 1;
  color: white;
  text-decoration: none;
  text-shadow: rgba(0, 0, 0, 0.65) 1px 1px 3px;
  font-weight: bold;
  transition: opacity 0.3s ease;
  /* Transición suave */
}

.nav-textos a:hover {
  opacity: 0.5;
}

/* Enlace activo "Para ti" */
.para-ti-link {
  border-bottom: 2px solid rgb(255, 255, 255);
  padding-bottom: 4px;
}

/* Icono de búsqueda */


.icono-busqueda {
  position: fixed;
  top: 43px;
  right: 20px;
  z-index: 60;
  font-size: 22px;
  color: white;
  cursor: pointer;
  font-weight: bold;
}


/* ========================================
   FEED DE VIDEOS PRINCIPAL
   ======================================== */
#video-feed {
  height: 100vh;
  width: 100vw;
  /* Añade este si no está */
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  transition: background-color 0.5s ease-in-out;
}


/* Ocultar scrollbar para apariencia más limpia */
#video-feed::-webkit-scrollbar {
  display: none;
}

/* Contenedor individual de cada video */
.video-item {
  height: 100vh;
  width: 100vw;
  scroll-snap-align: start;
  position: relative;
  transition: all 0.3s ease-in-out;
  background: linear-gradient(to bottom, #000 60%, #111);

  /* Transición suave */
}

/* Elemento video dentro del contenedor */
.video-item video {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* ========================================
   EFECTO TIKTOK - VIDEO REDUCIDO AL 50%
   ======================================== */

/* Fondo oscuro para toda la pantalla cuando están activos los comentarios */
body.comments-overlay::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgb(0, 0, 0);
  z-index: 15;
  transition: all 0.3s ease-in-out;
}


/* Cuando los comentarios están activos */
.video-container.comments-active {
  position: relative;
  z-index: 20;

}

/* El video queda encima de los comentarios - CORREGIDO */
#video-feed.video-reduced {
  position: fixed;
  top: 20%;
  /* Debajo del header */
  left: 50%;
  /* Pegado al borde derecho */
  transform: translate(-50%, -50%);
  /* centrado */
  width: 200px;
  /* Ancho fijo pequeño */
  height: 320px;
  /* Alto manteniendo proporción 9:16 */
  border-radius: 4px;
  /* Bordes ligeramente redondeados */
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  /* Sombra sutil */
  z-index: 999;
  /* Z-index muy alto */
  transition: all 0.1s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Más rápido */
  background-color: #000;
  /* Fondo negro sólido */
  border: none;
  /* Sin borde */
}

/* Asegurar que los videos individuales mantengan su proporción */
#video-feed.video-reduced .video-item {
  height: 100%;
  width: 100%;
}


/* Ocultar scroll cuando está reducido */
#video-feed.video-reduced {
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

/* Clase para ocultar el scroll del body */
.oculto-scroll {
  overflow: hidden;
}



/* ========================================
   BARRA LATERAL DE INTERACCIONES
   ======================================== */

.sidebar {
  position: absolute;
  right: 10px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  /* Espacio más consistente */
  z-index: 999;
}

/* Imagen de perfil en sidebar */
.sidebar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

/* Botones de acción en sidebar */
.sidebar button {
  background: none;
  border: none;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  /* Transición suave */
}



/* Iconos en sidebar */
.sidebar i {
  font-size: 30px;
  margin-bottom: 4px;
}

.boton-corazon i {
  color: rgb(255, 255, 255);
}




/* Contador de interacciones */
.contador {
  font-size: 14px;
  color: rgb(255, 255, 255);
}

/* animación boton de  guardar post */
.notificacion-tiktok {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(27, 27, 27, 0.952);
  color: #fff;
  padding: 12px 20px;
  border-radius: 16px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 9999;
  animation: fadeInOut 2s ease-in-out;
  width: 100%;
  max-width: 300px;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  10%,
  90% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
}

/* Botón de compartir */
.icono-volteado {
  transform: scaleX(-1);
  /* 🔁 Invierte horizontalmente el ícono de compartir*/
  display: inline-block;
  /* ✅ Necesario para que transform funcione */
}




/* ========================================
   INFORMACIÓN DEL VIDEO
   ======================================== */

.video-info {
  position: absolute;
  bottom: 50px;
  left: 15px;
  line-height: 1.2;
}

.video-info strong {
  font-size: 14px;
  color: white;
  font-weight: bold;
  padding: 2px 0;

}

.video-info p {
  font-size: 14px;
  color: #ffffff;
  margin: 2;
  /* 👈 Elimina margen extra */
  padding: 2px 0;
  word-break: break-word;
}

.hashtag {
  color: #ffffff;
}


/* ========================================
   PERFIL DE USUARIO
   ======================================== */

.foto-perfil {
  position: relative;
  display: inline-block;
}

.foto-perfil img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

/* Burbuja de notificación en perfil */
.burbuja-perfil {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgb(255, 0, 60);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 0 6px red;
}

/* ========================================
   VENTANA EMERGENTE DE COMENTARIOS
   ======================================== */

.popup-comentarios {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 62%;
  background: #0e0e0e;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.11);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.popup-comentarios.mostrar {
  transform: translateY(0%);
  opacity: 1;
  animation: slideUpFadeIn 0.3s ease forwards;
}

/* Animación de entrada de comentarios */
@keyframes slideUpFadeIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0%);
    opacity: 1;
  }
}

/* Header de la ventana de comentarios */
.comentarios-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background-color: #0e0e0e;
  z-index: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #00000000;
  padding: 10px 15px;
  border-radius: 15px;

}

.titulo-comentarios {
  margin: 0 auto;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
}

/* Contenido scrolleable de comentarios */
.comentarios-contenido {
  overflow-y: auto;
  padding: 10px 15px;
  flex-grow: 1;
  -ms-overflow-style: none;
  
}

/* Ocultar scrollbar en WebKit */
.comentarios-contenido::-webkit-scrollbar {
  display: none;
}

/* ========================================
   COMENTARIOS INDIVIDUALES
   ======================================== */

.comentario {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  font-size: 12px;
  color: rgb(186, 186, 186);
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Avatar del usuario en comentario */
.avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Contenido del comentario */
.contenido-comentario {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.contenido-comentario p {
  margin: 0;
  font-size: 15px;
  color: #ffffff;
  text-align: justify;
  line-height: 1.4;
  word-break: break-word;
  max-width: 90%;
}

.contenido-comentario p strong {
  text-shadow: 1px 1px 3px rgba(102, 102, 102, 0.11);
  /* 👉 sombra sutil */
  color: #8b8b8b;
  /* Asegúrate que el nombre destaque */
  font-weight: bold;
  /* Acentuar más */
}

/* Sección de reacciones */
.reacciones {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}

.info-izquierda {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #9a9a9a;
}

.botones-derecha {
  display: flex;
  gap: 35px;
  /* 👉 espacio entre los botones de reacciones */
  align-items: center;
}

.like-btn,
.dislike-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: #414141;
  transition: color 0.2s ease;
  font-size: 16px;
}

.like-btn i,
.dislike-btn i {
  font-size: 15px;
  transition: color 0.3s;
}

.like-btn.liked i {
  color: #ff2c55;
  animation: pop 0.3s ease;
}

.dislike-btn.disliked i {
  color: gray;
}




/* Animación de "me gusta" */
@keyframes pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
  }

  100% {
    transform: scale(1);
  }
}



/* ========================================
   BARRA DE COMENTARIOS GENERAL
   ======================================== */

.barra-general-comentario {
  display: flex;
  align-items: center;
  padding: 7px;
  background-color: #0e0e0e;
  border-top: 1px solid #33333300;
}

.barra-general-comentario .avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 11px;
  
}

.barra-general-comentario button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #181818;
  transition: color 0.2s ease;
}

.barra-general-comentario button:hover {
  color: #55f938cd;
}

/* ========================================
   INPUT CON ÍCONOS DENTRO
   ======================================== */

.input-con-iconos {
  position: relative;
  flex: 1;

}

.input-con-iconos input {
  width: 100%;
  padding: 10px 90px 10px 12px;
  /* espacio a la derecha para los íconos */
  background-color: #353535;
  border: none;
  border-radius: 21px;
  color: white;
  font-size: 16px;
  outline: none;
}

.iconos-dentro-input {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 11px;
  font-size: 12;
}


/* agregar comentario */
.input-con-iconos input::placeholder {
  color: #bdbdbd;
  opacity: 1;
  font-size: 15px;
}


/* ========================================
   ÍCONOS EN GENERAL
   ======================================== */

.icono {
  font-size: 20px;
  color: white;
  cursor: pointer;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.icono:hover {
  transform: scale(1.2);
  opacity: 1;
}

/* ========================================
   PLACEHOLDER DEL INPUT
   ======================================== */

.comentario-input::placeholder {
  color: #ffffff;
  opacity: 1;


}

/* ========================================
   ÍCONOS FUERA DEL INPUT (si se usan)
   ======================================== */

.iconos-comentario {
  display: flex;
  gap: 9px;
  margin-left: 7px;
}




/* ========================================
   SECCIÓN DE EMOJIS
   ======================================== */

.emoji-row {
  display: flex;
  gap: 20px;
  padding: 6px;
  font-size: 24px;
  cursor: pointer;
  user-select: none;
  justify-content: center;
}

.emoji-row:hover {
  background-color: #f5f5f500;
  border-radius: 8px;
}


/* ========================================
   SECCIÓN DE PERFIL DE USUARIO
   ======================================== */

.titulo {
  padding: 10px;
  text-align: center;
  position: fixed;
  top: 0;
  background-color: #000000;
  width: 100%;
  z-index: 10;
}

.titulo button {
  background-color: transparent;
  border: none;
  font-size: 20px;
  position: fixed;
  top: -3px;
  right: 10px;
}

header {
  display: flex;
  padding: 20px;
  margin-top: 60px;
  background-color: #000000;
}

header div img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.texto-perfil {
  margin-left: 10px;
}

.texto-perfil h3,
.texto-perfil p {
  margin-bottom: 7px;
}

.texto-perfil a img {
  height: 12px;
  width: 12px;
}

.texto-perfil p span {
  color: rgb(182, 182, 182);
}

.texto-perfil a {
  color: rgb(255, 255, 255);
  text-decoration: none;
}

/* Información detallada del perfil */
.profile-container {
  padding: 20px;
}

.profile-info {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.profile-pic img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 20px;
}

.profile-details h2 {
  font-size: 24px;
  margin: 10px 0;
}

.profile-details p {
  margin: 5px 0;
}

.profile-details a {
  display: inline-block;
  margin-top: 10px;
}

/* ========================================
   NAVEGACIÓN DE VIDEOS EN PERFIL
   ======================================== */

.nav-videos {
  border-top: 1px solid rgb(224, 224, 224);
  border-bottom: 1px solid rgb(224, 224, 224);
  display: flex;
  justify-content: space-around;
}

.nav-videos button {
  background-color: transparent;
  border: none;
  padding-top: 7px;
  padding-bottom: 3px;
}

.nav-videos .activado {
  border-bottom: 2px solid black;
  width: 30px;
}

.nav-videos button img {
  height: 18px;
}

/* ========================================
   GRID DE POSTS/VIDEOS
   ======================================== */

main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
}

main img {
  width: 100%;
  aspect-ratio: 9 / 16;
  /* Proporción vertical tipo TikTok */
  object-fit: cover;
  display: block;
  border-radius: 1px;
}

.posts-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.post-img,
.discover-image {
  width: 100%;
  border-radius: 1px;
  object-fit: cover;
}

.profile-posts h3 {
  margin-bottom: 10px;
}

/* ========================================
   FOOTER Y NAVEGACIÓN INFERIOR
   ======================================== */

footer {
  position: fixed;
  bottom: 0;
  background-color: #000000;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 3px 0;
  z-index: 10;
  height: 60px;

}

footer button {
  background-color: transparent;
  border: none;
}

footer button img {
  height: 22px;
}

footer button p {
  font-size: 10px;
}


/* Logo TikTok camara */
.tiktok {
  height: 55px;
  width: auto;
  object-fit: contain;
  display: block;
  margin-top: -10px;
  /* Mueve hacia abajo */
}

/* ========================================
   BOTONES Y ELEMENTOS INTERACTIVOS
   ======================================== */

/* Botones generales */
button {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: white;
}

.cerrar {
  background: none;
  border: none;
  font-size: 20px;
  color: white;
  cursor: pointer;
}

.back-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

/* Botones con iconos */
a.btn-icono,
.btn-icono {
  text-decoration: none;
  color: white;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

.btn-icono .icono {
  filter: brightness(0) invert(1);
  width: 24px;
  height: 24px;
}

/* ========================================
   NOTIFICACIONES Y BURBUJAS
   ======================================== */

/* Contenedor de notificación */
.btn-icono.notificacion {
  position: relative;
}

.burbuja-container {
  position: relative;
}

/* Burbuja de notificación */
.burbuja {
  position: absolute;
  top: 0;
  right: 10px;
  background-color: red;
  color: white;
  width: 14px;
  height: 14px;
  font-size: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  animation: pulso 1.2s infinite;
}

.badge-alert {
  position: absolute;
  top: -5px;
  right: -10px;
  background-color: red;
  color: rgb(255, 0, 0);
  font-size: 5px;
  padding: 2px 5px;
  border-radius: 50%;
}

/* Animación de pulso para notificaciones */
@keyframes pulso {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

/* ========================================
   ICONOS Y ELEMENTOS VISUALES
   ======================================== */

.icono-svg {
  width: 2rem;
  height: 2rem;
  /* Corregido: era 20rem */
  fill: currentColor;
  vertical-align: middle;
  filter: invert();
}

/* ========================================
   ESTADOS Y UTILIDADES
   ======================================== */

.oculto {
  display: none;
}

.opaco {
  opacity: 0.5 !important;
}

.loading {
  padding: 20px;
  font-size: 16px;
  color: #fff;
  text-align: center;
  display: none;
}

/* ========================================
   TÍTULOS Y ENCABEZADOS
   ======================================== */

h1,
h2,
h3 {
  margin: 0;
  padding: 0;
}

.navbar h1 {
  flex-grow: 1;
  text-align: center;
}