/* 
 * Toun+ B2B AI Search Chatbot Styles
 * Font: Jost
 * Colors: Primary (Gold): #a89d74, Accent (Teal): #088c98, Text: #222222, Background: #f7f8f9
 */

#toun-ai-search-container {
    font-family: "Jost", sans-serif;
    color: #222222;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    padding: 30px;
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.toun-ai-search-welcome {
    text-align: center;
    padding: 40px 20px;
}

.toun-ai-search-welcome h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #222222;
}

.toun-ai-search-welcome p {
    font-size: 16px;
    color: #666666;
    margin-bottom: 25px;
}

.toun-ai-search-prompts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.toun-ai-prompt-btn {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: "Jost", sans-serif;
    font-size: 14px;
    color: #444444;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    outline: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.toun-ai-prompt-btn:hover {
    background: #ffffff;
    border-color: #a89d74;
    color: #a89d74;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(168, 157, 116, 0.1);
}

/* Chat Feed */
.toun-ai-chat-feed {
    height: 480px;
    overflow-y: auto;
    padding: 10px 10px 20px 10px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.toun-chat-msg {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toun-chat-bubble {
    padding: 14px 20px;
    border-radius: 4px;
    font-size: 15px;
    line-height: 1.6;
    max-width: 75%;
    word-wrap: break-word;
    box-sizing: border-box;
}

/* User Message styling */
.toun-chat-msg.user {
    align-items: flex-end;
}

.toun-chat-msg.user .toun-chat-bubble {
    background-color: #088c98;
    color: #ffffff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 15px rgba(8, 140, 152, 0.15);
}

/* AI Message styling */
.toun-chat-msg.ai {
    align-items: flex-start;
}

.toun-chat-msg.ai .toun-chat-bubble {
    background-color: #f2f4f5;
    color: #222222;
    border-bottom-left-radius: 2px;
}

/* Dynamic Cards Row */
.toun-ai-cards-row {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 15px 0 5px 0;
    max-width: 100%;
    scrollbar-width: thin;
}

.toun-ai-cards-row::-webkit-scrollbar {
    height: 6px;
}
.toun-ai-cards-row::-webkit-scrollbar-track {
    background: #f7f8f9;
}
.toun-ai-cards-row::-webkit-scrollbar-thumb {
    background: #dce0e0;
    border-radius: 3px;
}

/* Individual Property Card */
.toun-ai-card {
    width: 230px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}

.toun-ai-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    border-color: #a89d74;
}

.toun-ai-card-img {
    height: 125px;
    background-size: cover;
    background-position: center;
    background-color: #f7f8f9;
}

.toun-ai-card-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.toun-ai-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toun-ai-card-title a {
    color: #222222;
    text-decoration: none;
    transition: color 0.2s ease;
}
.toun-ai-card-title a:hover {
    color: #a89d74;
}
.toun-ai-card-img-link {
    display: block;
    overflow: hidden;
}

.toun-ai-card-meta {
    font-size: 12px;
    color: #777777;
    margin-bottom: 8px;
}

.toun-ai-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #a89d74;
}

.toun-ai-card-comm {
    font-size: 11px;
    font-weight: 600;
    color: #27ae60;
    background: #eef9f0;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 6px;
    align-self: flex-start;
    border: 1.5px solid #2ecc71;
}

.toun-ai-card-btn {
    width: 100%;
    background: #088c98;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    margin-top: auto;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
}

.toun-ai-card-btn:hover {
    background: #189ba7;
    color: #ffffff;
}

/* Typing Indicator Animation */
.toun-ai-typing {
    display: flex;
    gap: 4px;
    padding: 8px 15px;
    align-items: center;
}

.toun-ai-typing span {
    width: 8px;
    height: 8px;
    background: #a89d74;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.3s infinite ease-in-out;
}

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

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Form Controls */
.toun-ai-chat-input-wrap {
    padding-top: 15px;
}

#toun-ai-search-form {
    display: flex;
    gap: 12px;
    position: relative;
}

#toun-ai-search-input {
    flex: 1;
    height: 42px !important;
    padding: 0 50px 0 22px !important;
    border: 1.5px solid #dce0e0;
    border-radius: 4px;
    font-size: 15px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease-in-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

#toun-ai-search-input:focus {
    border-color: #a89d74;
    box-shadow: 0 4px 12px rgba(168, 157, 116, 0.08);
}

.toun-ai-search-submit {
    position: absolute !important;
    right: 5px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: #088c98;
    color: #ffffff;
    border: none;
    width: 32px !important;
    height: 32px !important;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    outline: none;
}

.toun-ai-search-submit:hover {
    background: #189ba7;
    transform: translateY(-50%) scale(1.05) !important;
}

.toun-ai-search-submit svg {
    width: 16px !important;
    height: 16px !important;
    margin-left: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #toun-ai-search-container {
        padding: 15px;
        margin: 10px;
    }
    .toun-ai-chat-feed {
        height: 380px;
    }
    .toun-chat-bubble {
        max-width: 90%;
    }
}

/* Homepage Simple Layout */
.toun-ai-search-container.simple-layout {
    max-width: 650px;
    margin: 0 auto;
    padding: 0;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
    width: 100%;
}

.toun-ai-search-container.simple-layout .toun-ai-chat-input-wrap {
    padding-top: 0;
}

#toun-ai-search-homepage-form {
    display: flex;
    gap: 12px;
    position: relative;
    width: 100%;
}

#toun-ai-search-homepage-input {
    flex: 1;
    height: 48px !important;
    padding: 0 60px 0 22px !important;
    border: 1.5px solid #a89d74;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 15px rgba(168, 157, 116, 0.08);
    background: #ffffff;
    color: #222222;
}

#toun-ai-search-homepage-input:focus {
    border-color: #a89d74;
    box-shadow: 0 6px 20px rgba(168, 157, 116, 0.2);
}

.toun-ai-search-container.simple-layout .toun-ai-search-submit {
    width: 38px !important;
    height: 38px !important;
    background: #a89d74;
}

.toun-ai-search-container.simple-layout .toun-ai-search-submit:hover {
    background: #90855c;
}

/* Сворачивание карты и разворачивание списка */
.half-map-wrap.map-collapsed .half-map-left-wrap {
    display: none !important;
    width: 0 !important;
    flex: 0 0 0 !important;
    max-width: 0 !important;
}

.half-map-wrap.map-collapsed .half-map-right-wrap {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    left: 0 !important;
    padding-left: 0 !important;
}

/* Стилизация кнопки-переключателя */
#toun-map-toggle {
    border-radius: 4px;
    background: #ffffff;
    color: #222222;
    transition: all 0.2s ease-in-out;
}

#toun-map-toggle:hover {
    background: #f7f8f9;
    border-color: #a89d74;
    color: #a89d74;
}

#toun-map-toggle.active {
    background: rgba(8, 140, 152, 0.06);
    border-color: #088c98;
    color: #088c98;
}

/* Скрытие кнопки на мобильных устройствах (так как там есть стандартный переключатель Houzez) */
@media (max-width: 768px) {
    #toun-map-toggle {
        display: none !important;
    }
}
