/**
 * Wolf Chat Widget Styles
 * Glassmorphism Design with Theme Support
 */

/* Chat Toggle Button */
.wolf-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    cursor: pointer;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 30px var(--glow-color);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wolf-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow:
        0 6px 30px rgba(0, 0, 0, 0.4),
        0 0 40px var(--glow-color);
}

.wolf-chat-toggle img {
    width: 40px;
    height: 40px;
    filter: var(--image-filter);
}

.wolf-chat-toggle .wolf-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--color-primary);
    animation: wolfPulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes wolfPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Chat Window */
.wolf-chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 500px;
    max-height: calc(100vh - 150px);
    background: rgba(var(--color-bg-rgb, 10, 10, 10), 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px var(--glow-color);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
}

/* Chat Header */
.wolf-chat-header {
    padding: 16px;
    background: linear-gradient(135deg, var(--color-bg-elevated), var(--color-bg-secondary));
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.wolf-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    filter: drop-shadow(0 0 10px var(--glow-color));
}

.wolf-chat-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

.wolf-chat-info span {
    font-size: 0.75rem;
    color: var(--color-primary);
}

.wolf-chat-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.wolf-chat-close:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

/* Messages Container */
.wolf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wolf-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.wolf-chat-messages::-webkit-scrollbar-track {
    background: var(--color-bg);
}

.wolf-chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

/* Message Bubbles */
.wolf-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wolf-message.user {
    align-self: flex-end;
    background: var(--color-primary);
    color: #000;
    border-bottom-right-radius: 4px;
}

.wolf-message.assistant {
    align-self: flex-start;
    background: var(--color-bg-elevated);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-bottom-left-radius: 4px;
}

/* Typing Indicator */
.wolf-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.wolf-typing span {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

.wolf-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.wolf-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-8px);
    }
}

/* Input Area */
.wolf-chat-input {
    padding: 12px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-elevated);
    display: flex;
    gap: 8px;
}

.wolf-chat-input input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: 24px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.wolf-chat-input input:focus {
    border-color: var(--color-primary);
}

.wolf-chat-input input::placeholder {
    color: var(--color-text-dim);
}

.wolf-chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wolf-chat-input button:hover:not(:disabled) {
    background: var(--color-primary-dark);
    transform: scale(1.05);
}

.wolf-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Achievement Notification */
.wolf-achievement {
    position: fixed;
    top: 80px;
    right: 24px;
    background: linear-gradient(135deg, var(--color-bg-elevated), var(--color-bg-secondary));
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 30px var(--glow-color);
    z-index: 1002;
    animation: achievementPop 0.5s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

@keyframes achievementPop {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.wolf-achievement-icon {
    font-size: 2rem;
}

.wolf-achievement-content h4 {
    margin: 0;
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wolf-achievement-content p {
    margin: 4px 0 0;
    color: var(--color-text);
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .wolf-chat-window {
        right: 12px;
        left: 12px;
        bottom: 80px;
        width: auto;
        max-width: none;
        height: calc(100vh - 160px);
    }

    .wolf-chat-toggle {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
    }
}

/* Speech Bubble - for when chat is closed */
.wolf-speech-bubble {
    position: fixed;
    bottom: 95px;
    right: 24px;
    max-width: 280px;
    padding: 12px 16px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-primary);
    border-radius: 12px;
    border-bottom-right-radius: 4px;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 20px var(--glow-color);
    z-index: 999;
    animation: speechBubblePop 0.3s ease;
}

.wolf-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--color-primary);
}

.wolf-speech-bubble p {
    margin: 0;
    color: var(--color-text);
    font-size: 0.9rem;
    line-height: 1.4;
}

@keyframes speechBubblePop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}