/* Chat component styles that match Calmtopia's theme */
:root {
    --chat-deep-violet: #36118d;
    --chat-vibrant-purple: #8c1ed7;
    --chat-soft-lavender: #db99f0;
    --chat-aqua-cyan: #31f7f1;
    --chat-midnight-navy: #120435;
    --chat-soft-white: #fefcfd;
}

/* Main chat container */
.chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'Raleway', sans-serif;
}

/* Chat bubble that users click to open chat */
.chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-deep-violet), var(--chat-vibrant-purple));
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(140, 30, 215, 0.4);
}

.chat-bubble-inner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--chat-soft-white);
    font-size: 1.5rem;
    overflow: hidden;
    border-radius: 50%;
}

.chat-logo {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.chat-bubble.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
}

/* Notification badge */
.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background-color: var(--chat-aqua-cyan);
    color: var(--chat-midnight-navy);
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Main chat box */
.chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 450px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.chat-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat header */
.chat-header {
    background: linear-gradient(135deg, var(--chat-deep-violet), var(--chat-vibrant-purple));
    color: var(--chat-soft-white);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-title h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.chat-title p {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.8;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.chat-avatar-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--chat-aqua-cyan), var(--chat-soft-lavender));
    clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
}

.chat-avatar.small {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.chat-avatar-inner.small {
    width: 100%;
    height: 100%;
}

.chat-close {
    background: white;
    border: 2px solid var(--chat-vibrant-purple);
    color: var(--chat-vibrant-purple);
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: bold;
    padding: 5px;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffffff;
    border: 3px solid var(--chat-vibrant-purple);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.chat-close:hover {
    background: #f0f0f0;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    background: #f0f0f0;
    transform: scale(1.2);
    box-shadow: 0 5px 15px rgba(140, 30, 215, 0.6);
}

.chat-close span {
    display: inline-block;
    line-height: 1;
    font-size: 1.6rem;
    font-weight: 800;
}

/* Chat message area */
.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: rgba(240, 240, 250, 0.8);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message-time {
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    margin: 10px 0;
}

.chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    max-width: 85%;
}

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

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

.message-bubble {
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.bot-message .message-bubble {
    background-color: white;
    color: #333;
    border-top-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--chat-deep-violet), var(--chat-vibrant-purple));
    color: white;
    border-top-right-radius: 5px;
}

/* Chat input area */
.chat-input-container {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: white;
}

.chat-input {
    flex-grow: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 10px;
    max-height: 80px;
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    background-color: rgba(240, 240, 250, 0.5);
    border-radius: 20px;
    padding-left: 15px;
}

.chat-send {
    background: linear-gradient(135deg, var(--chat-deep-violet), var(--chat-vibrant-purple));
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.chat-send:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 10px rgba(140, 30, 215, 0.3);
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--chat-soft-lavender);
    border-radius: 10px;
}

/* Responsive styling */
@media (max-width: 768px) {
    .chat-box {
        width: 90vw;
        height: 70vh;
        right: 5vw;
        bottom: 80px;
    }
    
    .chat-bubble {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }
    
    .chat-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 15px;
    }
    
    .chat-send {
        width: 44px;
        height: 44px;
        margin-left: 12px;
    }
    
    .chat-header {
        padding: 12px;
    }
    
    .chat-title h3 {
        font-size: 1.1rem;
    }
    
    .chat-close {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    /* Improve tap targets */
    .chat-message-bubble {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .chat-container {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-box {
        width: 95vw;
        height: 80vh;
        right: 2.5vw;
        bottom: 70px;
    }
    
    .chat-input-container {
        padding: 10px;
    }
    
    .chat-messages {
        padding: 12px;
    }
}

/* Add styles for when keyboard is active on mobile */
@media (max-height: 500px) and (max-width: 768px) {
    .chat-box {
        height: 85vh;
        bottom: 70px;
    }
} 