/* ==========================================================================
   ORI - Mascota 3D Flotante Automática de OralDent
   Archivo: css/ori.css
   ========================================================================== */

   :root {
    --ori-orange: #FB6932;
    --ori-orange-dark: #D94E1A;
    --ori-anger: #E11D48;
    --ori-dark: #1E293B;
}

.ori-track {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 990;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
}

.ori-actor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 190px;
    height: 225px;
    pointer-events: none;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}

.ori-stage {
    width: 100%;
    height: 100%;
    pointer-events: auto;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.22));
}

.ori-stage canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Globo de diálogo de Ori */
.ori-bubble {
    position: absolute;
    bottom: calc(100% - 14px);
    left: 14px;
    width: 245px;
    background: #ffffff;
    color: var(--ori-dark);
    border-radius: 18px;
    padding: 12px 14px 11px;
    box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.24),
                0 4px 12px -2px rgba(251, 105, 50, 0.18);
    border: 2px solid rgba(251, 105, 50, 0.32);
    pointer-events: none;
    opacity: 0;
    transform: translateY(12px) scale(0.86);
    transform-origin: bottom left;
    transition: opacity 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.25s ease;
    z-index: 5;
}

.ori-bubble.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Modo regaño / bravo */
.ori-bubble.is-angry {
    border-color: rgba(225, 29, 72, 0.45);
    box-shadow: 0 16px 36px -6px rgba(225, 29, 72, 0.22),
                0 4px 12px -2px rgba(251, 105, 50, 0.22);
}

/* Alineación cuando Ori sale por la derecha */
.ori-bubble.align-right {
    left: auto;
    right: 14px;
    transform-origin: bottom right;
}

.ori-bubble__header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    padding-right: 18px;
}

.ori-bubble__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    background: #FFF0EB;
    color: var(--ori-orange-dark);
}

.ori-bubble.is-angry .ori-bubble__badge {
    background: #FFE4E6;
    color: var(--ori-anger);
}

.ori-bubble__text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.38;
    font-weight: 800;
    color: #1E293B;
}

.ori-bubble__close {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: #F1F5F9;
    color: #64748B;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease;
}

.ori-bubble__close:hover {
    background: #FFE4E6;
    color: #E11D48;
}

.ori-bubble__progress {
    margin-top: 8px;
    width: 100%;
    height: 3.5px;
    background: #F1F5F9;
    border-radius: 999px;
    overflow: hidden;
}

.ori-bubble__bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #FB6932, #FF8F5E);
    border-radius: 999px;
    transform-origin: left center;
}

.ori-bubble.is-angry .ori-bubble__bar {
    background: linear-gradient(90deg, #E11D48, #FB6932);
}

.ori-bubble__tail {
    position: absolute;
    bottom: -8px;
    left: 38px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-right: 2px solid rgba(251, 105, 50, 0.32);
    border-bottom: 2px solid rgba(251, 105, 50, 0.32);
    transform: rotate(45deg);
}

.ori-bubble.is-angry .ori-bubble__tail {
    border-right-color: rgba(225, 29, 72, 0.45);
    border-bottom-color: rgba(225, 29, 72, 0.45);
}

.ori-bubble.align-right .ori-bubble__tail {
    left: auto;
    right: 38px;
}

/* Ajuste responsivo para móviles y tablets */
@media (max-width: 768px) {
    .ori-actor {
        width: 145px;
        height: 175px;
    }

    .ori-bubble {
        width: 205px;
        padding: 10px 12px 9px;
        bottom: calc(100% - 10px);
        left: 10px;
    }

    .ori-bubble.align-right {
        left: auto;
        right: 10px;
    }

    .ori-bubble__text {
        font-size: 12.2px;
    }

    .ori-bubble__tail {
        left: 28px;
    }

    .ori-bubble.align-right .ori-bubble__tail {
        left: auto;
        right: 28px;
    }
}