/* ============================================
   VARIABLES MODO CLARO/OSCURO
   ============================================ */
:root {
    --bh-bg: #ffffff;
    --bh-strip-bg: transparent;
    --bh-name-color: #444444;
    --bh-modal-bg: #ffffff;
    --bh-modal-border: #f0f0f0;
    --bh-modal-text: #333333;
    --bh-cancel-bg: #f0f0f0;
    --bh-cancel-text: #444444;
    --bh-submit-bg: #F1928D;
    --bh-submit-text: #ffffff;
    --bh-skeleton-bg: #e0e0e0;
    --bh-visor-bg: rgba(0, 0, 0, 0.92);
}

.dark {
    --bh-bg: #363636;
    --bh-name-color: #cccccc;
    --bh-modal-bg: #2a2a2a;
    --bh-modal-border: #444444;
    --bh-modal-text: #f0f0f0;
    --bh-cancel-bg: #444444;
    --bh-cancel-text: #cccccc;
    --bh-skeleton-bg: #555555;
    --bh-visor-bg: rgba(0, 0, 0, 0.96);
}

/* ============================================
   WRAPPER Y TIRA
   ============================================ */
.bh-wrapper {
    position: relative;
    width: 100%;
    background: var(--bh-strip-bg);
}

.perfil-titulo {
    z-index: 10 !important;
}

.bh-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px 10px;
    overflow-x: auto;
}

.bh-strip::-webkit-scrollbar {
    height: 6px;
}

.bh-strip::-webkit-scrollbar-track {
    background: transparent;
}

.bh-strip::-webkit-scrollbar-thumb {
    background: #F1928D;
    border-radius: 10px;
}

.bh-strip::-webkit-scrollbar-thumb:hover {
    background: #e6683c;
}

/* ============================================
   BURBUJAS
   ============================================ */
.bh-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.bh-bubble:hover {
    transform: scale(1.05);
}

.bh-bubble__ring {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.bh-bubble__ring--visto {
    background: #aaaaaa;
}

.bh-bubble__ring--empty {
    background: #cccccc;
}

.bh-bubble__ring--skeleton {
    background: var(--bh-skeleton-bg);
    animation: bh-pulse 1.5s infinite;
}

.bh-bubble__avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #F1928D;
    border: 2.5px solid var(--bh-bg, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bh-bubble__avatar--skeleton {
    background: var(--bh-skeleton-bg);
}

.bh-bubble__inicial {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.bh-bubble__name {
    font-size: 11px;
    color: var(--bh-name-color);
    max-width: 66px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bh-bubble__name--skeleton {
    width: 48px;
    height: 10px;
    background: var(--bh-skeleton-bg);
    border-radius: 4px;
    animation: bh-pulse 1.5s infinite;
}

.bh-bubble--mine {
    position: relative;
}

.bh-bubble__add-btn {
    position: absolute;
    bottom: 20px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #F1928D;
    border: 2px solid var(--bh-bg, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.bh-bubble__add-btn span {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-top: -1px;
}

.bh-bubble__add-btn:hover {
    background: #e6683c;
    transform: scale(1.15);
}

/* ============================================
   VISOR FULLSCREEN
   ============================================ */
.bh-visor {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bh-visor-bg);
}

.bh-visor__bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.05) 0%, transparent 80%);
    pointer-events: none;
}

.bh-visor__overlay-close {
    position: absolute;
    inset: 0;
    z-index: 0;
    cursor: pointer;
}

.bh-visor__card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bh-visor__card--main {
    width: min(400px, 88vw);
    height: min(700px, 88vh);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    display: flex;
    /* <-- AGREGA */
    flex-direction: column;
    /* <-- AGREGA */
}

.bh-visor__card--prev,
.bh-visor__card--next {
    width: min(200px, 20vw);
    height: min(340px, 44vh);
    border-radius: 16px;
    overflow: hidden;
    opacity: 0.55;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.bh-visor__card--prev {
    margin-right: -20px;
}

.bh-visor__card--next {
    margin-left: -20px;
}

.bh-visor__card--prev:hover,
.bh-visor__card--next:hover {
    opacity: 0.75;
    transform: scale(1.02);
}

.bh-visor__card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F1928D, #e6683c);
}

.bh-visor__card-text-preview {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    text-align: center;
    padding: 12px;
    font-style: italic;
}

.bh-visor__card-user-info {
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    z-index: 5;
}

.bh-visor__card-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #F1928D;
    background-size: cover;
    background-position: center;
    border: 2px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.bh-visor__card-inicial {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.bh-visor__card-name-overlay {
    color: rgba(255, 255, 255, 0.95);
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
    text-align: center;
    max-width: 90%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bh-visor__progress-bars {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    gap: 3px;
    padding: 10px 12px 0;
}

.bh-visor__bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    overflow: hidden;
}

.bh-visor__bar-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.bh-visor__header {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
}

.bh-visor__user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bh-visor__avatar-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
}

.bh-visor__avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #F1928D;
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bh-visor__avatar-inicial {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.bh-visor__user-info {
    display: flex;
    flex-direction: column;
}

.bh-visor__username {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.bh-visor__time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
}

.bh-visor__actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bh-visor__btn {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.bh-visor__btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

.bh-visor__btn--close {
    background: transparent;
    font-size: 22px;
    padding: 4px 8px;
}

.bh-visor__btn--pausa {
    min-width: 40px;
    font-size: 14px;
    line-height: 1;
}

.bh-visor__btn--vistas {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 5px;
}

.bh-visor__btn--vistas:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bh-visor__content {
    width: 100%;
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    padding: 76px 75px 24px 75px;
    /* Padding ajustado, sin hack de padding-bottom */
}

.bh-visor__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bh-visor__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    z-index: 15;
    /* <-- sube el z-index por encima del texto (z-index: 2) */
    padding: 8px 14px;
    border-radius: 50%;
    line-height: 1;
    transition: background 0.2s;
    pointer-events: all;
    width: 46px;
    height: 46px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bh-visor__nav--prev {
    left: 12px;
}

.bh-visor__nav--next {
    right: 12px;
}

/* ============================================
   ZONA INFERIOR — Reacciones + Responder
   ============================================ */
.bh-visor__bottom {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
}

.bh-visor__acciones-ig {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 18px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
}

.bh-ig-input-fake {
    flex: 1;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    padding: 9px 16px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    cursor: text;
    backdrop-filter: blur(4px);
    background: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 0.2s, background 0.2s;
}

.bh-ig-input-fake:hover {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
}

.bh-ig-reaction-wrap {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bh-ig-reaction-wrap::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 22px;
    z-index: 28;
    pointer-events: auto;
}

.bh-ig-reaction-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(6px) scale(0.88);
    background: rgba(30, 30, 30, 0.92);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bh-ig-reaction-popover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 6px;
    background: rgba(30, 30, 30, 0.92);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.bh-ig-reaction-wrap:hover .bh-ig-reaction-popover {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0) scale(1);
}

.bh-ig-reaction-popover__btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 24px;
    font-size: 26px;
    line-height: 1;
    transition: background 0.15s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bh-ig-reaction-popover__btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.2);
}

.bh-ig-reaction-popover__btn--activa {
    background: rgba(255, 255, 255, 0.18);
}

.bh-ig-heart-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    padding: 4px;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bh-ig-heart-btn:hover {
    transform: scale(1.15);
}

.bh-ig-heart-btn--activa {
    animation: bh-heart-pop 0.35s ease;
}

@keyframes bh-heart-pop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.45);
    }

    70% {
        transform: scale(0.9);
    }

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

.bh-ig-share-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    opacity: 0.9;
    transition: opacity 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bh-ig-share-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.bh-reaccion-animando {
    display: inline-block;
    animation: bh-reaccion-bounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes bh-reaccion-bounce {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.7) rotate(-12deg);
    }

    55% {
        transform: scale(1.2) rotate(8deg);
    }

    80% {
        transform: scale(1.4) rotate(-4deg);
    }

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

/* ============================================
   INPUT RESPONDER
   ============================================ */
.bh-responder {
    padding: 12px 12px 18px;
}

.bh-responder__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 32px;
    padding: 6px 6px 6px 10px;
}

.bh-responder__avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #F1928D;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.bh-responder__avatar-inicial {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.bh-responder__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    caret-color: #F1928D;
}

.bh-responder__input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.bh-responder__send {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #F1928D;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
}

.bh-responder__send:hover:not(:disabled) {
    background: #e6683c;
    transform: scale(1.1);
}

.bh-responder__send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bh-responder__cancel {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.bh-responder__cancel:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bh-responder__spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: bh-spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes bh-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   MODAL BASE
   ============================================ */
.bh-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.bh-modal__box {
    background: var(--bh-modal-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.bh-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--bh-modal-border);
}

.bh-modal__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--bh-modal-text);
}

.bh-modal__close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--bh-modal-text);
    opacity: 0.6;
}

.bh-modal__close:hover {
    opacity: 1;
}

.bh-modal__header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #F1928D;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--bh-modal-border);
}

.bh-modal__body {
    padding: 20px 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bh-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--bh-modal-border);
}

.bh-modal__btn {
    padding: 10px 22px;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s, transform 0.2s;
}

.bh-modal__btn:hover {
    transform: translateY(-1px);
}

.bh-modal__btn--cancel {
    background: var(--bh-cancel-bg);
    color: var(--bh-cancel-text);
}

.bh-modal__btn--submit {
    background: var(--bh-submit-bg);
    color: var(--bh-submit-text);
}

.bh-modal__btn--submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   MODAL CREAR — Canvas
   ============================================ */
.bh-modal__canvas {
    position: relative;
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    height: 270px;
    transition: background 0.4s ease;
    cursor: text;
}

.bh-modal__canvas-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.02) 50%, rgba(0, 0, 0, 0.22) 100%);
}

.bh-modal__canvas-textarea {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: #fff;
    font-size: clamp(16px, 4.8vw, 21px);
    font-weight: 700;
    text-align: center;
    font-family: inherit;
    padding: 32px 24px 60px;
    caret-color: rgba(255, 255, 255, 0.95);
    width: 100%;
    height: 100%;
    z-index: 3;
    line-height: 1.22;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    overflow: hidden;
    text-wrap: balance;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
    padding-left: 55px;
    padding-right: 55px;
    /* (deja el padding-bottom y top que se controlan desde Vue) */
    box-sizing: border-box;
}

.bh-modal__canvas-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.bh-modal__canvas-textarea--fondo-claro::placeholder {
    color: rgba(0, 0, 0, 0.42);
    font-weight: 600;
}

.bh-modal__canvas-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.38) 0%, transparent 100%);
}

.bh-canvas-emoji-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
    transition: transform 0.15s;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

.bh-canvas-emoji-btn:hover {
    transform: scale(1.15);
}

.bh-canvas-char {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
}

.bh-canvas-char--warn {
    color: #ffc94a;
}

.bh-canvas-char--limit {
    color: #ff6b6b;
}

.bh-canvas-emoji-panel {
    position: absolute;
    bottom: 54px;
    left: 12px;
    background: rgba(28, 28, 28, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 10px 8px;
    display: flex;
    flex-wrap: wrap;
    width: 224px;
    gap: 2px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

.bh-canvas-emoji-panel span {
    cursor: pointer;
    padding: 7px 8px;
    font-size: 19px;
    border-radius: 10px;
    transition: background 0.12s;
    line-height: 1;
}

.bh-canvas-emoji-panel span:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   COLORES DE FONDO
   ============================================ */
.bh-modal__colores-section {
    padding: 4px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bh-modal__colores-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--bh-modal-text);
    opacity: 0.35;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bh-modal__colores-fila {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding-bottom: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bh-modal__colores-fila::-webkit-scrollbar {
    display: none;
}

.bh-fondo-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    border: 2.5px solid transparent;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.bh-fondo-dot:hover {
    transform: scale(1.1);
}

.bh-fondo-dot--active {
    border-color: var(--bh-modal-text) !important;
    transform: scale(1.18);
    box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.2);
}

/* ============================================
   MODAL VISTAS
   ============================================ */
.bh-modal--vistas {
    align-items: flex-end;
    padding: 0;
}

.bh-modal__box--vistas {
    border-radius: 24px 24px 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.bh-modal__header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bh-modal__vistas-count {
    font-size: 12px;
    color: var(--bh-modal-text);
    opacity: 0.55;
    font-weight: 500;
}

.bh-modal__vistas-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bh-modal__vistas-body::-webkit-scrollbar {
    width: 4px;
}

.bh-modal__vistas-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

.bh-vista-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--bh-modal-border);
}

.bh-vista-item:last-child {
    border-bottom: none;
}

.bh-vista-item__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #F1928D;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bh-vista-item__inicial {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.bh-vista-item__avatar--skeleton {
    background: var(--bh-skeleton-bg);
    animation: bh-pulse 1.5s infinite;
}

.bh-vista-item__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bh-vista-item__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--bh-modal-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bh-vista-item__name--skeleton {
    height: 12px;
    width: 120px;
    background: var(--bh-skeleton-bg);
    border-radius: 4px;
    animation: bh-pulse 1.5s infinite;
    display: block;
}

.bh-vista-item__user {
    font-size: 12px;
    color: var(--bh-modal-text);
    opacity: 0.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bh-vista-item__time--skeleton {
    height: 10px;
    width: 70px;
    background: var(--bh-skeleton-bg);
    border-radius: 4px;
    animation: bh-pulse 1.5s infinite;
    display: block;
    margin-top: 4px;
}

.bh-vista-item__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #F1928D;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}

.bh-vista-item__time {
    font-size: 11px;
    color: var(--bh-modal-text);
    opacity: 0.45;
    flex-shrink: 0;
}

.bh-vista-item__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.bh-vista-item__reaccion {
    font-size: 16px;
    line-height: 1;
}

.bh-modal__vistas-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    gap: 10px;
    opacity: 0.5;
}

.bh-modal__vistas-empty-icon {
    font-size: 40px;
}

.bh-modal__vistas-empty p {
    font-size: 14px;
    color: var(--bh-modal-text);
    margin: 0;
}

/* ============================================
   TRANSICIONES Y ANIMACIONES
   ============================================ */
.bh-fade-enter-active,
.bh-fade-leave-active {
    transition: opacity 0.25s ease;
}

.bh-fade-enter,
.bh-fade-leave-to {
    opacity: 0;
}

.bh-acciones-fade-enter-active {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.bh-acciones-fade-leave-active {
    transition: opacity 0.15s ease;
}

.bh-acciones-fade-enter {
    opacity: 0;
    transform: translateY(6px);
}

.bh-acciones-fade-leave-to {
    opacity: 0;
}

.bh-responder-slide-enter-active {
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bh-responder-slide-leave-active {
    transition: all 0.2s ease-in;
}

.bh-responder-slide-enter {
    transform: translateY(20px);
    opacity: 0;
}

.bh-responder-slide-leave-to {
    transform: translateY(20px);
    opacity: 0;
}

@keyframes bh-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* =====================================================
   MOBILE: ocultar UI externa mientras historias está abierto
   ===================================================== */
@media (max-width: 600px) {

    html.bh-story-open,
    body.bh-story-open {
        overflow: hidden !important;
        height: 100dvh !important;
        width: 100vw !important;
    }

    body.bh-story-open header,
    body.bh-story-open .nav-main,
    body.bh-story-open .nav-dark,
    body.bh-story-open .titulo-inicio,
    body.bh-story-open .perfil-titulo,
    body.bh-story-open footer,
    body.bh-story-open .footer,
    body.bh-story-open .bottom-nav,
    body.bh-story-open .menu-lateral,
    body.bh-story-open .sidebar__crear {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    body.bh-story-open .bh-visor {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        z-index: 2147483647 !important;
        overflow: hidden !important;
    }

    body.bh-story-open .bh-visor__card--main {
        width: 100vw !important;
        height: 100dvh !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    body.bh-story-open .bh-visor__card--prev,
    body.bh-story-open .bh-visor__card--next {
        display: none !important;
    }

}

@media (max-width: 600px) {
    body.bh-story-open .bh-modal {
        position: fixed !important;
        inset: 0 !important;
        z-index: 2147483647 !important;
        width: 100vw !important;
        height: 100dvh !important;
        padding: 14px !important;
        overflow-y: auto !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    body.bh-story-open .bh-modal__box {
        width: 100% !important;
        max-width: 420px !important;
        max-height: calc(100dvh - 28px) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        border-radius: 22px !important;
    }

    body.bh-story-open .bh-modal__body {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        padding: 14px !important;
        gap: 12px !important;
    }

    body.bh-story-open .bh-modal__canvas {
        height: clamp(260px, 48dvh, 390px) !important;
        flex-shrink: 0 !important;
    }

    body.bh-story-open .bh-modal__footer {
        flex-shrink: 0 !important;
        padding: 12px 14px !important;
    }

    body.bh-story-open .bh-modal__btn {
        white-space: nowrap !important;
    }
}

/* ── Mini-card del blogui en el modal de crear historia ────────────────── */
.bh-blogui-card-preview {
    position: relative;
    margin: 0 0 14px 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(241, 146, 141, 0.45);
    padding: 12px 36px 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    backdrop-filter: blur(4px);

    text-decoration: none;
}

.bh-blogui-card-preview__inner {
    flex: 1;
    min-width: 0;
}

.bh-blogui-card-preview__header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
}

.bh-blogui-card-preview__avatar {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    /* ← asegura que el SVG se vea bien */
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    /* SIN background: #F1928D aquí */
}

.bh-blogui-card-preview__autor {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bh-blogui-card-preview__link-icon {
    margin-left: auto;
    flex-shrink: 0;
}

.bh-blogui-card-preview__titulo {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bh-blogui-card-preview__extracto {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

.bh-blogui-card-preview__remove {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    transition: color .2s;
}

.bh-blogui-card-preview__remove:hover {
    color: #fff;
}

/* ── Mini-card del blogui en el VISOR de historias ─────────────────────── */
.bh-visor__blogui-card {
    position: absolute;
    bottom: 80px;
    /* justo encima de los botones de reacción */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 340px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-decoration: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 10;
    cursor: pointer;
}

.bh-visor__blogui-card:hover {
    background: rgba(0, 0, 0, 0.72);
    transform: translateX(-50%) translateY(-2px);
}

/* Barra de color coral en la parte superior */
.bh-visor__blogui-card__bar {
    height: 3px;
    background: linear-gradient(90deg, #F1928D, #e6683c);
    flex-shrink: 0;
}

.bh-visor__blogui-card__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px 12px;
}

.bh-visor__blogui-card__autor {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.bh-visor__blogui-card__titulo {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bh-visor__blogui-card__extracto {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bh-visor__blogui-card__cta {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #F1928D;
    letter-spacing: 0.2px;
}

/* Ajuste: si la historia NO tiene contenido de texto, bajar un poco la card */
.bh-visor__content:not(:has(.bh-visor__text)) .bh-visor__blogui-card {
    bottom: 70px;
}

@media (min-width: 601px) {
    .bh-visor__text {
        font-size: clamp(17px, 2.2vw, 28px);
    }
}

/* Responsive: en pantallas angostas reduce el espacio lateral,
   pero mantén una zona mínima de seguridad */
@media (max-width: 480px) {

    .bh-visor__content,
    .bh-modal__canvas-textarea {
        /* <-- ¡Agregamos el modal aquí! */
        padding-left: 58px !important;
        padding-right: 58px !important;
    }

    .bh-visor__nav {
        width: 42px;
        height: 42px;
        font-size: 32px;
    }

    .bh-visor__nav--prev {
        left: 8px;
    }

    .bh-visor__nav--next {
        right: 8px;
    }
}

.bh-visor__username--clickable {
    cursor: pointer;
}

.bh-visor__username--clickable:hover {
    text-decoration: underline;
}

/* Contenedor para centrar la historia en el modal */
.bh-modal__canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    /* Reducimos el margen para ahorrar espacio */
}

/* 1. Hacemos la preview más grande (más ancha = más alta por el aspect-ratio) */

.bh-modal__canvas--vertical {
    width: min(400px, 88vw);
    /* 1. ¡Ancho EXACTAMENTE IGUAL al del visor! */
    height: 500px;
    /* 2. Una altura fija para que mantenga forma de celular */
    max-height: 55vh;
    /* 3. Límite para que no desborde en pantallas de laptop */
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    margin: 0 auto;
}

/* 2. Limpiamos el Textarea para que los estilos dinámicos de Vue funcionen */
/* 2. Limpiamos el Textarea para que los estilos dinámicos de Vue funcionen */
.bh-modal__canvas--vertical .bh-modal__canvas-textarea {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    resize: none;
    text-align: center;
    box-sizing: border-box;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    font-family: inherit;
    font-weight: 700;

    /* ¡AQUÍ ESTÁN LOS CULPABLES! Cámbialos a 55px */
    padding-left: 65px;
    padding-right: 65px;

    padding-bottom: 60px;
    /* Evita que el texto choque con los botones de abajo */
    z-index: 3;
}

/* Asegurar que la barra de emojis y caracteres se quede abajo */
.bh-modal__canvas--vertical .bh-modal__canvas-bar {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.bh-color-picker-btn {
    background: var(--bh-cancel-bg);
    color: var(--bh-modal-text);
    border: none;
    padding: 10px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s, transform 0.2s;
}

.bh-color-picker-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.bh-color-popover {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    background: var(--bh-modal-bg);
    border: 1px solid var(--bh-modal-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 16px;
    z-index: 50;
    width: 230px;
    /* Ancho para que queden en cuadrícula */
}

.bh-color-popover::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 30px;
    width: 12px;
    height: 12px;
    background: var(--bh-modal-bg);
    border-bottom: 1px solid var(--bh-modal-border);
    border-right: 1px solid var(--bh-modal-border);
    transform: rotate(45deg);
}

.bh-color-popover__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* Reutilizamos el estilo de las bolitas */
.bh-fondo-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    border: 2.5px solid transparent;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.bh-fondo-dot:hover {
    transform: scale(1.15);
}

.bh-fondo-dot--active {
    border-color: var(--bh-modal-text) !important;
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.2);
}

/* Centrado absoluto para la mini-card DENTRO del canvas de creación */
.bh-blogui-card-preview--inside {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    /* Para que deje un buen margen a los lados */
    margin: 0;
    /* Reseteamos el margen original */
    z-index: 5;
    /* Aseguramos que quede por encima del fondo y el texto */

    /* Le damos un fondo oscuro translúcido estilo "cristal" para que contraste sobre cualquier color */
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.bh-visor__nav {
    pointer-events: all;
    isolation: isolate;
    /* crea nuevo stacking context */
}

.bh-visor__content {
    isolation: isolate;
    /* aísla el contenido del texto */
}

.bh-visor__text {
    white-space: pre-line;
    text-align: center;
    word-break: break-word;

    /* ¡Nuevas reglas para clonar el diseño del modal! */
    font-weight: 700;
    line-height: 1.22;
    text-wrap: balance;
    width: 100%;
}

/* ========================================================
   NAVEGACIÓN DE HISTORIAS (BORDES Y MOBILE)
   ======================================================== */

/* Quitamos el overflow hidden a la tarjeta principal para que los botones puedan sobresalir */
.bh-visor__card--main {
    overflow: visible !important;
}

/* Aplicamos el recorte y borde curvo directamente al contenido y a la zona de comentarios */
.bh-visor__content {
    border-radius: 20px !important;
    overflow: hidden !important;
}

/* Posicionar las flechas mitad adentro, mitad afuera (23px es la mitad de los 46px que miden) */
.bh-visor__nav--prev {
    left: -65px !important;
}

.bh-visor__nav--next {
    right: -65px !important;
}

/* Ocultar las flechas visuales en teléfonos (ya que ahora navegarán tocando la pantalla) */
@media (max-width: 600px) {
    .bh-visor__nav {
        display: none !important;
    }
}

/* ========================================================
   MOBILE FIX: HISTORIAS PANTALLA COMPLETA (SIN BORDES)
   ======================================================== */
@media (max-width: 600px) {

    /* 1. Forzar que el visor empiece desde el tope de la pantalla */
    .bh-visor {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 100dvh !important;
        width: 100vw !important;
    }

    /* 2. La tarjeta principal debe abarcar todo el alto y ancho exacto */
    body.bh-story-open .bh-visor__card--main,
    .bh-visor__card--main {
        width: 100vw !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    /* 3. Quitar las esquinas redondeadas del contenido y forzar que estire */
    .bh-visor__content {
        border-radius: 0 !important;
        height: 100% !important;
    }

    /* 4. Quitar esquinas redondeadas de la zona de comentarios inferior */
    .bh-visor__bottom {
        border-radius: 0 !important;
    }
}

/* ========================================================
   TEXTO DE HISTORIA: responsive via flex en vez de padding
   ======================================================== */
.bh-visor__text {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Cuando NO hay blogui, el texto debe centrarse verticalmente */
.bh-visor__content:not(:has(.bh-blogui-card-preview)) .bh-visor__text {
    position: absolute;
    inset: 76px 0 92px 0;
    /* respeta header y bottom bar */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    height: auto;
}

/* ========================================================
   LAYOUT FLEX VERTICAL DEL VISOR: blogui + texto
   ======================================================== */
.bh-visor__content-layout {
    position: absolute;
    inset: 76px 0 92px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 56px 12vh;
    /* Margen inferior para subirlo un poco si hay texto */
    box-sizing: border-box;
    gap: 16px;
    z-index: 2;
    pointer-events: none;
}

/* 🆕 ¡NUEVA REGLA! AGREGAR JUSTO DEBAJO */
/* Si no hay texto, quitamos el espacio inferior para que la card se centre perfectamente */
.bh-visor__content-layout:not(:has(.bh-visor__text)) {
    padding-bottom: 0;
}

/* La card del blogui toma su tamaño natural */
.bh-blogui-card-preview--visor {
    position: static !important;
    transform: none !important;
    width: 100%;
    max-width: 340px;
    pointer-events: all;
    flex-shrink: 0;
    margin-top: 16px;
}

/* El texto ocupa el espacio restante y se centra dentro de él */
.bh-visor__content-layout .bh-visor__text {
    flex: 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    height: auto;
    pointer-events: none;
}

/* Sin blogui: el layout también centra verticalmente */
.bh-visor__content-layout:not(:has(.bh-blogui-card-preview--visor)) .bh-visor__text {
    justify-content: center !important;
    align-items: center !important;
}