/* ========================================
   AI Chatbot Widget Styles
======================================== */

/* Chat Button - Fixed Position */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 120, 212, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    border: none;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 120, 212, 0.6);
}

.chat-button i {
    font-size: 1.75rem;
    color: #ffffff;
}

.chat-button.active {
    background: #dc3545;
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 360px;
    height: 520px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-avatar i {
    font-size: 1.5rem;
}

.chat-header-info {
    flex: 1;
}

.chat-header-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.chat-header-status {
    font-size: 0.8125rem;
    opacity: 0.9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-close-btn {
    position: absolute;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.125rem;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) rotate(90deg);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Chat Messages Container */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

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

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

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

/* Message Bubbles */
.message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    align-items: flex-start;
}

.message.user {
    align-items: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.message-content {
    max-width: 75%;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: #ffffff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.typing-indicator.active {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Quick Suggestions */
.quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.suggestion-chip {
    background: #e0f2fe;
    color: #0078d4;
    padding: 0.5rem 0.875rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.suggestion-chip:hover {
    background: #0078d4;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Copy Button */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: #0078d4;
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #005a9e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 120, 212, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn i {
    font-size: 0.875rem;
}

.copy-btn.copied {
    background: #10b981;
}

.copy-btn.copied i {
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Clear Chat Button */
.clear-chat-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: #64748b;
    border: 1px solid #e5e7eb;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    margin: 1rem;
    transition: all 0.2s ease;
}

.clear-chat-btn:hover {
    background: #fee2e2;
    border-color: #dc3545;
    color: #dc3545;
}

.clear-chat-btn i {
    font-size: 0.875rem;
}

/* Chat Input */
.chat-input-container {
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 0.9375rem;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.chat-input:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

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

.chat-send-btn i {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .chat-widget {
        width: 340px;
        height: 500px;
        right: 20px;
        bottom: 90px;
    }
}

@media (max-width: 1200px) {
    .chat-widget {
        width: 320px;
        height: 480px;
    }

    .chat-header {
        padding: 1rem 1.25rem;
    }

    .chat-header-title {
        font-size: 1.0625rem;
    }
}

@media (max-width: 1024px) {
    .chat-widget {
        width: 340px;
        height: 500px;
    }
}

@media (max-width: 900px) {
    .chat-widget {
        width: 320px;
        height: 480px;
    }
}

@media (max-width: 768px) {
    .chat-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        right: 20px;
        bottom: 90px;
        max-width: 400px;
        max-height: 550px;
    }

    .chat-button {
        right: 20px;
        bottom: 20px;
    }

    .chat-header {
        padding: 1rem 1.25rem;
    }

    .chat-messages {
        padding: 1.25rem;
    }

    .message-content {
        max-width: 80%;
    }

    .quick-suggestions {
        gap: 0.375rem;
    }

    .suggestion-chip {
        padding: 0.4rem 0.75rem;
        font-size: 0.8125rem;
    }
}

@media (max-width: 640px) {
    .chat-widget {
        width: calc(100vw - 30px);
        height: calc(100vh - 120px);
        right: 15px;
        bottom: 85px;
        max-width: none;
        max-height: none;
    }
}

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

    .chat-button {
        right: 15px;
        bottom: 15px;
        width: 56px;
        height: 56px;
    }

    .chat-button i {
        font-size: 1.5rem;
    }

    .chat-header {
        padding: 1rem;
    }

    .chat-header-title {
        font-size: 1rem;
    }

    .chat-header-status {
        font-size: 0.75rem;
    }

    .chat-avatar {
        width: 40px;
        height: 40px;
    }

    .chat-avatar i {
        font-size: 1.25rem;
    }

    .chat-messages {
        padding: 1rem;
        gap: 0.875rem;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8125rem;
    }

    .message-bubble {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .message-time {
        font-size: 0.6875rem;
    }

    .chat-input-container {
        padding: 0.875rem 1rem;
    }

    .chat-input {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .chat-send-btn {
        width: 38px;
        height: 38px;
    }

    .chat-send-btn i {
        font-size: 0.9375rem;
    }

    .suggestion-chip {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .chat-widget {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 75px;
    }

    .chat-button {
        width: 52px;
        height: 52px;
        right: 12px;
        bottom: 12px;
    }

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

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
}

.welcome-message i {
    font-size: 3rem;
    color: #0078d4;
    margin-bottom: 1rem;
}

.welcome-message h3 {
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.welcome-message p {
    font-size: 0.9375rem;
    line-height: 1.6;
}
