/* d:\!! PROJECT PIXEL PLAY\pixel_town\public\css\pixi.css */

/* Custom Scrollbar for Pixi Messages */
.pixi-messages::-webkit-scrollbar {
    width: 6px;
}
.pixi-messages::-webkit-scrollbar-track {
    background: transparent;
}
.pixi-messages::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}
.pixi-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.pixi-shortcuts::-webkit-scrollbar {
    height: 4px;
}
.pixi-shortcuts::-webkit-scrollbar-track {
    background: transparent;
}
.pixi-shortcuts::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

/* Pixi Toggle Button */
#pixi-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #22c55e 100%);
    box-shadow: 0 10px 25px rgba(163, 230, 53, 0.5), inset 0 -3px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy transition */
    animation: pulse-glow 2.5s infinite;
}

#pixi-toggle img {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

#pixi-toggle:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 15px 35px rgba(163, 230, 53, 0.6), inset 0 -3px 5px rgba(0,0,0,0.2);
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.6); }
    70% { box-shadow: 0 0 0 20px rgba(163, 230, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); }
}

/* Pixi Chat Window (Glassmorphism Premium) */
#pixi-window {
    position: fixed;
    bottom: 6.5rem;
    right: 2rem;
    width: 420px;
    height: 650px;
    max-height: calc(100vh - 9rem);
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.05) inset;
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(40px) scale(0.9);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

#pixi-window.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Header */
.pixi-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pixi-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pixi-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-base));
    border: 2px solid var(--accent);
    padding: 6px;
    box-shadow: 0 0 15px rgba(163, 230, 53, 0.3);
}

.pixi-name {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.pixi-status {
    font-size: 0.8rem;
    color: var(--verified);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.pixi-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

#pixi-close {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-muted);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

#pixi-close:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: rotate(90deg);
}

/* Messages Area */
.pixi-messages {
    flex: 1;
    padding: 1.5rem;
    padding-bottom: 2.5rem; /* Extra padding to prevent cutoff */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scroll-behavior: smooth;
}

/* Chat Bubbles */
.chat-bubble {
    max-width: 85%;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    line-height: 1.5;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom;
    opacity: 0;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.chat-user {
    background: linear-gradient(135deg, var(--accent) 0%, #84cc16 100%);
    color: #0f172a;
    font-weight: 500;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    transform-origin: bottom right;
}

.chat-pixi {
    background: rgba(51, 65, 85, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    transform-origin: bottom left;
}

.chat-bubble.typing {
    background: rgba(51, 65, 85, 0.4);
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0.75rem 1.25rem;
}

.chat-bubble.typing::after {
    content: '...';
    letter-spacing: 2px;
    animation: typingDots 1.5s infinite steps(4, end);
    width: 14px;
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

@keyframes typingDots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Action Buttons inside Chat */
.pixi-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(163, 230, 53, 0.2) 100%);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.8rem;
    margin-right: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(163, 230, 53, 0.1);
}

.pixi-action-btn:hover {
    background: linear-gradient(135deg, var(--accent) 0%, #22c55e 100%);
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(163, 230, 53, 0.3);
}

.pixi-action-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.pixi-action-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Shortcuts */
.pixi-shortcuts {
    padding: 0.5rem 1.5rem;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.pixi-shortcuts button {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.pixi-shortcuts button:hover {
    background: rgba(163, 230, 53, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Input Area */
.pixi-input-area {
    padding: 1rem 1.5rem 1.5rem;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0) 100%);
}

.pixi-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    padding: 0.4rem 0.4rem 0.4rem 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.pixi-input-wrapper:focus-within {
    border-color: rgba(163, 230, 53, 0.5);
    box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.15), inset 0 2px 4px rgba(0,0,0,0.2);
}

.pixi-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.95rem;
    padding: 0.5rem 0.5rem;
}

.pixi-input-wrapper input:focus {
    outline: none;
}

.pixi-input-wrapper input::placeholder {
    color: rgba(255,255,255,0.3);
}

.pixi-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #22c55e 100%);
    color: #0f172a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(163, 230, 53, 0.4);
}

.pixi-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(163, 230, 53, 0.6);
}

.pixi-send:active {
    transform: scale(0.95);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #pixi-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        max-height: 100vh;
        border-radius: 0;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        transform: translateY(100%);
    }
    
    #pixi-window.active {
        transform: translateY(0);
    }
    
    #pixi-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}
