﻿@import url('https://fonts.googleapis.com/css2?family=Pacifico&display=swap');

:root {
  --insta-grad: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --insta-red: #dc2743;
}

body { background: #fafafa; }

.logo {
  font-family: 'Pacifico', cursive;
  background: var(--insta-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.btn-insta {
  background: var(--insta-grad);
  border: 0;
  color: #fff;
  font-weight: 600;
}
.btn-insta:hover { color: #fff; filter: brightness(1.08); }

.form-control:focus {
  border-color: var(--insta-red);
  box-shadow: 0 0 0 .2rem rgba(220, 39, 67, .15);
}

a { color: var(--insta-red); text-decoration: none; }
a:hover { color: #bc1888; }

/* Login */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, #fff5f0 0%, #fde7f3 50%, #f1e8ff 100%);
}
.auth-box {
  width: 100%;
  max-width: 380px;
  border: 0;
  border-radius: 20px;
  padding: 2rem 1.75rem;
  box-shadow: 0 10px 40px rgba(188, 24, 136, .15);
}
.auth-box .logo { font-size: 2.6rem; }

/* Feed */
.navbar-ib {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #efefef;
}
.navbar-ib .logo { font-size: 1.7rem; }

.feed-box { max-width: 560px; }

.upload-card {
  border: 1px solid #efefef;
  border-radius: 14px;
}

.post-card {
  border: 1px solid #efefef;
  border-radius: 14px;
  overflow: hidden;
}
.post-card .card-header {
  background: #fff;
  border-bottom: 0;
  padding: .8rem 1rem;
}
.post-card img {
  width: 100%;
  max-height: 600px;
  object-fit: cover;
}

/* ===== Menú lateral ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 244px;
  padding: 1.5rem .9rem;
  background: #fff;
  border-right: 1px solid #efefef;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.sidebar .logo { font-size: 1.8rem; margin: 0 .6rem 1.5rem; }
.nav-list { display: flex; flex-direction: column; gap: .2rem; }

.nav-item-ib {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: .8rem .75rem;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #262626;
  font-size: 1rem;
  text-align: left;
  text-decoration: none;
  transition: background .15s;
}
.nav-item-ib i { font-size: 1.45rem; }
.nav-item-ib:hover:not(:disabled) { background: #f2f2f2; color: #262626; }
.nav-item-ib.active { font-weight: 700; }
.nav-item-ib:disabled { opacity: .45; cursor: not-allowed; }
.nav-item-ib .soon {
  margin-left: auto;
  font-size: .62rem;
  padding: .15rem .45rem;
  border-radius: 20px;
  background: #efefef;
  color: #666;
}
.sidebar-footer { margin-top: auto; }
.user-name { display: block; padding: 0 .75rem .4rem; font-weight: 600; color: #8e8e8e; }

.main-with-sidebar { margin-left: 244px; padding: 2rem 1rem; }

/* Móvil: el menú pasa abajo */
@media (max-width: 991.98px) {
  .sidebar {
    top: auto;
    width: 100%;
    height: 60px;
    padding: 0 .5rem;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-top: 1px solid #efefef;
  }
  .sidebar .logo, .label, .soon, .user-name { display: none; }
  .nav-list { flex-direction: row; flex: 1; justify-content: space-around; gap: 0; }
  .sidebar-footer { margin-top: 0; }
  .nav-item-ib { justify-content: center; padding: .6rem; width: auto; }
  .main-with-sidebar { margin-left: 0; padding: 1rem 1rem 80px; }
}

/* ===== Modal ===== */
.modal-ib { border: 0; border-radius: 18px; overflow: hidden; }
.modal-ib .modal-header, .modal-ib .modal-footer { border-color: #efefef; }

/* ===== 404 ===== */
.error-code { font-size: clamp(6rem, 22vw, 11rem); line-height: 1; margin-bottom: .5rem; }

/* ===== Publicaciones estilo Instagram ===== */
.feed-box { max-width: 470px; }

.post-card {
  background: #fff;
  border: 1px solid #efefef;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: visible;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.post-header {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem .9rem;
}
.avatar-ring {
  padding: 2px;
  border-radius: 50%;
  background: var(--insta-grad);
  line-height: 0;
}
.post-card .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #f0f0f0;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1;
  color: #777;
}
.post-author { font-size: .9rem; }
.btn-dots {
  border: 0;
  background: none;
  font-size: 1.1rem;
  padding: .2rem .4rem;
  color: #262626;
}
.post-card img.post-img {
  display: block;
  width: 100%;
  max-height: 585px;
  object-fit: cover;
  background: #f5f5f5;
}
.post-actions {
  display: flex;
  gap: .9rem;
  padding: .6rem .9rem .2rem;
}
.post-actions button {
  border: 0;
  background: none;
  padding: 0;
  font-size: 1.5rem;
  color: #262626;
}
.post-actions button:disabled { opacity: .85; cursor: not-allowed; }
.post-caption { margin: 0; padding: .3rem .9rem 0; font-size: .92rem; }
.hashtag { color: #00376b; }
.post-time {
  padding: .35rem .9rem .8rem;
  font-size: .68rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #8e8e8e;
}

.verified-badge {
  color: #0095f6;
  font-size: .95rem;
  margin-left: -.35rem;
}

.verified-badge {
  margin-left: .3rem;
  font-size: .95rem;
  vertical-align: -.08em;
}
.post-header .verified-badge { margin-left: -.4rem; }

/* ===== Ajustes finales ===== */
:root { --badge-gap: .4rem; }

.name-line { display: flex; align-items: center; gap: var(--badge-gap); }
.name-line .verified-badge,
.user-name .verified-badge { margin-left: 0; }
.user-name { display: flex; align-items: center; gap: var(--badge-gap); }

/* El aro de colores es solo para historias (se activa con la clase has-story) */
.avatar-ring { padding: 0; background: none; }
.avatar-ring.has-story { padding: 2px; background: var(--insta-grad); }
.post-card .avatar { width: 38px; height: 38px; border: 0; }
.avatar-ring.has-story .avatar { border: 2px solid #fff; }

/* ===== Menú lateral colapsable (solo escritorio) ===== */
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.sidebar-top .logo { margin: 0 .6rem; }

.btn-toggle {
  border: 0;
  background: none;
  color: #8e8e8e;
  font-size: 1.05rem;
  padding: .4rem .5rem;
  border-radius: 10px;
  line-height: 1;
}
.btn-toggle:hover { background: #f2f2f2; color: #262626; }

@media (min-width: 992px) {
  .sidebar, .main-with-sidebar { transition: width .2s ease, margin-left .2s ease; }

  .sidebar-collapsed .sidebar { width: 76px; padding: 1.5rem .6rem; }
  .sidebar-collapsed .main-with-sidebar { margin-left: 76px; }
  .sidebar-collapsed .sidebar .logo,
  .sidebar-collapsed .label,
  .sidebar-collapsed .soon,
  .sidebar-collapsed .user-name { display: none; }
  .sidebar-collapsed .sidebar-top { justify-content: center; }
  .sidebar-collapsed .nav-item-ib { justify-content: center; padding: .8rem 0; }
}

@media (max-width: 991.98px) {
  .sidebar-top { display: none; }
}

/* ===== Foto de perfil en el menu ===== */
.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #e9e9ee;
}
/* Perfil sigue sin funcionar, pero la foto se ve con color normal */
.nav-item-ib.perfil:disabled { opacity: 1; }
.nav-item-ib.perfil:disabled .label,
.nav-item-ib.perfil:disabled .soon { opacity: .45; }

/* ===== Likes y favoritos ===== */
.post-actions button:not(:disabled) { cursor: pointer; }
.post-actions button:not(:disabled):hover { opacity: .6; }
.post-actions .activo-like i { color: #ed4956; animation: pop .25s ease; }
.post-actions .activo-guardado i { animation: pop .25s ease; }
@keyframes pop {
  0% { transform: scale(.7); }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.post-likes { padding: 0 .9rem; font-size: .9rem; font-weight: 600; }

/* ===== Comentarios ===== */
.post-comments-link {
  display: block;
  border: 0;
  background: none;
  padding: .3rem .9rem 0;
  color: #8e8e8e;
  font-size: .9rem;
  text-align: left;
}
.post-comments-link:hover { color: #262626; }

.modal-comentarios-body { min-height: 160px; }
.comentario { display: flex; gap: .7rem; margin-bottom: 1rem; }
.comentario-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #e9e9ee; }
.comentario-cuerpo { font-size: .92rem; word-break: break-word; }
.comentario-meta { font-size: .75rem; color: #8e8e8e; margin-top: .15rem; }
.comentario-borrar { border: 0; background: none; padding: 0; font-size: .75rem; color: #8e8e8e; }
.comentario-borrar:hover { color: #ed4956; }

/* ===== Respuestas a comentarios ===== */
.comentario-bloque { margin-bottom: 1rem; }
.comentario-bloque .comentario { margin-bottom: .4rem; }
.respuestas { margin-left: 2.6rem; margin-top: .6rem; }
.respuestas .comentario { margin-bottom: .7rem; }
.respuestas .comentario-avatar { width: 26px; height: 26px; }
.ver-respuestas {
  border: 0; background: none; padding: 0; margin-left: 2.6rem;
  font-size: .78rem; font-weight: 600; color: #8e8e8e;
}
.ver-respuestas:hover { color: #262626; }
.comentario-accion {
  border: 0; background: none; padding: 0;
  font-size: .75rem; font-weight: 600; color: #8e8e8e;
}
.comentario-accion:hover { color: #262626; }
.respondiendo {
  display: flex; align-items: center; justify-content: space-between;
  background: #f5f5f5; border-radius: 10px; padding: .35rem .75rem;
  font-size: .82rem; color: #555;
}
.respondiendo button { border: 0; background: none; font-size: 1.1rem; line-height: 1; color: #888; }
.mencion { color: #00376b; font-weight: 600; }

/* ===== Barra inferior en celular ===== */
@media (max-width: 991.98px) {
  .sidebar {
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding: 0 .25rem env(safe-area-inset-bottom, 0px);
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  /* En la barra solo van iconos: ocultamos textos, logo y nombre de usuario */
  .sidebar .logo,
  .sidebar .label,
  .sidebar .soon,
  .sidebar .user-name { display: none; }

  .nav-list {
    flex: 1;
    min-width: 0;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
  }
  .sidebar .nav-item-ib {
    flex: 1;
    width: auto;
    min-width: 0;
    justify-content: center;
    padding: .6rem .4rem;
  }

  /* El botón de salir queda en la misma fila, sin apilarse */
  .sidebar-footer {
    margin: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .sidebar-footer .nav-item-ib { flex: none; }

  .main-with-sidebar {
    margin-left: 0;
    padding: 1rem .75rem calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* Pantallas muy angostas */
@media (max-width: 380px) {
  .sidebar .nav-item-ib { padding: .6rem .2rem; }
  .sidebar .nav-item-ib i { font-size: 1.3rem; }
  .nav-avatar { width: 24px; height: 24px; }
}

/* ===== Perfil ===== */
.enlace-perfil { cursor: pointer; }
.enlace-perfil:hover { opacity: .75; }

.perfil-box { max-width: 935px; }
.perfil-cabecera { display: flex; gap: 2.5rem; align-items: flex-start; padding: 1rem 0 2rem; }
.perfil-avatar {
  width: 150px; height: 150px; border-radius: 50%;
  object-fit: cover; background: #e9e9ee; flex-shrink: 0;
}
.perfil-info { min-width: 0; flex: 1; }
.perfil-linea { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; margin-bottom: 1rem; }
.perfil-usuario { font-size: 1.35rem; font-weight: 400; margin: 0; display: flex; align-items: center; gap: .4rem; }
.perfil-usuario .verified-badge { margin-left: 0; }
.perfil-stats { display: flex; gap: 2rem; margin-bottom: 1rem; }
.perfil-nombre { font-weight: 700; }
.perfil-bio { white-space: pre-wrap; word-break: break-word; margin: 0 0 .3rem; }
.perfil-desde { font-size: .8rem; color: #8e8e8e; }

.perfil-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  border-top: 1px solid #dbdbdb; padding-top: 4px;
}
.perfil-celda {
  position: relative; border: 0; padding: 0; background: #f0f0f0;
  aspect-ratio: 1 / 1; overflow: hidden; cursor: pointer;
}
.perfil-celda img { width: 100%; height: 100%; object-fit: cover; display: block; }
.perfil-celda .overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 1.4rem; background: rgba(0, 0, 0, .4); color: #fff; font-weight: 700;
  opacity: 0; transition: opacity .15s;
}
.perfil-celda:hover .overlay, .perfil-celda:focus-visible .overlay { opacity: 1; }
.perfil-vacio { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; color: #8e8e8e; }

.modal-post-body { padding: 0; }
.modal-post-body .post-card { margin-bottom: 0; border: 0; box-shadow: none; border-radius: 0; }

@media (max-width: 575.98px) {
  .perfil-cabecera { gap: 1rem; }
  .perfil-avatar { width: 80px; height: 80px; }
  .perfil-stats { gap: 1.2rem; }
  .perfil-grid { gap: 2px; }
}

/* ===== Editar perfil ===== */
.editar-foto {
  display: flex; align-items: center; gap: 1rem;
  background: #fafafa; border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem;
}
.editar-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #e9e9ee; }
.editar-foto .btn-link { text-decoration: none; font-size: .9rem; }
.editar-foto .btn-link:disabled { opacity: .5; }

/* ===== Feed en 3 columnas + Sugerencias ===== */
.feed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px) minmax(0, 1fr);
  align-items: start;
}
.feed-layout .feed-box { grid-column: 2; width: 100%; max-width: 470px; margin: 0; }

.sugerencias {
  display: none;
  grid-column: 3;
  position: sticky;
  top: 2rem;
  max-width: 380px;
  padding-left: 2.5rem;
}
@media (min-width: 1400px) { .sugerencias { display: block; } }
@media (min-width: 1250px) { .sidebar-collapsed .sugerencias { display: block; } }

.sugerencia { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.sugerencia-enlace {
  display: flex; align-items: center; gap: .8rem;
  flex: 1; min-width: 0; color: inherit; text-decoration: none;
}
.sugerencia-enlace:hover .sugerencia-usuario { text-decoration: underline; }
.sugerencia-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; background: #e9e9ee; flex-shrink: 0;
}
.sugerencia-textos { min-width: 0; }
.sugerencia-usuario {
  display: flex; align-items: center; gap: .3rem;
  font-size: .9rem; font-weight: 600; line-height: 1.2;
}
.sugerencia-usuario .verified-badge { margin-left: 0; font-size: .85rem; }
.sugerencia-sub {
  font-size: .8rem; color: #8e8e8e; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sugerencia-yo { margin-bottom: 0; }
.sugerencia-yo .sugerencia-avatar { width: 56px; height: 56px; }
.sugerencia-yo .sugerencia-usuario { font-size: .95rem; }

.sugerencias-titulo {
  display: flex; align-items: center; justify-content: space-between;
  margin: 1.4rem 0 1rem; font-size: .9rem; font-weight: 700; color: #8e8e8e;
}
.sugerencias-otras { border: 0; background: none; padding: 0; font-size: .8rem; font-weight: 600; color: #262626; }
.sugerencias-otras:hover { opacity: .6; }
.sugerencias-otras:disabled { opacity: .4; }

.btn-seguir-mini { border: 0; background: none; padding: 0 .2rem; font-size: .8rem; font-weight: 700; color: #0095f6; }
.btn-seguir-mini:disabled { opacity: .45; cursor: not-allowed; }

.sugerencias-vacio { font-size: .85rem; color: #8e8e8e; }
.sugerencias-pie { margin-top: 1.5rem; font-size: .75rem; color: #c7c7c7; }

/* ===== Me gusta en comentarios ===== */
.comentario-cuerpo { flex: 1; min-width: 0; }
.comentario-like {
  display: flex; flex-direction: column; align-items: center;
  min-width: 26px; padding-top: .15rem; flex-shrink: 0;
}
.comentario-like button {
  border: 0; background: none; padding: 0;
  font-size: .95rem; line-height: 1; color: #8e8e8e; cursor: pointer;
}
.comentario-like button:hover { opacity: .6; }
.comentario-like .activo-like { color: #ed4956; }
.comentario-like .activo-like i { animation: pop .25s ease; }
.comentario-like-n { font-size: .7rem; color: #8e8e8e; min-height: .9rem; }

/* ===== Centrado real del feed ===== */
/* --sb = ancho del menú lateral; se reserva el mismo espacio a la derecha */
:root { --sb: 244px; }
.sidebar-collapsed { --sb: 76px; }

@media (min-width: 1200px) {
  .main-feed {
    margin-right: var(--sb);
    transition: margin-left .2s ease, margin-right .2s ease;
  }
  .sugerencias {
    display: block;
    width: 300px;
    max-width: none;
    margin-left: 2rem;
    padding-left: 0;
  }
}

/* ===== Sugerencias a la derecha ===== */
/* El panel queda centrado en el espacio libre de la derecha; el feed sigue centrado */
@media (max-width: 1299.98px) {
  .sugerencias, .sidebar-collapsed .sugerencias { display: none; }
}
@media (min-width: 1300px) {
  .sugerencias, .sidebar-collapsed .sugerencias {
    display: block;
    width: 300px;
    margin-left: clamp(2rem, calc(25vw - 282px), 14rem);
  }
}

/* ===== Pestañas del perfil ===== */
.perfil-tabs { display: flex; justify-content: center; gap: 3rem; border-top: 1px solid #dbdbdb; }
.perfil-tabs button {
  display: flex; align-items: center; gap: .4rem;
  border: 0; border-top: 1px solid transparent; margin-top: -1px;
  background: none; padding: .9rem .2rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: #8e8e8e;
}
.perfil-tabs button:hover { color: #262626; }
.perfil-tabs button.activa { color: #262626; border-top-color: #262626; }
.perfil-aviso { text-align: center; font-size: .8rem; color: #8e8e8e; margin: .4rem 0 .8rem; }
.perfil-grid.sin-borde { border-top: 0; padding-top: 0; }

@media (max-width: 575.98px) {
  .perfil-tabs { gap: 1.2rem; }
  .perfil-tabs button span { display: none; }
  .perfil-tabs button i { font-size: 1.2rem; }
}

/* ===== Videos ===== */
.post-card video.post-img {
  display: block; width: 100%; max-height: 585px;
  background: #000; object-fit: contain;
}
.perfil-celda video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.perfil-marca-video {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  color: #fff; font-size: 1.1rem; text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

/* ===== Reproductor de video ===== */
.vp {
  position: relative;
  width: 100%;
  aspect-ratio: var(--vp-ratio, 0.8);
  background: #0b0b0f;
  overflow: hidden;
  cursor: pointer;
  outline: none;
  touch-action: manipulation; /* sin zoom al tocar dos veces */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.vp:focus-visible { box-shadow: inset 0 0 0 3px rgba(220, 39, 67, .7); }

/* Fondo desenfocado con los colores del video */
.vp-ambiente {
  position: absolute; inset: 0; width: 100%; height: 100%;
  filter: blur(22px) saturate(1.4) brightness(.75);
  transform: scale(1.35);
}
.vp-video {
  position: relative; z-index: 1;
  display: block; width: 100%; height: 100%;
  object-fit: contain; background: transparent;
}

/* Botón de play cuando está en pausa */
.vp-centro {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.vp-centro i {
  width: 72px; height: 72px; padding-left: 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: 2.2rem; color: #fff;
  background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px);
}
.vp.vp-pausado .vp-centro { opacity: 1; }

/* Tiempo restante */
.vp-tiempo {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  padding: .15rem .55rem; border-radius: 20px;
  font-size: .72rem; font-weight: 600; color: #fff;
  background: rgba(0, 0, 0, .5); backdrop-filter: blur(4px);
  pointer-events: none;
}

/* Botones de sonido y pantalla completa */
.vp-sonido, .vp-pantalla {
  position: absolute; bottom: 28px; z-index: 3;
  width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  font-size: 1rem; color: #fff; cursor: pointer;
  background: rgba(0, 0, 0, .5); backdrop-filter: blur(4px);
}
.vp-sonido { right: 10px; }
.vp-pantalla { right: 52px; }
.vp-sonido:hover, .vp-pantalla:hover { background: rgba(0, 0, 0, .7); }

/* Barra de progreso (se puede arrastrar) */
.vp-barra {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  height: 20px; display: flex; align-items: flex-end;
  cursor: pointer; touch-action: none;
}
.vp-barra-pista { width: 100%; height: 3px; background: rgba(255, 255, 255, .3); transition: height .15s; }
.vp-barra:hover .vp-barra-pista, .vp.vp-buscando .vp-barra-pista { height: 7px; }
.vp-barra-progreso { width: 0; height: 100%; background: linear-gradient(90deg, #f09433, #dc2743, #bc1888); }

/* Si el video no carga */
.vp-fallo {
  display: none; position: absolute; inset: 0; z-index: 4;
  align-items: center; justify-content: center;
  color: #fff; font-size: .9rem; background: rgba(0, 0, 0, .65);
}
.vp.vp-error .vp-fallo { display: flex; }
.vp.vp-error .vp-centro { display: none; }

/* Pantalla completa */
.vp:fullscreen { aspect-ratio: auto; width: 100%; height: 100%; }

/* Fotos: contenedor para el doble toque */
.media-foto {
  position: relative; overflow: hidden;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.media-foto img { -webkit-user-drag: none; }

/* Corazón del doble toque */
.corazon-flotante {
  position: absolute; z-index: 5; pointer-events: none;
  font-size: 5.5rem; line-height: 1;
  background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .4));
  transform: translate(-50%, -50%) scale(0);
  animation: corazon-toque .85s cubic-bezier(.2, .9, .3, 1.2) forwards;
}
@keyframes corazon-toque {
  0%   { transform: translate(-50%, -50%) scale(.2) rotate(var(--giro, 0deg)); opacity: 0; }
  18%  { transform: translate(-50%, -50%) scale(1.25) rotate(var(--giro, 0deg)); opacity: 1; }
  32%  { transform: translate(-50%, -50%) scale(.95) rotate(var(--giro, 0deg)); }
  55%  { transform: translate(-50%, -50%) scale(1.05) rotate(var(--giro, 0deg)); opacity: 1; }
  100% { transform: translate(-50%, -115%) scale(1.15) rotate(var(--giro, 0deg)); opacity: 0; }
}
@keyframes corazon-suave {
  0%, 60% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .corazon-flotante { animation-name: corazon-suave; animation-duration: .8s; }
}

/* ===== Volumen del reproductor (solo con mouse) ===== */
.vp-vol { position: absolute; right: 10px; bottom: 28px; z-index: 4; }
.vp-vol .vp-sonido { position: static; }

.vp-vol-caja {
  display: none;
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%);
  padding-bottom: 8px; /* puente para que no se cierre al subir el mouse */
}
.vp-vol:hover .vp-vol-caja,
.vp-vol:focus-within .vp-vol-caja,
.vp-vol.vp-vol-activo .vp-vol-caja { display: block; }

.vp-vol-pista {
  position: relative; width: 34px; height: 112px; --vol: 1;
  border-radius: 17px; outline: none; cursor: pointer; touch-action: none;
  background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px);
}
.vp-vol-pista:focus-visible { box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); }
.vp-vol-pista::before {
  content: ''; position: absolute; left: 50%; top: 12px; bottom: 12px;
  width: 6px; margin-left: -3px; border-radius: 3px;
  background: rgba(255, 255, 255, .3);
}
.vp-vol-relleno {
  position: absolute; left: 50%; bottom: 12px;
  width: 6px; margin-left: -3px; border-radius: 3px;
  height: calc((100% - 24px) * var(--vol));
  background: linear-gradient(0deg, #f09433, #dc2743, #bc1888);
}

/* En pantallas táctiles se usan los botones de volumen del teléfono */
@media (hover: none) { .vp-vol-caja { display: none !important; } }

/* ===== Editar descripción ===== */
.post-editor { padding: .3rem .9rem 0; }
.post-editor textarea { font-size: .92rem; resize: vertical; }
.post-editor-pie { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; }
.post-editor-contador { font-size: .75rem; color: #8e8e8e; }
.post-editor-botones { display: flex; gap: .4rem; }

/* ===== Crear publicación (arrastrar, vista previa y texto) ===== */
#crear-dialogo { max-width: 520px; transition: max-width .25s ease; }
#crear-dialogo.crear-ancho { max-width: 900px; }

.crear-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: .6rem 1rem; }
.crear-header .modal-title { text-align: center; }
.crear-header-der { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; }
.crear-atras { justify-self: start; border: 0; background: none; padding: 0 .3rem; font-size: 1.3rem; color: #262626; }
.crear-atras:disabled { opacity: .4; }

#crear-progreso { height: 4px; border-radius: 0; background: #efefef; }
#crear-progreso .progress-bar { background: linear-gradient(90deg, #f09433, #dc2743, #bc1888); transition: width .15s; }

.crear-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .9rem; text-align: center; padding: 3rem 1.5rem; min-height: 420px;
  transition: background .15s;
}
.crear-drop-icono i {
  font-size: 4.2rem; line-height: 1;
  background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.crear-drop-texto { font-size: 1.15rem; margin: 0; }
.crear-drop-ayuda { font-size: .78rem; color: #8e8e8e; margin: 0; max-width: 340px; }
.arrastrando .crear-drop { background: #fff5f8; outline: 2px dashed #dc2743; outline-offset: -12px; }

.crear-detalle { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); min-height: 420px; }
.crear-vista {
  background: #0b0b0f; display: flex; align-items: center; justify-content: center;
  min-height: 300px; max-height: 70vh; overflow: hidden;
}
.crear-vista img, .crear-vista video { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; }

.crear-panel { padding: 1rem; display: flex; flex-direction: column; gap: .6rem; border-left: 1px solid #efefef; }
.crear-autor { display: flex; align-items: center; gap: .6rem; }
.crear-autor img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #e9e9ee; }
.crear-panel textarea { border: 0; box-shadow: none; resize: none; padding: .25rem 0; flex: 1; min-height: 140px; }
.crear-contador { text-align: right; font-size: .75rem; color: #8e8e8e; }
.crear-archivo { font-size: .78rem; color: #8e8e8e; border-top: 1px solid #efefef; padding-top: .6rem; word-break: break-all; }

@media (max-width: 767.98px) {
  .crear-detalle { grid-template-columns: 1fr; }
  .crear-panel { border-left: 0; border-top: 1px solid #efefef; }
  .crear-vista { max-height: 45vh; }
  .crear-vista img, .crear-vista video { max-height: 45vh; }
}

/* ===== Cambiar foto o video al editar ===== */
.post-editor-nuevo { display: flex; align-items: center; gap: .7rem; margin-top: .6rem; }
.post-editor-mini { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #0b0b0f; flex-shrink: 0; }
.post-editor-nuevo-texto { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: .85rem; }
.post-editor-nuevo-texto span { font-size: .75rem; color: #8e8e8e; }

/* ===== Seguimiento y cuentas privadas ===== */
.perfil-botones { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.perfil-stat-boton { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.perfil-stat-boton:hover { opacity: .65; }
.perfil-privada-nota { font-size: .82rem; color: #8e8e8e; margin-bottom: .3rem; }
.badge-solicitudes {
  display: inline-block; margin-left: .4rem; padding: .05rem .45rem;
  border-radius: 10px; background: #ed4956; color: #fff; font-size: .7rem; font-weight: 700;
}

.perfil-privado { grid-column: 1 / -1; text-align: center; padding: 3.5rem 1rem; }
.perfil-privado i { display: block; font-size: 3.2rem; line-height: 1; margin-bottom: .8rem; color: #262626; }
.perfil-privado p { color: #8e8e8e; margin: 0; }

.editar-privada { background: #fafafa; border-radius: 14px; padding: .8rem 1rem; }

.modal-lista-body { min-height: 140px; }
.usuario-fila { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.usuario-fila-enlace {
  display: flex; align-items: center; gap: .8rem;
  flex: 1; min-width: 0; color: inherit; text-decoration: none;
}
.usuario-fila-enlace:hover .usuario-fila-usuario { text-decoration: underline; }
.usuario-fila-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #e9e9ee; flex-shrink: 0; }
.usuario-fila-textos { min-width: 0; }
.usuario-fila-usuario { display: flex; align-items: center; gap: .3rem; font-size: .9rem; font-weight: 600; line-height: 1.2; }
.usuario-fila-usuario .verified-badge { margin-left: 0; font-size: .85rem; }
.usuario-fila-sub { font-size: .8rem; color: #8e8e8e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usuario-fila-acciones { display: flex; gap: .4rem; flex-shrink: 0; }

.btn-seguir-mini.siguiendo { color: #8e8e8e; }

/* ===== Globito de notificaciones en el menú ===== */
.nav-item-ib { position: relative; }
.nav-badge {
  position: absolute; top: .3rem; left: 1.65rem;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #ed4956; color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
}

/* ===== Panel lateral (notificaciones, búsqueda) ===== */
#panel-fondo { position: fixed; inset: 0; z-index: 18; }
#panel-lateral {
  position: fixed; top: 0; bottom: 0; left: var(--sb); width: 400px; z-index: 19;
  display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid #efefef; box-shadow: 4px 0 24px rgba(0, 0, 0, .08);
  opacity: 0; visibility: hidden; transform: translateX(-12px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
#panel-lateral.abierto { opacity: 1; visibility: visible; transform: none; }
.panel-cabecera { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.3rem .7rem; }
.panel-cabecera h2 { margin: 0; font-size: 1.4rem; font-weight: 700; }
.panel-cerrar { border: 0; background: none; padding: .2rem .4rem; font-size: 1.1rem; color: #8e8e8e; }
.panel-cerrar:hover { color: #262626; }
.panel-cuerpo { flex: 1; overflow-y: auto; padding: .3rem 0 1rem; }
.panel-vacio { text-align: center; color: #8e8e8e; padding: 3rem 1.5rem; font-size: .9rem; margin: 0; }

@media (max-width: 991.98px) {
  #panel-lateral { left: 0; right: 0; width: auto; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); transform: translateY(8px); }
  #panel-lateral.abierto { transform: none; }
}

/* ===== Notificaciones ===== */
.notif { display: flex; align-items: center; gap: .6rem; padding: .55rem 1.3rem; }
.notif:hover { background: #fafafa; }
.notif.no-leida { background: #f1f7ff; }
.notif-enlace { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.notif-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #e9e9ee; flex-shrink: 0; }
.notif-texto { flex: 1; min-width: 0; font-size: .88rem; line-height: 1.35; word-break: break-word; }
.notif-texto strong { font-weight: 600; }
.notif-texto .verified-badge { margin-left: .2rem; font-size: .8rem; }
.notif-extra { color: #8e8e8e; }
.notif-tiempo { margin-left: .35rem; color: #8e8e8e; font-size: .78rem; white-space: nowrap; }
.notif-mini { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #0b0b0f; flex-shrink: 0; }
.notif-acciones { display: flex; gap: .4rem; flex-shrink: 0; font-size: .8rem; }
