/* Chat Widget Styles - Matching Loncin Theme */
.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Chat Icon Button */
.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #EA1C26 0%, #c4161f 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(234, 28, 38, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(234, 28, 38, 0.6);
}

.chat-widget-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.chat-widget-button .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #000000;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid white;
}

/* Chat Window */
.chat-widget-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-widget-window.active {
    display: flex;
}

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

/* Chat Header */
.chat-widget-header {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #EA1C26;
}

.chat-widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff !important; /* Ensure white text is visible */
}

.chat-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Body */
.chat-widget-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-widget-body::-webkit-scrollbar {
    width: 6px;
}

.chat-widget-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-widget-body::-webkit-scrollbar-thumb {
    background: #EA1C26;
    border-radius: 3px;
}

.chat-widget-body::-webkit-scrollbar-thumb:hover {
    background: #c4161f;
}

/* Messages */
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.user {
    align-self: flex-end;
}

.chat-message.assistant {
    align-self: flex-start;
}

.chat-message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.chat-message.user .chat-message-bubble {
    background: linear-gradient(135deg, #EA1C26 0%, #c4161f 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant .chat-message-bubble {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-message.user .chat-message-time {
    text-align: right;
}

/* Welcome Message */
.chat-welcome-message {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid #EA1C26;
    margin-bottom: 12px;
}

.chat-welcome-message p {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

/* Loading Indicator */
.chat-loading {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    align-self: flex-start;
}

.chat-loading-dot {
    width: 8px;
    height: 8px;
    background: #EA1C26;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

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

/* Chat Input */
.chat-widget-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

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

.chat-widget-input:focus {
    border-color: #EA1C26;
}

.chat-widget-send {
    background: linear-gradient(135deg, #EA1C26 0%, #c4161f 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    white-space: nowrap;
}

.chat-widget-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(234, 28, 38, 0.3);
}

.chat-widget-send:active {
    transform: translateY(0);
}

.chat-widget-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error Message */
.chat-error {
    background: #fff3cd;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    font-size: 13px;
    margin: 8px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-widget-container {
        bottom: 15px;
        right: 15px;
    }

    .chat-widget-button {
        width: 56px;
        height: 56px;
    }

    .chat-widget-button svg {
        width: 24px;
        height: 24px;
    }

    .chat-widget-window {
        width: calc(100vw - 30px);
        max-width: 350px;
        height: calc(100vh - 100px);
        max-height: 500px;
        bottom: 76px;
        right: 0;
    }

    .chat-message {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .chat-widget-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
    }

    .chat-widget-header h3 {
        font-size: 14px;
        color: #ffffff !important; /* Ensure white text is visible on mobile */
    }

    .chat-message-bubble {
        font-size: 13px;
        padding: 10px 14px;
    }
}

/* Ensure chat doesn't interfere with other elements */
.chat-widget-container * {
    box-sizing: border-box;
}

