﻿/* AI Realtor Agent Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
}

/* Split Panel Layout */
.split-panel {
    display: flex;
    flex: 1;
    height: calc(100vh - 110px);
    min-height: 500px;
}

.portal-panel {
    flex: 2;
    background-color: #fff;
    border-right: 1px solid #dee2e6;
    position: relative;
    overflow: hidden;
}

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

/* Settings Card */
.settings-card {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 10;
    max-width: 350px;
}

.settings-card .card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(4px);
}

/* Portal Iframe */
#portal-iframe-container {
    width: 100%;
    height: 100%;
}

#portal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Chat Header */
.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #f8f9fa;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.message.user {
    align-self: flex-end;
}

.message.agent {
    align-self: flex-start;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.message.user .message-content {
    background-color: #0d6efd;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.agent .message-content {
    background-color: #e9ecef;
    color: #212529;
    border-bottom-left-radius: 4px;
}

.message-content table {
    font-size: 0.85rem;
    margin: 10px 0;
    border-collapse: collapse;
    width: 100%;
}

.message-content th,
.message-content td {
    border: 1px solid #dee2e6;
    padding: 6px 8px;
    text-align: left;
}

.message-content th {
    background-color: #f1f3f5;
    font-weight: 600;
}

.message-time {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 4px;
    margin-left: 12px;
}

/* Chat Input */
.chat-input-container {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background-color: #fff;
}

/* Agent Status Indicator */
#agent-status {
    font-size: 0.7rem;
}

#agent-status.searching {
    color: #fd7e14;
}

#agent-status.processing {
    color: #0dcaf0;
}

#agent-status.ready {
    color: #198754;
}

/* Responsive Design */
@media (max-width: 768px) {
    .split-panel {
        flex-direction: column;
        height: auto;
    }

    .portal-panel {
        height: 40vh;
        min-height: 300px;
    }

    .chat-panel {
        height: 60vh;
    }

    .settings-card {
        max-width: calc(100% - 40px);
    }

    .message {
        max-width: 95%;
    }
}
