﻿/* Frontend Chat Widget Styles */

#cc-chat-widget {
    --cc-color: #0066cc;
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#cc-chat-widget.cc-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

#cc-chat-widget.cc-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat Button */
.cc-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--cc-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cc-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.cc-chat-button svg {
    width: 28px;
    height: 28px;
    color: #fff;
    transition: all 0.3s ease;
}

.cc-chat-button .cc-icon-close {
    display: none;
}

#cc-chat-widget.cc-open .cc-chat-button .cc-icon-chat {
    display: none;
}

#cc-chat-widget.cc-open .cc-chat-button .cc-icon-close {
    display: block;
}

/* Chat Window */
.cc-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
}

#cc-chat-widget.cc-position-bottom-left .cc-chat-window {
    left: 0;
    right: auto;
}

#cc-chat-widget.cc-open .cc-chat-window {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Chat Header */
.cc-chat-header {
    background: var(--cc-color);
    color: #fff;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.cc-minimize-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.cc-minimize-btn:hover {
    opacity: 0.8;
}

.cc-minimize-btn svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

/* Chat Messages */
.cc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.cc-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    animation: cc-fade-in 0.3s ease;
}

@keyframes cc-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cc-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.cc-message-bot .cc-message-content {
    background: #fff;
    color: #1d2327;
    border: 1px solid #e0e0e0;
    align-self: flex-start;
}

.cc-message-user .cc-message-content {
    background: var(--cc-color);
    color: #fff;
    align-self: flex-end;
}

.cc-message-sources {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f0f1;
    border-radius: 8px;
    font-size: 12px;
    max-width: 85%;
}

.cc-message-sources strong {
    display: block;
    margin-bottom: 6px;
    color: #646970;
}

.cc-message-sources a {
    display: block;
    color: var(--cc-color);
    text-decoration: none;
    margin-bottom: 4px;
    transition: opacity 0.2s;
}

.cc-message-sources a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.cc-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.cc-typing span {
    width: 6px;
    height: 6px;
    background: #646970;
    border-radius: 50%;
    animation: cc-typing 1.4s infinite;
}

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

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

@keyframes cc-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.cc-chat-input-wrapper {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    border-radius: 0 0 12px 12px;
}

.cc-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    transition: border-color 0.2s;
}

.cc-chat-input:focus {
    outline: none;
    border-color: var(--cc-color);
}

.cc-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cc-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cc-send-button:hover:not(:disabled) {
    transform: scale(1.05);
}

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

.cc-send-button svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

/* Scrollbar */
.cc-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.cc-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.cc-chat-messages::-webkit-scrollbar-thumb {
    background: #c3c4c7;
    border-radius: 3px;
}

.cc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #cc-chat-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .cc-chat-window {
        width: 100%;
        height: calc(100vh - 100px);
        bottom: 70px;
    }
    
    #cc-chat-widget.cc-position-bottom-left {
        left: 10px;
    }
}
