/* ========================================================
   KOMODO WEB MASCOT - NON-INTRUSIVE STYLES & SKELETAL RIG
   ======================================================== */

/* Root Mascot Container - strictly pointer-events: none */
#komodo-mascot-root {
    position: fixed;
    bottom: 24px;
    left: 20px;
    z-index: 99999;
    pointer-events: none !important;
    user-select: none;
    -webkit-user-select: none;
    font-family: 'Noto Sans Thai', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transform: translateZ(0);
    transition: opacity 0.3s ease, transform 0.2s ease-out;
}

#komodo-mascot-root.is-minimized {
    transform: translateY(170px);
}

#komodo-mascot-root.is-flipped .komodo-character-body {
    transform: scaleX(-1);
}

/* Character Canvas / Container */
.komodo-character-wrap {
    position: relative;
    width: 190px;
    height: 320px;
    display: block;
    pointer-events: none;
}

.komodo-character-canvas {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 190px;
    height: 320px;
    display: block;
    pointer-events: none;
}

/* Minimize / Floating Controls (Interactive elements have pointer-events: auto) */
.komodo-controls {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* ซ่อนปุ่มย่อชั่วคราว */
    gap: 4px;
    z-index: 10;
    pointer-events: auto !important;
}

.komodo-btn-ctrl {
    background: rgba(45, 90, 39, 0.92);
    color: #fff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.komodo-btn-ctrl:hover {
    background: #1a3818;
    transform: scale(1.15);
}

/* Speech Bubble (Interactive for Links/Buttons) */
.komodo-speech-bubble {
    position: absolute;
    bottom: 196px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 220px;
    background: #ffffff;
    border: 2px solid #2d5a27;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    pointer-events: auto !important;
    text-align: left;
}

.komodo-speech-bubble.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Triangle Pointer */
.komodo-speech-bubble::after,
.komodo-speech-bubble::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: solid transparent;
}

.komodo-speech-bubble::after {
    border-color: #ffffff transparent transparent transparent;
    border-width: 7px;
    margin-left: 0;
}

.komodo-speech-bubble::before {
    border-color: #2d5a27 transparent transparent transparent;
    border-width: 9px;
    margin-left: 0;
}

.komodo-bubble-badge {
    display: inline-block;
    background: #eef6ec;
    color: #2d5a27;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.komodo-bubble-text {
    font-size: 12px;
    color: #222222;
    line-height: 1.45;
    margin: 0 0 6px 0;
}

.komodo-bubble-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #2d5a27;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    cursor: pointer;
}

.komodo-bubble-action:hover {
    background: #1a3818;
    color: #ffffff;
    transform: translateY(-1px);
}

.komodo-bubble-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
}

.komodo-bubble-close:hover {
    color: #333;
}

/* Floating Restore Button when Minimized */
#komodo-mascot-restore {
    position: fixed;
    bottom: 12px;
    left: 15px;
    z-index: 99998;
    background: #2d5a27;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s, background 0.2s;
}

#komodo-mascot-restore:hover {
    background: #1a3818;
    transform: translateY(-2px);
}

#komodo-mascot-restore.visible {
    display: inline-flex;
}
