/* ============================================
   BuscaRimóvel - Clean Split Layout
   ============================================ */

:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #3B82F6;
    --primary-bg: #EFF6FF;
    --primary-bg2: #DBEAFE;
    --bg: #FAFBFC;
    --bg-chat: #F5F6F8;
    --white: #FFFFFF;
    --text: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --success: #22C55E;
    --success-bg: #F0FDF4;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Header
   ============================================ */
.header {
    background: var(--primary);
    padding: 0 32px;
    flex-shrink: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 100px;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   App Layout
   ============================================ */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: 320px;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================================
   Stepper
   ============================================ */
.stepper {
    padding: 24px 24px 16px;
    flex: 1;
}

.step {
    display: flex;
    gap: 14px;
    position: relative;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-light);
    color: var(--text-muted);
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.step-line {
    width: 2px;
    flex: 1;
    background: var(--border);
    margin: 4px 0;
    transition: background 0.4s ease;
}

.step-content {
    padding: 8px 0 28px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s;
}

.step-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    transition: color 0.3s;
}

.step-value {
    display: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-top: 4px;
    padding: 3px 10px;
    background: var(--primary-bg);
    border-radius: 6px;
    width: fit-content;
}

/* Step Active */
.step.active .step-icon {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px var(--primary-bg2);
    animation: stepPulse 2s ease-in-out infinite;
}

@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15); }
    50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.08); }
}

.step.active .step-label {
    color: var(--text);
}

.step.active .step-desc {
    color: var(--text-secondary);
}

/* Step Completed */
.step.completed .step-icon {
    background: var(--success);
    color: white;
    box-shadow: none;
    animation: none;
}

.step.completed .step-line {
    background: var(--success);
}

.step.completed .step-label {
    color: var(--text);
}

.step.completed .step-desc {
    color: var(--text-secondary);
}

.step.completed .step-value {
    display: inline-block;
}

/* ============================================
   Sidebar Profile Card
   ============================================ */
.sidebar-profile {
    padding: 0 24px 20px;
}

.profile-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    padding: 20px;
    color: white;
}

.profile-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.95;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-label {
    opacity: 0.75;
}

.profile-value {
    font-weight: 600;
    text-align: right;
    max-width: 55%;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.powered-by {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================
   Mobile Progress Bar
   ============================================ */
.mobile-progress {
    display: none;
    padding: 12px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
    font-weight: 500;
}

/* ============================================
   Chat Area
   ============================================ */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-chat);
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-messages {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

/* Welcome */
.chat-welcome {
    text-align: center;
    padding: 40px 20px 24px;
}

.welcome-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 0 0 4px var(--primary-bg2);
}

.chat-welcome h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.chat-welcome p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 380px;
    margin: 0 auto;
}

/* ============================================
   Messages
   ============================================ */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: msgIn 0.35s ease-out;
}

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

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

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

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.message.assistant .message-avatar {
    background: var(--primary);
    color: white;
    font-size: 15px;
    font-weight: 700;
}

.message.user .message-avatar {
    background: var(--border);
    color: var(--text-secondary);
    font-size: 13px;
}

.message-bubble {
    padding: 12px 18px;
    border-radius: var(--radius-xl);
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
}

.message.assistant .message-bubble {
    background: var(--white);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.message.user .message-bubble {
    background: var(--primary);
    border-bottom-right-radius: 6px;
    color: white;
}

.message-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 6px;
}

.message.user .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-5px); opacity: 1; }
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 44px;
}

.quick-reply-btn {
    background: var(--white);
    border: 1.5px solid var(--primary-light);
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.quick-reply-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Input Area
   ============================================ */
.chat-input-area {
    padding: 16px 32px 20px;
    background: var(--white);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 28px;
    padding: 6px 8px 6px 20px;
    transition: all 0.2s;
    max-width: 720px;
    margin: 0 auto;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    padding: 8px 0;
}

.input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.input-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Partners Bar */
.partners-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    font-size: 11px;
}

.partners-label {
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 2px;
}

.partners-bar a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.partners-bar a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.partners-sep {
    color: var(--border);
    font-size: 8px;
}

/* ============================================
   Searching Animation
   ============================================ */
.searching-container {
    width: 100%;
    animation: msgIn 0.35s ease-out;
}

.searching-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-md);
}

.searching-animation {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 32px;
    flex-shrink: 0;
}

.searching-bar {
    width: 6px;
    border-radius: 3px;
    background: var(--primary);
    animation: searchPulse 1.2s ease-in-out infinite;
}

.searching-bar:nth-child(1) { height: 12px; animation-delay: 0s; }
.searching-bar:nth-child(2) { height: 20px; animation-delay: 0.15s; }
.searching-bar:nth-child(3) { height: 16px; animation-delay: 0.3s; }
.searching-bar:nth-child(4) { height: 24px; animation-delay: 0.45s; }

@keyframes searchPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

.searching-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.searching-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.searching-sites {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    transition: opacity 0.3s;
}

/* ============================================
   Property Cards
   ============================================ */
.property-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.property-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s;
    animation: cardIn 0.4s ease-out both;
}

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

.property-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.property-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.property-index {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.property-title-area {
    flex: 1;
    min-width: 0;
}

.property-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin: 0;
}

.property-address {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.property-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.property-features {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.property-feat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.property-feat svg {
    color: var(--text-muted);
}

.property-highlight {
    font-size: 12px;
    color: var(--primary-dark);
    background: var(--primary-bg);
    padding: 6px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-weight: 500;
    display: inline-block;
}

.property-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.property-source {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.property-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 16px;
    border: 1.5px solid var(--primary);
    border-radius: 100px;
    transition: all 0.2s;
}

.property-link:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   Search Links (buscar nos parceiros)
   ============================================ */
.search-links-container {
    width: 100%;
    animation: msgIn 0.35s ease-out;
}

.search-links-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.search-links-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
}

.search-links-list {
    display: flex;
    flex-direction: column;
}

.search-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

.search-link-item:last-child {
    border-bottom: none;
}

.search-link-item:hover {
    background: var(--bg);
}

.search-link-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    min-width: 140px;
}

.search-link-desc {
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
}

.search-link-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============================================
   Scrollbar
   ============================================ */
.chat-container::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.chat-container::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .mobile-progress {
        display: block;
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-input-area {
        padding: 12px 16px 16px;
    }

    .header {
        padding: 0 16px;
    }

    .header-inner {
        height: 56px;
    }

    .logo-tagline {
        display: none;
    }
}

@media (max-width: 480px) {
    .message {
        max-width: 92%;
    }

    .message-bubble {
        font-size: 13px;
        padding: 10px 14px;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
    }

    .chat-welcome h3 {
        font-size: 18px;
    }

    .chat-welcome p {
        font-size: 13px;
    }

    .input-wrapper {
        padding: 4px 6px 4px 16px;
    }

    .send-btn {
        width: 38px;
        height: 38px;
    }

    .property-card {
        padding: 14px 16px;
    }

    .property-price {
        font-size: 18px;
    }

    .property-features {
        gap: 8px;
    }

    .searching-card {
        padding: 16px;
        gap: 12px;
    }
}
