/* Byoosi AI Assistant Styles
   Designed to match the modern light theme of the Byoosi website
   Integrated with the standardized theme system */

:root {
    /* Using the standardized color variables from byoosi_theme.css */
    --byoosi-primary: #6A2B82;
    --byoosi-primary-dark: #3d1452;
}

.byoosi-ai-assistant-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: 90vw;
    z-index: 9999;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    transition: all 0.3s ease;
}

.byoosi-ai-assistant {
    display: flex;
    flex-direction: column;
    height: 600px;
    max-height: 80vh;
    position: relative;
}

/* Header */
.byoosi-ai-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, var(--byoosi-primary), var(--byoosi-primary-dark));
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Style for the H4 title within the header */
.byoosi-ai-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700; /* Make title bolder */
    color: white; /* Explicitly set white */
}

.byoosi-ai-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    position: relative;
    overflow: hidden;
}

.byoosi-ai-logo-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.byoosi-ai-logo-animation div {
    background-color: white;
    height: 8px;
    width: 2px;
    margin: 0 1px;
    border-radius: 2px;
    animation: sound 1.4s infinite ease alternate;
}

.byoosi-ai-logo-animation div:nth-child(1) {
    animation-delay: -0.2s;
}

.byoosi-ai-logo-animation div:nth-child(2) {
    animation-delay: -0.1s;
}

@keyframes sound {
    0% {
        height: 5px;
    }
    100% {
        height: 15px;
    }
}

.byoosi-ai-title {
    flex-grow: 1;
}

.byoosi-ai-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.byoosi-ai-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
}

.byoosi-ai-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    transition: background-color 0.3s;
}

.byoosi-ai-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Content */
.byoosi-ai-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: calc(100% - 64px);
    transition: height 0.3s ease;
}

.byoosi-ai-content.byoosi-ai-collapsed {
    height: 0;
}

.byoosi-ai-chat-container {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.byoosi-ai-chat {
    padding: 15px;
    overflow-y: auto;
    height: 100%;
    background-color: #f8f8fb;
}

/* Welcome Message */
.byoosi-ai-welcome {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.byoosi-ai-welcome-message {
    background: linear-gradient(135deg, rgba(106, 43, 130, 0.05), rgba(61, 20, 82, 0.1));
    border-radius: 12px;
    padding: 15px;
    max-width: 85%;
    text-align: center;
    position: relative;
}

.byoosi-ai-welcome-message:before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 30px;
    background: rgba(106, 43, 130, 0.1);
    filter: blur(20px);
    border-radius: 50%;
    z-index: -1;
}

.byoosi-ai-welcome-message h4 {
    margin: 0 0 5px;
    color: var(--byoosi-primary);
    font-weight: 600;
}

.byoosi-ai-welcome-message p {
    margin: 0;
    color: #4a4a4a;
    font-size: 14px;
}

/* Messages */
.byoosi-ai-message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.byoosi-ai-message-content {
    display: flex;
    max-width: 100%;
}

.byoosi-ai-user-message .byoosi-ai-message-content {
    justify-content: flex-end;
}

.byoosi-ai-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
}

.byoosi-ai-user-message .byoosi-ai-avatar {
    order: 2;
    margin-right: 0;
    margin-left: 8px;
    background: linear-gradient(135deg, var(--byoosi-primary), var(--byoosi-primary-dark));
    color: white;
}

.byoosi-ai-assistant-avatar {
    background: linear-gradient(135deg, #c38fff, #8e54e9);
    color: white;
}

.byoosi-ai-error-avatar {
    background: linear-gradient(135deg, #ff6b6b, #ee5253);
    color: white;
}

.byoosi-ai-message-bubble {
    padding: 12px 15px;
    border-radius: 18px;
    max-width: 90%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    font-size: 14px;
    line-height: 1.5;
}

.byoosi-ai-user-message .byoosi-ai-message-bubble {
    background: linear-gradient(135deg, var(--byoosi-primary), var(--byoosi-primary-dark));
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
    text-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.byoosi-ai-assistant-message .byoosi-ai-message-bubble {
    background: white;
    color: #333333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-weight: 400;
}

.byoosi-ai-error-message .byoosi-ai-message-bubble {
    background: #fff8f8;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
    border-bottom-left-radius: 4px;
}

/* Code Formatting */
.byoosi-ai-message-bubble pre {
    background: #f1f1f4;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.byoosi-ai-message-bubble code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 0.9em;
    background: #f1f1f4;
    padding: 2px 4px;
    border-radius: 3px;
}

.byoosi-ai-message-bubble pre code {
    padding: 0;
    background: transparent;
}

/* Lists */
.byoosi-ai-message-bubble ul {
    padding-left: 20px;
    margin: 8px 0;
}

.byoosi-ai-message-bubble li {
    margin-bottom: 4px;
}

/* Links */
.byoosi-ai-message-bubble a {
    color: var(--byoosi-primary);
    text-decoration: none;
}

.byoosi-ai-message-bubble a:hover {
    text-decoration: underline;
}

/* Typing Indicator */
.byoosi-ai-typing {
    display: flex;
    align-items: center;
    column-gap: 4px;
    padding: 6px 0;
}

.byoosi-ai-typing span {
    width: 8px;
    height: 8px;
    background-color: var(--byoosi-primary);
    border-radius: 50%;
    display: inline-block;
    opacity: 0.4;
    animation: typing 1.2s infinite ease-in-out;
}

.byoosi-ai-typing span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Input Container */
.byoosi-ai-input-container {
    display: flex;
    padding: 10px 15px;
    background: white;
    border-top: 1px solid #eaeaea;
    position: relative;
}

.byoosi-ai-input {
    flex-grow: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 150px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.byoosi-ai-input:focus {
    border-color: var(--byoosi-primary);
}

.byoosi-ai-submit {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--byoosi-primary), var(--byoosi-primary-dark));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.byoosi-ai-submit:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(var(--byoosi-primary-rgb, 106, 43, 130), 0.3);
}

.byoosi-ai-submit:active {
    transform: scale(0.95);
}

/* Position Variants */
.byoosi-ai-position-left {
    left: 20px;
    right: auto;
}

.byoosi-ai-position-center {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .byoosi-ai-assistant-container {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    
    .byoosi-ai-position-left,
    .byoosi-ai-position-center {
        left: 0;
        transform: none;
    }
}
