.ai-chat-wrapper {
    box-sizing: border-box;
}

/* 🖼️ FULL-WIDTH AI HERO BANNER - TEMIZ VE SADE */
.ai-hero-fullwidth-banner {
    position: relative !important;
    width: 100% !important;
    height: 380px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-bottom: 2px solid #10b981 !important;
    background: url('../img/ai-slider2.jpg') no-repeat center center !important;
    background-size: contain !important;
    background-color: #030712 !important;
}

/* 📱 MOBİL UYUM */
@media (max-width: 991px) {
    .ai-hero-fullwidth-banner {
        height: 220px !important;
        background-size: cover !important;
        background-position: center center !important;
    }
}

@media (max-width: 576px) {
    .ai-hero-fullwidth-banner {
        height: 160px !important;
        background-size: cover !important;
        background-position: center center !important;
    }
}

/* --- 🛸 Sol Sidebar / Maskot Paneli --- */
.ai-sidebar-panel {
    border-radius: 12px !important;
    border: 1px solid #334155 !important;
    background: #0F172A !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    overflow: hidden;
}
.ai-sidebar-heading {
    background: #1E293B !important;
    border-bottom: 1px solid #334155 !important;
    padding: 15px 20px !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-sidebar-heading i { color: #10B981; }
.ai-sidebar-body { padding: 20px 15px !important; }

/* 🤖 MASCOT CONTAINER ADAPTATION */
.mascot-container {
    width: 100%;
    max-width: 240px;
    margin: 0 auto 15px;
    display: block;
}
#robot-svg {
    width: 100% !important;
    height: auto !important;
    max-height: 280px !important;
    animation: robot-float-main 3s infinite ease-in-out;
}

/* --- 🛠️ ROBOT ANIMATION KEYFRAMES --- */
@keyframes robot-float-main { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.anim-body-breathe { transform-origin: 200px 300px; animation: body-breathe 4s infinite ease-in-out; }
@keyframes body-breathe { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-2px) rotate(0.3deg); } }

.anim-antenna-core { animation: pulse-core 1.5s infinite ease-in-out; transform-origin: 200px 70px; }
.anim-signal-wave-1 { animation: wave-out 2s infinite ease-in-out; transform-origin: 200px 70px; }
@keyframes pulse-core { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.3); opacity: 1; } }
@keyframes wave-out { 0% { transform: scale(0.6); opacity: 0.6; } 100% { transform: scale(1.4); opacity: 0; } }

.anim-eyes { transform-origin: center; animation: eyes-blink 3s infinite ease-in-out; }
@keyframes eyes-blink { 0%, 90%, 100% { transform: scaleY(1); opacity: 1; } 95% { transform: scaleY(0.1); opacity: 0.8; } }
.anim-chest-ui { animation: chest-float 2s infinite ease-in-out; transform-origin: 200px 320px; }
@keyframes chest-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.pose-arm-left { transform-origin: 117px 240px; transition: transform 0.4s ease; }
.pose-forearm-left { transform-origin: 117px 280px; transition: transform 0.4s ease; }
.pose-arm-right { transform-origin: 270px 238px; transition: all 0.4s ease; }
.pose-forearm-right { transform-origin: 280px 278px; transition: all 0.4s ease; }

#robot-svg[data-pose="thinking"] #leftArm { transform: rotate(15deg); }
#robot-svg[data-pose="thinking"] #rightArm { transform: rotate(-38deg) translateY(-6px); }
#robot-svg[data-pose="explaining"] #leftArm { animation: arm-explain-left 2.4s infinite ease-in-out; }
#robot-svg[data-pose="explaining"] #rightArm { animation: arm-explain-right 2.8s infinite ease-in-out; }

@keyframes arm-explain-left { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(8deg); } }
@keyframes arm-explain-right { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(-12deg); } }

/* --- 💬 Sağ Chat Konteyner Alanı --- */
.ai-chat-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    height: 580px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}
.ai-chat-header {
    background: #0F172A;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #10B981;
}
.ai-chat-header-user { display: flex; align-items: center; gap: 12px; }
.ai-chat-header-user h4 { margin: 0 0 2px 0; color: #ffffff; font-size: 15px; font-weight: 700; }
.ai-chat-header-user p { margin: 0; color: #94a3b8; font-size: 11.5px; }
.ai-avatar-online {
    position: relative; width: 38px; height: 38px; background: #1E293B; color: #10B981;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; border: 1px solid #334155;
}
.online-dot { width: 8px; height: 8px; background: #10B981; border-radius: 50%; position: absolute; bottom: 0; right: 0; border: 2px solid #0F172A; }

/* ==========================================================================
   💬 MESAJ SATIRLARI & HİZALAMA (DÜZELTİLEN ALAN)
   ========================================================================== */
.ai-chat-body { 
    flex: 1; 
    padding: 20px; 
    overflow-y: auto; 
    background: #f8fafc; 
    display: flex !important; 
    flex-direction: column !important; 
    gap: 16px !important; 
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Mesaj Taşıyıcı Satır */
.message-row { 
    display: flex !important; 
    align-items: flex-end !important; 
    gap: 10px !important; 
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 🤖 BOT MESAJI: Kesinlikle Sola Yaslanır, Avatar Solda Başlar */
.message-row.ai-msg { 
    justify-content: flex-start !important; 
    flex-direction: row !important;
    align-self: flex-start !important;
    margin-right: auto !important; 
    margin-left: 0 !important;
}

/* 👤 KULLANICI MESAJI: Kesinlikle Sağa Yaslanır */
.message-row.user-msg { 
    justify-content: flex-end !important; 
    flex-direction: row !important;
    align-self: flex-end !important;
    margin-left: auto !important; 
    margin-right: 0 !important;
}

/* 🤖 Sol Alttaki Robot Avatarı */
.msg-avatar {
    width: 34px !important; 
    height: 34px !important; 
    min-width: 34px !important;
    min-height: 34px !important;
    background: #0F172A !important; 
    color: #10B981 !important; 
    border-radius: 50% !important;
    display: inline-flex !important; 
    align-items: center !important; 
    justify-content: center !important; 
    font-size: 14px !important; 
    flex-shrink: 0 !important; 
    border: 1px solid #334155 !important;
    margin-bottom: 2px !important;
}

/* Ortak Balon Stili */
.msg-bubble { 
    padding: 12px 18px !important; 
    border-radius: 16px !important; 
    font-size: 13.5px !important; 
    line-height: 1.55 !important; 
    position: relative !important; 
    word-break: break-word !important; 
    display: inline-block !important;
    box-sizing: border-box !important;
}

/* Bot Balonu: En fazla %75 kaplar, sağa taşmaz */
.ai-msg .msg-bubble { 
    background: #ffffff !important; 
    color: #1E293B !important; 
    border: 1px solid #e2e8f0 !important; 
    border-bottom-left-radius: 4px !important; 
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04) !important; 
    text-align: left !important;
    max-width: 75% !important;
}

/* Kullanıcı Balonu: En fazla %70 kaplar */
.user-msg .msg-bubble { 
    background: #10B981 !important; 
    color: #ffffff !important; 
    border: none !important;
    border-bottom-right-radius: 4px !important; 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important; 
    text-align: left !important;
    max-width: 70% !important;
}

.msg-time { 
    display: block !important; 
    font-size: 10px !important; 
    margin-top: 5px !important; 
    text-align: right !important; 
    opacity: 0.65 !important; 
}
.user-msg .msg-time { color: #ffffff !important; }
.ai-msg .msg-time { color: #94a3b8 !important; }


/* 3 Nokta Loading Balonunun Konumu */
#aiTyping {
    display: none; /* !important kaldırıldı, JS style.display ile doğrudan kontrol edebilir */
    align-self: flex-start !important;
    margin-right: auto !important;
    margin-left: 0 !important;
    justify-content: flex-start !important;
    flex-direction: row !important;
}


.dynamic-typing-fix {
    padding: 12px 18px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-bottom-left-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 60px !important;
    height: 38px !important;
}

.ai-typing-indicator-dots {
    display: inline-flex !important;
    gap: 6px !important;
    align-items: center !important;
    justify-content: center !important;
    height: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
}
.dot-bounce {
    width: 8px !important;
    height: 8px !important;
    background: #10B981 !important;
    border-radius: 50% !important;
    display: inline-block !important;
    animation: aiDotBounce 1.4s infinite ease-in-out both !important;
}

@keyframes aiDotBounce {
    0%, 80%, 100% { transform: scale(0.3); opacity: 0.3; } 
    40% { transform: scale(1.0); opacity: 1; }
}

/* --- 🎹 Input & Buttons Footer --- */
.ai-chat-footer { padding: 15px 20px; background: #ffffff; border-top: 1px solid #e2e8f0; display: flex; gap: 10px; align-items: center; }
#aiChatForm { display: flex; flex: 1; gap: 10px; margin: 0; }
#aiInput { flex: 1; height: 44px; border: 1px solid #cbd5e1; border-radius: 24px; padding: 0 20px; font-size: 13.5px; outline: none; background: #f8fafc; }
#aiInput:focus { border-color: #10B981; background: #ffffff; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08); }

.ai-send-btn {
    width: 44px; height: 44px; border: none; border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px; transition: all 0.2s ease; flex-shrink: 0;
    background: #10B981; color: #ffffff; box-shadow: 0 3px 10px rgba(16, 185, 129, 0.2);
}
.ai-send-btn:hover { background: #0d9488; transform: scale(1.04); }

.ai-mascot-voice-btn {
    width: 100%; height: 46px; border: none; border-radius: 23px; font-size: 14px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2); background: #10B981; color: #ffffff;
}
.ai-mascot-voice-btn:hover { background: #0d9488; transform: translateY(-1px); }
.ai-mascot-voice-btn.recording { background: #ef4444 !important; animation: voice-pulse 1.4s infinite; }
@keyframes voice-pulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

/* --- 📺 Reklam Panelleri --- */
.ai-ad-vertical { width: 160px; height: 600px; overflow: hidden; border-radius: 12px; }
.ai-ad-horizontal { width: 100%; height: 140px; overflow: hidden; border-radius: 14px; margin-bottom: 35px; }

/* --- 📊 Bottom Summary --- */
.ai-bottom-summary { width: 100%; background: #ffffff; border-top: 1px solid #e2e8f0; padding: 16px 24px; box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.02); }
.ai-summary-container { display: flex; align-items: center; justify-content: space-between; }
.ai-summary-text { font-size: 13.5px; color: #64748B; font-weight: 500; }
.ai-summary-count { color: #ff7a00; font-weight: 700; margin-right: 4px; }

/* --- 🏘️ PROPERTY GRID --- */
.ai-results-wrapper { margin-top: 35px; animation: fadeIn 0.4s ease-in-out; clear: both; }
.ai-results-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; }
.ai-results-bar { width: 4px; height: 24px; background: #10B981; border-radius: 2px; }
.ai-results-title { font-size: 20px; font-weight: 800; color: #0F172A; margin: 0; }
.ai-results-count { font-size: 13.5px; color: #64748B; font-weight: 600; }

.ai-property-grid { 
    display: grid !important; 
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important; 
    gap: 24px !important; 
    width: 100% !important; 
    box-sizing: border-box !important; 
}

.ai-prop-card { 
    background: #ffffff !important; 
    border: 1px solid #e2e8f0 !important; 
    border-radius: 14px !important; 
    overflow: hidden !important; 
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.02) !important; 
    transition: all 0.25s ease-in-out !important; 
    display: flex !important; 
    flex-direction: column !important; 
    height: 100% !important; 
    position: relative !important; 
}
.ai-prop-card:hover {
    transform: translateY(-4px) !important; 
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06) !important; 
    border-color: #cbd5e1 !important; 
}
.ai-prop-thumb { position: relative !important; width: 100% !important; aspect-ratio: 16 / 10 !important; overflow: hidden !important; background: #f1f5f9; }
.ai-prop-thumb img { width: 100% !important; height: 100% !important; object-fit: cover !important; object-position: center !important; display: block !important; transition: transform 0.4s ease; }
.ai-prop-card:hover .ai-prop-thumb img { transform: scale(1.04); }

.ai-prop-status { position: absolute !important; left: 12px !important; top: 12px !important; background: var(--kktc-emerald, #10B981) !important; color: #ffffff !important; font-size: 11px !important; font-weight: 700 !important; padding: 4px 10px !important; border-radius: 20px !important; z-index: 2; }
.ai-prop-details { padding: 18px 18px 0 18px !important; display: flex !important; flex-direction: column !important; flex: 1 !important; }
.ai-prop-meta { font-size: 11.5px !important; color: var(--kktc-emerald, #10B981) !important; font-weight: 700 !important; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; text-align: left; display: block; }
.ai-prop-name { color: #0f172a !important; font-weight: 700 !important; font-size: 15.5px !important; margin: 0 0 10px 0 !important; line-height: 1.4 !important; text-align: left !important; min-height: 44px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ai-prop-location { display: flex !important; align-items: center !important; gap: 6px !important; font-size: 12.5px !important; color: #64748b !important; text-align: left !important; margin-bottom: 12px; }
.ai-prop-location i { color: var(--kktc-emerald, #10B981); }

.ai-prop-features { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; padding: 12px 0 !important; border-top: 1px solid #f1f5f9 !important; margin-bottom: 15px !important; align-items: center !important; }
.ai-prop-feat-item { font-size: 12px !important; font-weight: 700 !important; color: #334155 !important; background: #f1f5f9 !important; padding: 5px 10px !important; border-radius: 6px !important; display: inline-flex !important; align-items: center !important; gap: 6px !important; }
.ai-prop-feat-item i { color: var(--kktc-emerald, #10B981); }
.ai-prop-price { font-size: 18px !important; font-weight: 800 !important; color: #ffffff !important; position: absolute !important; right: 12px !important; top: 12px !important; background: rgba(15, 23, 42, 0.85) !important; padding: 4px 12px !important; border-radius: 6px !important; z-index: 2; }

/* Alt Şerit */
.ai-prop-foot {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 14px !important;
    margin-top: auto !important;
    width: calc(100% + 36px) !important; 
    margin-left: -18px !important;
    margin-right: -18px !important;
    box-sizing: border-box !important;
    border-radius: 0 0 14px 14px !important;
    gap: 8px !important;
}
.ai-firm-brand-section { display: flex !important; align-items: center !important; justify-content: flex-start !important; flex: 1 !important; min-width: 0 !important; height: 32px !important; }
.ai-firm-brand-section img { 
    max-height: 28px !important; 
    width: auto !important; 
    max-width: 100% !important; 
    object-fit: contain !important; 
    display: block !important; 
}
.ai-agent-section { display: flex !important; align-items: center !important; justify-content: flex-end !important; gap: 8px !important; min-width: 0 !important; flex: 1 !important; }
.ai-agent-info { display: flex !important; flex-direction: column !important; align-items: flex-end !important; min-width: 0 !important; line-height: 1.2 !important; }
.ai-agent-name { font-weight: 700 !important; font-size: 12px !important; max-width: 90px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.ai-agent-date { font-size: 10px !important; font-weight: 600 !important; margin-top: 2px !important; white-space: nowrap !important; }
.ai-agent-avatar { width: 28px !important; height: 28px !important; border-radius: 50% !important; overflow: hidden !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; font-weight: 700 !important; font-size: 10px !important; flex-shrink: 0; background: #ffffff !important; border: 1px solid rgba(0,0,0,0.05) !important; }
.ai-agent-avatar img { width: 100% !important; height: 100% !important; object-fit: cover !important; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1199px) { .ai-ad-vertical { display: none !important; } }
@media (max-width: 991px) {
    .ai-property-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .ai-prop-foot { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; min-height: 48px !important; }
    .ai-firm-brand-section { width: 100% !important; justify-content: flex-start !important; }
    .ai-agent-section { width: 100% !important; justify-content: space-between !important; }
}
@media (max-width: 768px) { .ai-property-grid { grid-template-columns: 1fr !important; } }

/* 🎯 AI GRID PAGINATION STYLES */
#aiGridPagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 25px !important;
    width: 100% !important;
}

#aiGridPagination button {
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04) !important;
}

#aiGridPagination button:hover {
    transform: translateY(-1px) !important;
    border-color: #10b981 !important;
}

/* Chip Butonlarının Genişlik ve Taşma Güvenliği */
.ai-chat-suggestions button,
#chipsContainer button {
    max-width: 200px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* 🏠 ASİSTAN CHAT İÇİ MİNİ İLAN KARTLARI */
.ai-mini-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.ai-mini-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    width: 100%;
    box-sizing: border-box;
}

.ai-mini-card:hover {
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ai-mini-card-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
}

.ai-mini-card-info {
    flex: 1;
    min-width: 0;
}

.ai-mini-card-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.ai-mini-card-loc {
    font-size: 10px;
    color: #64748b;
    margin-bottom: 2px;
}

.ai-mini-card-price {
    font-size: 11.5px;
    font-weight: 800;
    color: #10b981;
}

.ai-mini-card-btn {
    font-size: 10px;
    background: #ecfdf5;
    color: #059669;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    flex-shrink: 0;
}