/* Global Chat Component Styles */

/* Message bubble styles */
.message {
    width: 100%;
    padding: 5px 12px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message {
    color: black;
    border-bottom-right-radius: 4px;
}

.ai-message {
    width: 100%;
    align-self: flex-start;
    color: #2b6cb0;
    border-bottom-left-radius: 4px;
}

.message-content {
    /* Add any content-specific styles if needed */
}

.loading-message {
    padding: 15px 20px;
}

/* Topic pills styling */
.related-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: hidden;
}

.topic-pill {
    background-color: rgba(43, 108, 176, 0.15);
    color: #2b6cb0;
    border: 1px solid #2b6cb0;
    border-radius: 16px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    max-width: calc(50% - 8px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-pill:hover:not([disabled]) {
    background-color: rgba(43, 108, 176, 0.25);
}

.topic-pill[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing indicator animation */
.typing-indicator {
    display: flex;
    align-items: center;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #93a2b5;
    border-radius: 50%;
    display: block;
    margin: 0 2px;
    opacity: 0.7;
    animation: typing 1s 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% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Chat Header Styles */
.chat-header-container {
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 10px 50px 10px 20px;
    z-index: 1;
    border-bottom: 1px solid #e2e8f0;
}

.header-content {
    /* Add header-specific styles if needed */
}

.welcome-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 14px;
    color: #718096;
}

/* Chat Input Styles */
.chat-input-container {
    display: flex;
    align-items: flex-end;
    padding: 8px 10px;
    background-color: #f1f5f9;
    border-radius: 10px;
    margin: 8px 0 20px 0;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.textarea-wrapper {
    position: relative;
    flex: 1;
    min-height: 80px;
}

.chat-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 0;
    resize: none;
    min-height: 44px;
    max-height: 200px;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    padding-right: 45px;
    box-sizing: border-box;
    line-height: 1.4;
}

.chat-input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.character-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 11px;
    color: #718096;
    transition: color 0.2s;
}

.limit-reached {
    color: #e53e3e;
    font-weight: bold;
}

/* Send button styling */
.send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2b6cb0;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: 8px;
    position: relative;
    right: 0;
}

.send-button:hover:not([disabled]) {
    background-color: #1e4e8c;
}

.send-button[disabled] {
    background-color: #90b0d0;
    cursor: not-allowed;
}

/* Spinner for the send button */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Chat Menu Styles */
.chat-menu-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}

.chat-menu-button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-menu-button:hover {
    background-color: #f1f5f9;
}

.chat-menu-button svg {
    color: #4a5568;
}

.chat-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 20;
    width: 220px;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}

.chat-menu-item {
    background: none;
    border: none;
    text-align: left;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    color: #2d3748;
}

.chat-menu-item:hover {
    background-color: #f7fafc;
}

.chat-menu-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-menu-item:disabled:hover {
    background-color: transparent;
}

.menu-separator {
    height: 1px;
    background-color: #e2e8f0;
    margin: 8px 0;
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 360px) {
    .welcome-title {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .welcome-subtitle {
        font-size: 13px;
    }

    .related-topics {
        gap: 4px;
    }

    .topic-pill {
        padding: 2px 6px;
        font-size: 10px;
        max-width: calc(100% - 4px);
    }

    .chat-input-container {
        padding: 5px 6px;
        margin-right: 6px;
    }

    .send-button {
        width: 32px;
        height: 32px;
        min-width: 32px;
        margin-left: 6px;
    }

    .chat-input {
        padding-right: 36px;
    }
}
