/* mascot.css - Styling for the pleasant smiley mascot */

.mascot-container {
    position: fixed;
    top: 100px;
    left: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

.mascot-container.show {
    transform: scale(1);
}

.mascot {
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
}

.mascot:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.mascot svg {
    width: 85%;
    height: 85%;
    overflow: visible;
}

.mascot-body {
    fill: var(--bg-card);
    stroke: var(--accent);
    stroke-width: 1;
}

.mascot-eye {
    fill: var(--accent);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.mascot-eyelid {
    fill: var(--bg-card);
    transition: all 0.3s ease;
}

.mascot-mouth {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4.5;
    stroke-linecap: round;
    transition: d 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mascot-blush {
    fill: #ff8fb1;
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

.mascot-eye-sparkle {
    fill: #ffffff;
    opacity: 0.8;
}

.mascot-dimple {
    fill: var(--accent);
    opacity: 0.4;
}

/* Bubble Message */
.mascot-bubble {
    background: var(--accent);
    color: var(--accent-on);
    padding: 10px 15px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 10px;
    max-width: 200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    position: relative;
    order: 2;
}

.mascot {
    order: 1;
}

.mascot-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Expressions */

/* Happy (Default) */
.mascot.happy .mascot-mouth {
    d: path("M 33 65 Q 50 82 67 65");
}

.mascot.happy .mascot-blush {
    opacity: 0.25;
}

.mascot.happy {
    animation: mascot-float 3s ease-in-out infinite;
}

/* Excited (Add to Cart) */
.mascot.excited {
    animation: mascot-swirl 1s cubic-bezier(0.175, 0.885, 0.32, 1.275), mascot-float 1.5s ease-in-out infinite alternate;
}

.mascot.excited .mascot-mouth {
    d: path("M 30 65 Q 50 92 70 65");
}

.mascot.excited .mascot-blush {
    opacity: 0.5;
}

.mascot.excited .mascot-eye {
    transform: scale(1.15);
}

.mascot.excited .mascot-dimple {
    opacity: 0.6;
}

/* Sad (Remove from Cart) */
.mascot.sad .mascot-mouth {
    d: path("M 35 75 Q 50 68 65 75");
}

.mascot.sad .mascot-dimple {
    opacity: 0;
}

.mascot.sad .mascot-eye {
    transform: translateY(3px) scaleY(0.8);
}

/* Curious (Looking at products) */
.mascot.curious .mascot-mouth {
    d: path("M 44 68 A 6 6 0 1 0 56 68 A 6 6 0 1 0 44 68");
}

.mascot.curious .mascot-eye {
    transform: translateX(var(--look-x, 0)) translateY(var(--look-y, -2px));
}

/* Celebrating (Purchase) */
.mascot.celebrating .mascot-mouth {
    d: path("M 25 62 Q 50 98 75 62");
}

.mascot.celebrating {
    animation: mascot-celebrate 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite, mascot-pop 0.4s ease-out;
}

.mascot.celebrating .mascot-blush {
    opacity: 0.6;
}

.mascot.celebrating .mascot-dimple {
    opacity: 0.6;
    transform: scale(1.2);
}

/* UI Feedback */
.mascot.thinking .mascot-mouth {
    d: path("M 40 70 L 60 70");
}

.mascot.thinking .mascot-eye {
    animation: mascot-think 1s ease-in-out infinite alternate;
}

/* Animations */
@keyframes mascot-blink {

    0%,
    90%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(0.1);
    }
}

@keyframes mascot-celebrate {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    25% {
        transform: translateY(-20px) rotate(-5deg);
    }

    75% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes mascot-think {
    from {
        transform: translateX(-3px);
    }

    to {
        transform: translateX(3px);
    }
}

@keyframes mascot-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes mascot-swirl {
    0% {
        transform: scale(1) rotate(0deg);
    }

    20% {
        transform: scale(1.3) rotate(-20deg);
    }

    50% {
        transform: scale(1.1) rotate(380deg);
    }

    80% {
        transform: scale(1.2) rotate(350deg);
    }

    100% {
        transform: scale(1) rotate(360deg);
    }
}

@keyframes mascot-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2) translateY(-10px);
    }

    100% {
        transform: scale(1);
    }
}

.mascot-eye {
    animation: mascot-blink 4s infinite;
}

/* Theme Adaptive Adjustments */
[data-theme="light"] .mascot {
    background: #ffffff;
    border-color: var(--accent);
}

[data-theme="light"] .mascot-body {
    fill: #ffffff;
}