/* =====================================================
   SITE PET STYLES
   Sprite pet and thought bubble animations
   ===================================================== */

/* ========================================
   SITE PET (KITTY SPRITE)
======================================== */
.site-pet {
    position: fixed;
    bottom: 0;
    left: 30px;
    z-index: 60;
    overflow: hidden;
    pointer-events: auto;
}

/* Responsive adjustments for pet */
@media (max-width: 768px) {
    .site-pet {
        left: 15px;
        transform: scale(0.7);
        transform-origin: bottom left;
    }
}

@media (max-width: 480px) {
    .site-pet {
        left: 10px;
        transform: scale(0.5);
        transform-origin: bottom left;
    }
}

/* ========================================
   THOUGHT BUBBLE - Fluffy Cloud Style
======================================== */
.pet-thought-bubble {
    position: fixed;
    z-index: 61;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.9);
    transition: opacity 0.4s cubic-bezier(0.37, 0, 0.63, 1), 
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pet-thought-bubble.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Thought Cloud - Fluffy Bubble */
.thought-cloud {
    display: flex;
    background: linear-gradient(
        160deg,
        #E8E0F7 0%,
        #DDD6F3 50%,
        #E8E0F7 100%
    );
    padding: 18px 26px;
    border-radius: 9999px;
    min-width: 50px;
    max-width: 240px;
    min-height: 50px;
    position: relative;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: cloudFloat 5s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.thought-cloud::before,
.thought-cloud::after {
    content: "";
    background: linear-gradient(
        160deg,
        #E8E0F7 0%,
        #DDD6F3 100%
    );
    border-radius: 9999px;
    display: block;
    position: absolute;
    z-index: -1;
}

.thought-cloud::before {
    width: 52px;
    height: 52px;
    top: -14px;
    left: 32px;
    box-shadow: -55px 35px 0 -14px #DDD6F3;
    animation: bumpFloat1 4s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.thought-cloud::after {
    bottom: -12px;
    right: 30px;
    width: 36px;
    height: 36px;
    box-shadow: 
        45px -38px 0 0 #E8E0F7,
        -32px -8px 0 -2px #DDD6F3,
        -28px 20px 0 -6px #E8E0F7,
        -6px 30px 0 -12px #DDD6F3;
    animation: bumpFloat2 4.5s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

@keyframes cloudFloat {
    0%, 100% { 
        transform: translateY(0) translateX(0);
    }
    20% {
        transform: translateY(-4px) translateX(2px);
    }
    40% { 
        transform: translateY(-6px) translateX(-1px);
    }
    60% {
        transform: translateY(-3px) translateX(-2px);
    }
    80% {
        transform: translateY(-5px) translateX(1px);
    }
}

@keyframes bumpFloat1 {
    0%, 100% { 
        transform: translateY(0) scale(1);
    }
    50% { 
        transform: translateY(-2px) scale(1.03);
    }
}

@keyframes bumpFloat2 {
    0%, 100% { 
        transform: translateY(0) scale(1);
    }
    50% { 
        transform: translateY(2px) scale(0.97);
    }
}

.thought-text {
    font-family: 'Varela Round', 'Nunito', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: #6B5B8A;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

/* Thought Dots - Floating bubbles */
.thought-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.thought-dots .dot {
    background: linear-gradient(
        145deg,
        #E8E0F7 0%,
        #DDD6F3 100%
    );
    border-radius: 9999px;
}

.thought-dots .dot-1 {
    width: 18px;
    height: 18px;
    animation: bubbleFloat1 3.5s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.thought-dots .dot-2 {
    width: 13px;
    height: 13px;
    animation: bubbleFloat2 3s cubic-bezier(0.37, 0, 0.63, 1) infinite;
    animation-delay: 0.2s;
}

.thought-dots .dot-3 {
    width: 9px;
    height: 9px;
    animation: bubbleFloat3 2.8s cubic-bezier(0.37, 0, 0.63, 1) infinite;
    animation-delay: 0.4s;
}

@keyframes bubbleFloat1 {
    0%, 100% { 
        transform: translateY(0) translateX(0);
    }
    33% {
        transform: translateY(-3px) translateX(2px);
    }
    66% { 
        transform: translateY(-1px) translateX(-2px);
    }
}

@keyframes bubbleFloat2 {
    0%, 100% { 
        transform: translateY(0) translateX(0);
    }
    33% {
        transform: translateY(-2px) translateX(-1px);
    }
    66% { 
        transform: translateY(-3px) translateX(1px);
    }
}

@keyframes bubbleFloat3 {
    0%, 100% { 
        transform: translateY(0) translateX(0);
    }
    33% {
        transform: translateY(-1px) translateX(1px);
    }
    66% { 
        transform: translateY(-2px) translateX(-1px);
    }
}

/* ========================================
   DARK MODE THOUGHT BUBBLE
======================================== */
[data-theme="dark"] .thought-cloud {
    background: linear-gradient(
        160deg,
        #3D3458 0%,
        #352F4A 50%,
        #3D3458 100%
    );
}

[data-theme="dark"] .thought-cloud::before,
[data-theme="dark"] .thought-cloud::after {
    background: linear-gradient(
        160deg,
        #3D3458 0%,
        #352F4A 100%
    );
}

[data-theme="dark"] .thought-cloud::before {
    box-shadow: -50px 30px 0 -12px #352F4A;
}

[data-theme="dark"] .thought-cloud::after {
    box-shadow: 
        40px -34px 0 0 #3D3458,
        -28px -6px 0 -2px #352F4A,
        -24px 17px 0 -6px #3D3458,
        -5px 25px 0 -10px #352F4A;
}

[data-theme="dark"] .thought-text {
    color: #C4B8E0;
}

[data-theme="dark"] .thought-dots .dot {
    background: linear-gradient(
        145deg,
        #3D3458 0%,
        #352F4A 100%
    );
}

/* ========================================
   RESPONSIVE THOUGHT BUBBLE
======================================== */
@media (max-width: 768px) {
    .thought-cloud {
        padding: 12px 16px;
        min-width: 120px;
        max-width: 180px;
        border-radius: 14px;
    }
    
    .thought-text {
        font-size: 12px;
    }
    
    .thought-dots .dot-1 { width: 12px; height: 12px; }
    .thought-dots .dot-2 { width: 8px; height: 8px; }
    .thought-dots .dot-3 { width: 5px; height: 5px; }
}

@media (max-width: 480px) {
    .thought-cloud {
        padding: 10px 14px;
        min-width: 100px;
        max-width: 150px;
    }
    
    .thought-text {
        font-size: 11px;
    }
}

/* ========================================
   REDUCED MOTION
======================================== */
@media (prefers-reduced-motion: reduce) {
    .thought-dots .dot,
    .pet-thought-bubble {
        animation: none;
    }
    
    .pet-thought-bubble {
        transition: opacity 0.2s ease;
    }
    
    .pet-thought-bubble.visible {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}
