/* Floating chat widget container */
.chat-widget-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Chat widget box */
.chat-widget {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    width: 350px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    border: none;
    background: #f5f7fa;
    box-shadow: 0 8px 32px rgba(216,67,21,0.13);
    padding: 0;
}

.chat-header {
    background: linear-gradient(90deg, #d84315 60%, #f57c00 100%);
    color: #fff;
    padding: 10px 18px;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e3e7ef;
    letter-spacing: 0.5px;
}

.solara-header-left {
    display: flex;
    align-items: center;
}

.solara-logo {
    font-size: 1.5rem;
    margin-right: 8px;
    filter: drop-shadow(0 1px 2px rgba(216,67,21,0.47));
}

.chat-history {
    background: #fff;
    padding: 10px 12px;
    height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.chat-message-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 2px;
}

.chat-bubble {
    padding: 7px 13px;
    border-radius: 16px 16px 6px 16px;
    margin-bottom: 2px;
    max-width: 85%;
    word-break: break-word;
    font-size: 0.90rem;
    line-height: 1.5;
    box-shadow: 0 1px 4px rgba(79,140,255,0.07);
}

.user-bubble {
    background: #fff3e0;
    color: #d84315;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    border-top-right-radius: 4px;
    font-weight: 500;
}

.ai-bubble {
    background: #fff;
    color: #d84315;
    border: 1.5px solid #f57c00;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    border-top-left-radius: 4px;
    font-weight: 500;
}

/* Markdown formatting styles */
.chat-bubble p {
    margin: 0 0 8px 0;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-bubble strong {
    font-weight: 700;
    color: inherit;
}

.chat-bubble em {
    font-style: italic;
}

.chat-bubble code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85em;
}

.chat-bubble pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
}

.chat-bubble pre code {
    background: transparent;
    padding: 0;
    font-size: 0.85em;
}

.chat-bubble a {
    color: #f57c00;
    text-decoration: underline;
    word-break: break-all;
}

.chat-bubble a:hover {
    color: #d84315;
}

.chat-bubble ul,
.chat-bubble ol {
    margin: 8px 0;
    padding-left: 24px;
}

.chat-bubble ul {
    list-style-type: disc;
}

.chat-bubble ol {
    list-style-type: decimal;
}

.chat-bubble li {
    margin: 4px 0;
    line-height: 1.5;
}

.chat-bubble ul ul,
.chat-bubble ol ul {
    list-style-type: circle;
}

.chat-bubble ul ol,
.chat-bubble ol ol {
    list-style-type: lower-alpha;
}

.chat-input-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px 12px 12px;
    background: #f5f7fa;
    border-top: 1px solid #e3e7ef;
    gap: 7px;
}

.chat-input {
    width: 100%;
    border: 1.5px solid #d84315;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.98rem;
    resize: none;
    min-height: 32px;
    max-height: 48px;
    background: #fff;
    margin-bottom: 4px;
    outline: none;
    transition: border 0.2s;
    box-sizing: border-box;
    overflow-y: auto;
}

.chat-input:focus {
    border: 1.5px solid #f57c00;
}

.send-btn {
    width: 100%;
    background: linear-gradient(90deg, #d84315 60%, #f57c00 100%);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 8px 0;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    margin-bottom: 4px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(216,67,21,0.10);
}

.send-btn:hover {
    background: linear-gradient(90deg, #f57c00 0%, #d84315 100%);
    box-shadow: 0 2px 8px rgba(216,67,21,0.18);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.human-btn {
    background: #3d5f71;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 8px 0;
    margin-left: 0;
    margin-bottom: 0;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(61,95,113,0.07);
    cursor: pointer;
    transition: background 0.2s;
}

.human-btn:hover {
    background: #274152;
    color: #fff;
}

.human-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-widget-icon {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    background: #f57c00;
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.2s;
}

.chat-widget-icon:hover {
    background: #d84315;
}

.minimize-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    min-width: 30px;
}

.minimize-btn:hover {
    color: #ffb347;
}

/* Login container for centering */
.chat-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f8fa;
}

.chat-login-container .chat-widget {
    position: static;
    margin: 0;
}

.chat-login-container h2 {
    color: #d84315;
    margin-bottom: 20px;
    text-align: center;
}

.chat-login-container input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1.5px solid #d84315;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.chat-login-container button {
    width: 100%;
    background: linear-gradient(90deg, #d84315 60%, #f57c00 100%);
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 12px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}

.chat-login-container button:hover {
    background: linear-gradient(90deg, #f57c00 0%, #d84315 100%);
}

/* Responsive for mobile */
@media (max-width: 500px) {
    .chat-widget {
        width: 98vw;
        min-width: 0;
        border-radius: 0;
    }
    .chat-widget-container {
        right: 0;
        bottom: 0;
    }
}

/* Hidden elements */
.hidden {
    display: none !important;
}

/* Loading animation */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 13px;
    background: #fff;
    color: #d84315;
    border: 1.5px solid #f57c00;
    border-radius: 16px 16px 6px 16px;
    align-self: flex-start;
    font-size: 0.90rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #d84315;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}