﻿.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: white;
    border: solid 5px #ff6b35;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 9999;
}

    .chat-button:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6);
    }

.chat-window {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    grid-template-columns: 1fr;
}

.chat-header {
    grid-row: 1;
    background: linear-gradient(135deg, #3e4548 0%, #3e4548 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 0;
}

    .chat-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: white;
    }

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    transition: opacity 0.2s;
}

    .chat-close:hover {
        opacity: 0.8;
    }

.chat-messages {
    grid-row: 2;
    height: 65%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #f8f9fa;
    min-height: 0;
}

.message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message.bot .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.message.user .message-content {
    background: linear-gradient(135deg, #ff6b35 0%, #d94e1f 100%);
    color: white;
}

.chat-input-container {
    grid-row: 3;
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 0 0 12px 12px;
    align-items: center;
    min-height: 0;
}

#chatInput {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    height: 44px;
    max-height: 60px;
}

    #chatInput:focus {
        outline: none;
        border-color: #ff6b35;
    }

#chatSend {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ff6b35 0%, #d94e1f 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    flex-shrink: 0;
}

    #chatSend:hover {
        opacity: 0.9;
    }

    #chatSend:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.chat-typing {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    padding: 8px 20px;
    font-size: 12px;
    color: #666;
    background: white;
    border-top: 1px solid #e0e0e0;
    z-index: 1;
}

.typing-dots::after {
    content: '';
    animation: typingDots 1.5s infinite;
}

@keyframes typingDots {
    0%, 20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%, 100% {
        content: '...';
    }
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ff6b35;
    border-radius: 3px;
}

    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: #d94e1f;
    }

.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #ff6b35 #f1f1f1;
}

@media (max-width: 768px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 160px);
        right: 20px;
        bottom: 100px;
    }

    .chat-button {
        bottom: 15px;
        right: 15px;
        height: 50px;
        width: auto;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .chat-window {
        width: 380px;
        height: 550px;
    }
}

.chat-button,
.chat-close,
#chatSend {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

    #chatInput:focus,
    #chatSend:focus,
    .chat-close:focus {
        outline: 2px solid #ff6b35;
        outline-offset: 2px;
    }

@media print {
    .chat-button,
    .chat-window {
        display: none !important;
    }
}

.chat-actions {
    grid-row: 4;
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #e0e0e0;
}

.chat-action-btn {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    background: white;
    color: #333;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

    .chat-action-btn:hover {
        background: #f8f9fa;
        border-color: #ff6b35;
        color: #ff6b35;
    }

    .chat-action-btn:active {
        transform: scale(0.98);
    }

#chatClear:hover {
    background: #fff5f5;
    border-color: #dc3545;
    color: #dc3545;
}

.chat-action-btn.confirm-delete {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    animation: pulseRed 0.5s ease;
}

@keyframes pulseRed {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@media (max-width: 768px) {
    .chat-actions {
        padding: 10px 16px;
    }

    .chat-action-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}
