﻿/* Sir Linselot Container */
#sir-linselot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-base), "Inter", sans-serif;
    pointer-events: none; /* Allows clicking through the empty space */
    transition: right 0.1s ease-out, bottom 0.1s ease-out; /* Smooth drag snap if bounded */
}

/* Character */
#linselot-character {
    width: 120px;
    height: 120px;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: none;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2)); /* We use drop-shadow instead of box-shadow to shadow the actual image shape */
}

#linselot-character:active {
    cursor: grabbing;
}

#linselot-character:hover, #linselot-character.is-hovered {
    animation: idle-squish 0.6s ease-in-out forwards !important;
}

/* JavaScript triggers classes instead of inline styles */
#linselot-character.anim-spin { animation: idle-spin 1s ease-in-out; }
#linselot-character.anim-hop { animation: idle-hop 0.5s ease-in-out; }
#linselot-character.anim-squish { animation: idle-squish 0.8s ease-in-out; }
#linselot-character.anim-jiggle { animation: happy-jiggle 0.6s ease-in-out; }
#linselot-character.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes happy-jiggle {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.15) rotate(-10deg); }
    50% { transform: scale(1.15) rotate(10deg); }
    75% { transform: scale(1.15) rotate(-10deg); }
    100% { transform: scale(1.1) rotate(0deg); }
}

@keyframes idle-spin {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

@keyframes idle-hop {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes idle-squish {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1, 0.9); }
}

.linselot-icon {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Cute eyes for the camera */
.linselot-eyes {
    position: absolute;
    top: 31px; /* Adjust according to the robot lens inside your webp */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 21px;
    pointer-events: none; /* Keep eyes unclickable */
}

.linselot-eye {
    width: 23px;
    height: 23px;
    background-color: white;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    animation: blink 5s ease-in-out infinite;
    transform-origin: 50% 65%;
}

.linselot-eye::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(calc(-50% + var(--pupil-x, 0px)), calc(-50% + var(--pupil-y, 0px)));
    transition: transform 0.05s linear;
}

@keyframes blink {
    0%, 88%, 92%, 96%, 100% { transform: scaleY(1); }
    90%, 98% { transform: scaleY(0.05); }
}

@keyframes bounceIn {
    0% { transform: translateY(100px) scale(0.5); opacity: 0; }
    60% { transform: translateY(-10px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Speech Bubble */
#linselot-bubble {
    background: white;
    border-radius: 16px;
    width: 280px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    margin-bottom: 15px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    visibility: hidden;
    position: relative;
    border: 1px solid var(--color-glass-border, rgba(0,0,0,0.05));
}

#linselot-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 25px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: white transparent transparent transparent;
    display: block;
    width: 0;
}

#sir-linselot-container.open #linselot-bubble {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

.linselot-header {
    background: var(--color-accent-soft, #f7f3f0);
    padding: 12px 16px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.linselot-header strong {
    color: var(--color-charcoal, #333);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

#linselot-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-charcoal-soft, #666);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

#linselot-close:hover {
    color: var(--color-danger, #dc3545);
}

.linselot-content {
    padding: 16px;
    font-size: 14px;
    color: var(--color-charcoal, #333);
    line-height: 1.5;
}

.linselot-content p {
    margin-bottom: 10px;
}

.linselot-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.linselot-btn {
    background: var(--color-glass, rgba(255,255,255,0.8));
    border: 1px solid var(--color-accent, #c49a7c);
    color: var(--color-accent, #c49a7c);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
    width: 100%;
}

.linselot-btn:hover {
    background: var(--color-accent, #c49a7c);
    color: white;
    text-decoration: none;
}

.linselot-btn-primary {
    background: var(--color-accent, #c49a7c);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(196, 154, 124, 0.2);
}

.linselot-btn-primary:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(196, 154, 124, 0.3);
}

.linselot-btn-whatsapp {
    border-color: #25D366;
    color: #25D366;
}

.linselot-btn-whatsapp:hover {
    background: #25D366;
    color: white;
}

.linselot-btn-secondary {
    border-color: var(--color-glass-border, #e0e0e0);
    color: var(--color-charcoal-soft, #666);
    text-align: center;
    margin-top: 4px;
}

.linselot-btn-secondary:hover {
    background: var(--color-charcoal-soft, #666);
    color: white;
}

.linselot-trivia-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, var(--color-accent, #c49a7c), #e8b89a);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 20px;
}

/* Sleep Bubble (Zzzzz) */
#linselot-bubble.sleep-bubble {
    width: auto;
    min-width: 140px;
    max-width: 160px;
    background: white;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 20px;
    border: none;
}

#linselot-bubble.sleep-bubble .linselot-header {
    display: none;
}

#linselot-bubble.sleep-bubble #linselot-content-sleep {
    padding: 16px 20px !important;
    background: white;
    border-radius: 16px;
    margin: 0;
}

#linselot-bubble.sleep-bubble #linselot-content-sleep p {
    font-size: 28px !important;
    letter-spacing: 6px !important;
    color: var(--color-charcoal, #333);
    font-weight: 600;
    margin: 0 !important;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

/* Sleep bubble arrow/tail */
#linselot-bubble.sleep-bubble::after {
    content: '';
    position: absolute;
    bottom: -12px;
    right: 30px;
    border-width: 12px 12px 0;
    border-style: solid;
    border-color: white transparent transparent transparent;
    display: block;
    width: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

@keyframes float-up {
    0% { opacity: 0; transform: translateY(15px); }
    8% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-25px); }
}

#linselot-bubble.sleep-bubble {
    animation: float-up 3.2s ease-out forwards !important;
}
