﻿:root {
    --primary: #43BAFF;
    --main-dark: #19272B;
    --stroke-2: #FFFFFF26;
    --surface: #E1F2F2;
    --white: #FFFFFF;
    --dark-2: #142125;
    --main-blue-1: #086AD8;
    --gray: #FFFFFF26;
    --dark-3 :#142125;
}

/* Chat Toggle Button */
.chat-toggle-btn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--main-blue-1) 100%);
    border: none;
    color: var(--white);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(67, 186, 255, 0.4);
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 99999 !important;
}

    .chat-toggle-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 12px 32px rgba(67, 186, 255, 0.5);
    }

    .chat-toggle-btn.active {
        transform: scale(0);
        opacity: 0;
    }

/* Chat Container */
.chat-container {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    width: 480px;
    height: 720px;
    max-height: 85vh;
    border-radius: 18px;
    backdrop-filter: blur(18px);
    background: rgba(255,255,255,0.95);
    box-shadow: 0 25px 80px rgba(0,0,0,0.18);
    display: flex !important;
    flex-direction: column;
    /* ✅ REQUIRED FOR TOGGLE */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all .3s ease;
    z-index: 1;
}

    .chat-container.active {
        opacity: 1 !important;
        transform: scale(1) translateY(0) !important;
        pointer-events: all !important;
        visibility: visible !important;
        z-index:1;
    }

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--main-dark) 0%, var(--dark-2) 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--stroke-2);
    flex-shrink: 0;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
}

.chat-title {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.chat-status {
    color: var(--primary);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .chat-status::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--primary);
        display: inline-block;
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .chat-close-btn:hover {
        background: var(--stroke-2);
        transform: rotate(90deg);
    }

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

    .chat-messages::-webkit-scrollbar {
        width: 6px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: transparent;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }

        .chat-messages::-webkit-scrollbar-thumb:hover {
            background: var(--main-blue-1);
        }

/* Message */
.message {
    display: flex;
    gap: 10px;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
    .message-bubble ul {
        margin: 8px 0 8px 18px;
        padding-left: 10px;
    }

    .message-bubble li {
        margin-bottom: 6px;
        list-style-type: disc;
    }
.bot-message .message-bubble {
    background: var(--white);
    color: var(--main-dark);
    border: 1px solid rgba(67, 186, 255, 0.2);
    border-radius: 12px 12px 12px 2px;
}

.user-message {
    flex-direction: row-reverse;
}

    .user-message .message-content {
        align-items: flex-end;
    }

    .user-message .message-avatar {
        background: linear-gradient(135deg, var(--main-blue-1) 0%, var(--primary) 100%);
    }

    .user-message .message-bubble {
        background: linear-gradient(135deg, var(--primary) 0%, var(--main-blue-1) 100%);
        color: var(--white);
        border: none;
        border-radius: 12px 12px 2px 12px;
    }

.message-time {
    font-size: 11px;
    color: #666;
    padding: 0 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-items: center;
}

    .typing-indicator span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--primary);
        animation: typing 1.4s infinite;
    }

        .typing-indicator span:nth-child(1) {
            animation-delay: 0s;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Suggestions */
.chat-suggestions {
    padding: 12px 20px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--white);
    border-top: 1px solid rgba(67, 186, 255, 0.1);
}

.suggestion-chip {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

    .suggestion-chip:hover {
        background: var(--primary);
        color: var(--white);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(67, 186, 255, 0.3);
    }

    .suggestion-chip:active {
        transform: translateY(0);
    }

/* Chat Input */
.chat-input-container {
    background: var(--white);
    border-top: 1px solid rgba(67, 186, 255, 0.2);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.chat-input {
    flex: 1;
    border: 1px solid rgba(67, 186, 255, 0.3);
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: var(--surface);
    color: var(--main-dark);
}

    .chat-input::placeholder {
        color: #999;
    }

    .chat-input:focus {
        border-color: var(--primary);
        background: var(--white);
        box-shadow: 0 0 0 3px rgba(67, 186, 255, 0.1);
    }

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--main-blue-1) 100%);
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .chat-send-btn:hover:not(:disabled) {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(67, 186, 255, 0.4);
    }

    .chat-send-btn:active:not(:disabled) {
        transform: scale(0.95);
    }

    .chat-send-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Welcome Message Styling */
.welcome-badge {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0;
        max-height: 100vh;
    }

    .chat-toggle-btn {
        bottom: 20px !important;
        right: 20px !important;
        width: 56px;
        height: 56px;
    }

    .chat-messages {
        padding: 16px;
    }

    .message-content {
        max-width: 80%;
    }

    .chat-suggestions {
        padding: 10px 16px 0;
    }

    .suggestion-chip {
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 16px;
    }

    .bot-avatar {
        width: 36px;
        height: 36px;
    }

    .chat-title {
        font-size: 15px;
    }

    .chat-input-wrapper {
        padding: 12px 16px;
    }

    .chat-send-btn {
        width: 40px;
        height: 40px;
    }
}

/* Accessibility */
.chat-toggle-btn:focus,
.chat-close-btn:focus,
.chat-send-btn:focus,
.suggestion-chip:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
