/**
 * GMP Deliberate - Frontend Stylesheet
 */

/* Base sentence wrapper styling */
.gmp-sentence {
    display: inline;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: normal;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* -----------------------------------------
   Highlight Styles
----------------------------------------- */

/* Underline Animation (Drawn) */
.gmp-sentence.gmp-animate-underline {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.18em;
    text-decoration-skip-ink: auto;
    transition: font-weight 0.3s ease;
}
.gmp-sentence.gmp-animate-underline.gmp-highlighted {
    font-weight: 600;
    animation: gmp-draw-underline 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes gmp-draw-underline {
    0% { text-decoration-color: transparent; text-decoration-thickness: 0.5px; }
    100% { text-decoration-color: #09337b; text-decoration-thickness: 2.5px; }
}

/* Background Highlight Fade-in */
.gmp-sentence.gmp-fade-in {
    background: linear-gradient(to bottom, rgba(238, 249, 249, 0) 0%, transparent 60%);
    padding: 2px 0;
    transition: all 0.3s ease;
}
.gmp-sentence.gmp-fade-in.gmp-highlighted {
    background: linear-gradient(to bottom, rgba(238, 249, 249, 1) 0%, rgba(204, 242, 242, 0.4) 70%);
    font-weight: 600;
}

/* Bold Animation */
.gmp-sentence.gmp-bold {
    transition: font-weight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.gmp-sentence.gmp-bold.gmp-highlighted {
    font-weight: 700;
}

/* Letter-by-letter typing animation container */
.gmp-sentence.gmp-letter-by-letter.gmp-highlighted {
    font-weight: 600;
}
.gmp-sentence.gmp-letter-by-letter .gmp-letter {
    display: inline;
    position: relative;
    font-weight: normal;
    background: transparent;
    animation: gmp-letter-typing 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-fill-mode: both;
}
@keyframes gmp-letter-typing {
    0% { font-weight: 400; opacity: 0.6; }
    100% { font-weight: 600; opacity: 1; text-decoration: underline; text-decoration-color: rgba(9, 51, 123, 0.4); text-decoration-thickness: 1.5px; }
}

/* Word wrapper to keep letters cohesive */
.gmp-sentence .gmp-word {
    display: inline-block;
    white-space: nowrap;
}
.gmp-sentence .gmp-letter.gmp-space {
    white-space: pre;
    display: inline;
}

/* -----------------------------------------
   Interactive Capsule Speech Bubble
----------------------------------------- */
.gmp-speech-bubble {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.92);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 6px 14px;
    box-shadow: 0 4px 18px rgba(9, 51, 123, 0.12);
    font-size: 13px;
    font-weight: 600;
    color: #09337b;
    white-space: nowrap;
    cursor: pointer;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.3s;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.3;
}

/* Capsule icon */
.gmp-speech-bubble-icon {
    font-size: 14px;
    color: #00b894;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gmp-pulse-icon 2s infinite ease-in-out;
}
@keyframes gmp-pulse-icon {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.gmp-speech-bubble-text {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
}

.gmp-speech-bubble-text .gmp-bubble-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(5px);
    animation: gmp-bubble-text-in 0.35s ease forwards;
}

.gmp-speech-bubble-text .gmp-bubble-char.gmp-space {
    white-space: pre;
}

@keyframes gmp-bubble-text-in {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Capsule arrow */
.gmp-speech-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
    z-index: 10;
}
.gmp-speech-bubble::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 7px;
    border-style: solid;
    border-color: #cbd5e1 transparent transparent transparent;
    z-index: 9;
}

/* Capsule Active State */
.gmp-sentence.gmp-highlighted .gmp-speech-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Hover Lift */
.gmp-speech-bubble:hover {
    transform: translateX(-50%) translateY(-2px) scale(1.03) !important;
    box-shadow: 0 6px 22px rgba(9, 51, 123, 0.18);
    border-color: #09337b;
}
.gmp-speech-bubble:active {
    transform: translateX(-50%) translateY(0) scale(0.97) !important;
}

/* Links inside highlighted text */
.gmp-sentence a {
    color: inherit !important;
    text-decoration: underline !important;
    font-weight: inherit !important;
}

/* Chat drawer styles: public/chatbot.css (scoped under #gmp-deliberate-chatbot) */
