/* Chat FAB */
#pirniz-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pirniz-chat-fab:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.6);
}

#pirniz-chat-fab svg {
    width: 28px;
    height: 28px;
}

/* Chat Window */
#pirniz-chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#pirniz-chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Header */
.chat-header {
    padding: 20px;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.chat-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chat-close:hover {
    opacity: 1;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: fadeInSlide 0.3s ease-out;
}

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

.message.bot {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.message.user {
    align-self: flex-end;
    background: #7c3aed;
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

/* Bot Quick Actions */
.chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.action-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: #7c3aed;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f5f3ff;
    border-color: #7c3aed;
}

/* Input Area */
.chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #7c3aed;
}

.send-btn {
    background: #7c3aed;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #6d28d9;
}

.send-btn disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    width: fit-content;
    align-self: flex-start;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dot {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Dark Mode Support */
[data-theme="dark"] #pirniz-chat-window {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .chat-messages {
    background: #0f172a;
}

[data-theme="dark"] .message.bot {
    background: #1e293b;
    color: #f1f5f9;
}

[data-theme="dark"] .chat-input-area,
[data-theme="dark"] .action-btn,
[data-theme="dark"] .typing-indicator {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme="dark"] .chat-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}
