/* ============================================ */
/* THIA AIDE RECEPTIONIST - WIDGET STYLES        */
/* ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============ WRAPPER ============ */
.thia-welcome-wrapper {
    width: 100%;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* ============ HERO (начален екран) ============ */
.thia-welcome-hero {
    background: linear-gradient(135deg, rgba(182, 140, 90, 0.9) 0%, rgba(195, 163, 127, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px 46px 40px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.14);
}

.thia-welcome-hero-content {
    margin-bottom: 30px;
}

.thia-welcome-logo-img {
    width: 120px;
    height: auto;
    border-radius: 50%;
    margin-bottom: 15px;
}

.thia-welcome-heading {
    font-size: 36px;
    font-weight: 300;
    letter-spacing: -2px;
    color: #fff;
    margin-bottom: 5px;
}

.thia-welcome-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
}

.thia-welcome-text-content {
    color: #FFFFFF;
    font-size: 23px;
    line-height: 1.7;
    margin-top: 15px;
}

/* ============ INPUT WRAPPER (споделен) ============ */
.thia-welcome-input-wrapper {
    display: flex;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.thia-welcome-input-wrapper:focus-within {
    box-shadow: 0 12px 35px rgba(167, 139, 250, 0.25);
}

.thia-welcome-input {
    flex: 1;
    padding: 10px 24px !important;
    font-size: 16.5px;
    border: none !important;
    outline: none !important;
    background: transparent;
    font-family: inherit;
    box-shadow: none !important;
    margin: 0 !important;
}

.thia-welcome-input::placeholder {
    color: #999;
}

.thia-welcome-btn {
    background: linear-gradient(135deg, #dcc0ba, #fff);
    color: #3e3e3e;
    border: none;
    padding: 0 34px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thia-welcome-btn:hover {
    background: linear-gradient(135deg, #fcfcfc, #fbdada);
}

/* ============ CHAT AREA (долна част след писане) ============ */
.thia-welcome-chat-area {
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 0 15px rgba(156, 150, 150, 0.15), 0 0 60px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 12px;
}

.thia-welcome-messages {
    padding: 20px;
    overflow-y: auto;
	scrollbar-width: thin;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============ INPUT BOTTOM (в чат зоната) ============ */
.thia-welcome-input-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #e1e5e9;
}

.thia-welcome-input-bottom .thia-welcome-input {
    padding: 12px 0;
    font-size: 18px;
    box-shadow: none;
}

.thia-welcome-input-bottom .thia-welcome-btn {
    padding: 10px 20px;
}

.thia-bottom-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ============ TYPING ============ */
.thia-welcome-typing {
    padding: 8px 20px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    background: #fff;
}

.thia-welcome-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
}

.thia-dot {
    width: 8px;
    height: 8px;
    background: rgba(139, 92, 246, 0.35);
    border-radius: 50%;
    animation: thiaWave 2.5s ease-in-out infinite;
}

.thia-dot:nth-child(1) { animation-delay: 0s; }
.thia-dot:nth-child(2) { animation-delay: 0.3s; }
.thia-dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes thiaWave {
    0%, 100% { background: rgba(139, 92, 246, 0.35); }
    50% { background: #8b5cf6; transform: scale(1.3); }
}

/* ============ MESSAGES ============ */
.thia-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.6;
    word-wrap: break-word;
    font-size: 15px;
    animation: thiaMessageIn 0.3s ease-out;
}

.thia-message-user {
    background: linear-gradient(135deg, rgba(182, 140, 90, 0.9) 0%, rgba(225, 189, 148, 0.9) 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.thia-message-assistant {
    background: #f8fafc;
    color: #2c2c2c;
    margin-right: auto;
    border-bottom-left-radius: 6px;
}

.thia-message-error {
    background: #ffeaea;
    color: #d63638;
    margin: 0 auto;
    text-align: center;
    font-size: 14px;
    border-radius: 10px;
    padding: 10px 16px;
    max-width: 90%;
}

.thia-message-content {
    font-size: 20px;
    line-height: 1.1;
}

.thia-message-content p { margin: 0 0 8px 0; }
.thia-message-content p:last-child { margin-bottom: 0; }
.thia-message-content ul, .thia-message-content ol { margin: 8px 0; padding-left: 20px; }
.thia-message-content li { margin: 4px 0; }
.thia-message-content strong { font-weight: 600; }
.thia-message-content a { color: #7c3aed; text-decoration: underline; }

.thia-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 6px;
    text-align: right;
}

.thia-message-assistant .thia-message-time { text-align: left; color: #888; }
.thia-message-user .thia-message-time { color: rgba(255, 255, 255, 0.8); }

@keyframes thiaMessageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ FLOATING CHAT ============ */
#thia-floating-container {
    position: fixed;
    z-index: 999999;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.thia-floating-position-bottom-right { bottom: 20px; right: 20px; }
.thia-floating-position-bottom-left { bottom: 20px; left: 20px; }

.thia-floating-btn {

    background: linear-gradient(135deg, rgba(182, 140, 90, 0.9) 0%, rgba(225, 189, 148, 0.9) 100%);
    position: fixed;
bottom: 20px;
right: 20px;

color: white;
border: none;
border-radius: 50px;
padding: 10px 20px;
font-size: 23px;
font-weight: 600;
cursor: pointer;
z-index: 9999;
box-shadow: 0 8px 25px rgba(0,124,186,0.3);
transition: all 0.3s ease;
display: flex;
align-items: center;
gap: 8px;
}

.thia-floating-btn:hover { transform: scale(1.1); box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4); }
.thia-floating-position-bottom-left .thia-floating-btn { right: auto; left: 20px; }

.thia-floating-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 600px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100000;
    animation: thiaSlideUp 0.3s ease-out;
}

.thia-floating-position-bottom-left .thia-floating-window { right: auto; left: 20px; }

@keyframes thiaSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.thia-floating-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(182, 140, 90, 0.9) 0%, rgba(225, 189, 148, 0.9) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.thia-floating-header-left { display: flex; align-items: center; gap: 10px; }
.thia-floating-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); }
.thia-floating-title { font-weight: 600; font-size: 15px; }
.thia-floating-status { font-size: 11px; opacity: 0.85; }

.thia-floating-close {
    background: none; border: none;
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: white; padding: 0; font-size: 18px;
}
.thia-floating-close:hover { background: rgba(255, 255, 255, 0.2); }

.thia-floating-messages {
    flex: 1; padding: 16px; overflow-y: auto;
    background: rgba(255, 255, 255, 0.9);
    display: flex; flex-direction: column; gap: 10px;
	scrollbar-width: thin;
}

.thia-floating-typing { padding: 6px 16px; background: white; text-align: center; }

.thia-floating-input-container {
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e1e5e9;
}

.thia-floating-input-wrapper {
    display: flex; gap: 8px; align-items: center;
    border: 1px solid #e1e5e9; border-radius: 20px;
    padding: 2px 2px 2px 12px; background: #f8f9fa;
}

.thia-floating-input {
    flex: 1; border: none !important; background: none !important;
    outline: none !important; font-size: 14px !important;
    padding: 6px 0 !important; font-family: inherit !important;
    box-shadow: none !important; margin: 0 !important;
}
.thia-floating-input::placeholder { color: #999; }

.thia-floating-send {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white; border: none; border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; padding: 0;
}
.thia-floating-send:hover { opacity: 0.9; }

/* ============ EMBEDDED CHAT ============ */
.thia-embedded-chat {
    border: 1px solid #e1e5e9; border-radius: 16px; overflow: hidden;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    display: flex; flex-direction: column; margin: 20px 0;
}

.thia-embedded-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
    backdrop-filter: blur(10px);
    display: flex; align-items: center; gap: 10px; color: white;
}
.thia-embedded-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); }
.thia-embedded-title { font-weight: 600; font-size: 14px; }
.thia-embedded-status { font-size: 11px; opacity: 0.85; }

.thia-embedded-messages {
    flex: 1; padding: 16px; overflow-y: auto;
    background: #f8f9fa; display: flex; flex-direction: column; gap: 10px;
}

.thia-embedded-input-container { padding: 10px; background: white; border-top: 1px solid #e1e5e9; display: flex; gap: 8px; }

.thia-embedded-input {
    flex: 1; border: 1px solid #e1e5e9 !important; border-radius: 20px !important;
    padding: 8px 14px !important; font-size: 14px !important;
    outline: none !important; font-family: inherit !important; margin: 0 !important;
}

.thia-embedded-send {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white; border: none; border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; padding: 0;
}

/* ============ SCROLLBAR ============ */
.thia-welcome-messages::-webkit-scrollbar,
.thia-floating-messages::-webkit-scrollbar,
.thia-embedded-messages::-webkit-scrollbar { width: 5px; }

.thia-welcome-messages::-webkit-scrollbar-track,
.thia-floating-messages::-webkit-scrollbar-track,
.thia-embedded-messages::-webkit-scrollbar-track { background: transparent; }

.thia-welcome-messages::-webkit-scrollbar-thumb,
.thia-floating-messages::-webkit-scrollbar-thumb,
.thia-embedded-messages::-webkit-scrollbar-thumb { background: #c1c7d0; border-radius: 3px; }

/* ============ MOBILE ============ */
@media (max-width: 768px) {
    .thia-welcome-wrapper { max-width: 95%; margin: 20px auto; }
    .thia-welcome-hero { padding: 30px 20px; border-radius: 20px; }
    .thia-welcome-logo-img { width: 80px; }
    .thia-welcome-heading { font-size: 26px; }
    .thia-welcome-input { padding: 10px 18px; font-size: 15px; }
    .thia-welcome-btn { padding: 0 24px; }
    .thia-welcome-messages { max-height: 300px; padding: 14px; }
    .thia-message { font-size: 14px; padding: 10px 14px; }
    
    .thia-floating-window {
        position: fixed !important; top: 0 !important; left: 0 !important;
        right: 0 !important; bottom: 0 !important;
        width: 100% !important; height: 100% !important;
        max-height: 100% !important; border-radius: 0 !important;
    }
    .thia-floating-input { font-size: 16px !important; }
}

/* Safe area */
@supports (padding: max(0px)) {
    .thia-floating-window { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
    .thia-floating-btn { bottom: max(20px, env(safe-area-inset-bottom)); }
}

.thiaide-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  }