/* Vista AI Tab Styles for Search Page */

/* Enhanced Tab Navigation Header */
.enhanced-tab-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid #e5e7eb;
    padding: 2rem 0 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tab-navigation {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.tab-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.property-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.property-tab {
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.property-tab:hover {
    background: #f3f4f6;
    color: #374151;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.property-tab.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tab-divider {
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.divider-text {
    background: white;
    color: #6b7280;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 2px solid #d1d5db;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ai-main-tab {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 600;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.ai-main-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.ai-main-tab:hover::before {
    left: 100%;
}

.ai-main-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.ai-main-tab.active {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
    }
}

.ai-tab-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.ai-tab-content i {
    font-size: 1.25rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-2px);
    }
}

.ai-tab-text {
    font-size: 0.95rem;
    font-weight: 600;
}

.ai-tab-badge {
    background: #fbbf24;
    color: #92400e;
    padding: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px #fbbf24;
    }
    to {
        box-shadow: 0 0 10px #fbbf24, 0 0 15px #fbbf24;
    }
}

/* Responsive Design for Tab Navigation */
@media (max-width: 1024px) {
    .tab-navigation {
        gap: 1.5rem;
    }

    .property-tabs {
        gap: 0.25rem;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .enhanced-tab-header {
        padding: 1.5rem 0 1rem 0;
    }

    .tab-navigation {
        flex-direction: column;
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .tab-section {
        width: 100%;
        gap: 0.75rem;
    }

    .property-tabs {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .tab-divider {
        padding: 0;
        margin: 0.5rem 0;
    }

    .divider-text {
        font-size: 0.7rem;
        padding: 0.25rem 0.75rem;
    }

    .ai-main-tab {
        width: 100%;
        max-width: 300px;
        padding: 0.875rem 1.25rem;
    }

    .ai-tab-content {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .property-tabs {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .tab-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
        min-width: 80px;
    }
}

/* Rest of the AI assistant styles... */

.ai-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.ai-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ai-title i {
    font-size: 2rem;
    color: #667eea;
}

.ai-title h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.ai-description {
    font-size: 1.1rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.ai-chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.ai-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

.ai-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-messages::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.ai-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
}

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

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

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

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message.ai .message-avatar {
    background: #f3f4f6;
    color: #6b7280;
}

.message-content {
    flex: 1;
}

.message.user .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.message.ai .message-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.message-text {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user .message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message.ai .message-text {
    background: #f3f4f6;
    color: #374151;
    border-bottom-left-radius: 0.25rem;
}

.message.typing .message-text {
    font-style: italic;
    color: #9ca3af;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.8;
}

.message.user .message-meta {
    justify-content: flex-end;
}

.message.ai .message-meta {
    justify-content: flex-start;
}

.message-time {
    color: #9ca3af;
}

.message-intent {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.7rem;
}

.ai-input-section {
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}

.ai-input-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    align-items: center;
}

.ai-input-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 2rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: #1f2937 !important; /* Dark text color for visibility - important to override any inheritance */
    background: white !important; /* Explicit white background - important to override any inheritance */
    font-family: inherit;
    line-height: 1.4;
    min-height: 1.2em; /* Ensure minimum height for text visibility */
}

.ai-input-field::placeholder {
    color: #9ca3af !important; /* Gray placeholder text - important to override */
    opacity: 1 !important; /* Ensure placeholder is visible - important to override */
}

.ai-input-field:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white !important; /* Ensure background stays white on focus - important */
    color: #1f2937 !important; /* Maintain dark text on focus - important */
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ai-send-btn:active {
    transform: scale(0.95);
}

.ai-quick-actions {
    padding: 1rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.ai-quick-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.ai-quick-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.ai-quick-btn:active {
    transform: translateY(0);
}

/* AI Tab Button Styles */
.ai-tab {
    position: relative;
}

.ai-tab i {
    color: #667eea;
}

.ai-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-tab.active i {
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-assistant-section {
        padding: 1rem 0;
    }

    .ai-chat-container {
        margin: 0 1rem;
        height: 450px;
        border-radius: 0.75rem;
    }

    .ai-messages {
        padding: 1rem;
    }

    .ai-input-container {
        padding: 0.75rem 1rem;
    }

    .ai-quick-actions {
        padding: 0.75rem 1rem;
    }

    .ai-title h2 {
        font-size: 1.5rem;
    }

    .message {
        max-width: 90%;
    }

    .message.user .message-text,
    .message.ai .message-text {
        padding: 0.625rem 0.875rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .ai-chat-container {
        height: 400px;
    }

    .ai-quick-actions {
        flex-direction: column;
    }

    .ai-quick-btn {
        justify-content: center;
        width: 100%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ai-chat-container {
        background: #1f2937;
        border: 1px solid #374151;
    }

    .ai-title h2 {
        color: #f9fafb;
    }

    .ai-description {
        color: #9ca3af;
    }

    .ai-messages {
        scrollbar-color: #4b5563 #1f2937;
    }

    .ai-messages::-webkit-scrollbar-track {
        background: #1f2937;
    }

    .ai-messages::-webkit-scrollbar-thumb {
        background: #4b5563;
    }

    .message.ai .message-text {
        background: #374151;
        color: #f9fafb;
    }

    .ai-input-section {
        background: #111827;
        border-top-color: #374151;
    }

    .ai-input-field {
        background: #1f2937; /* Dark background for dark mode */
        border-color: #374151;
        color: #f9fafb; /* Light text for dark mode */
    }

    .ai-input-field::placeholder {
        color: #9ca3af; /* Lighter placeholder for dark mode */
    }

    .ai-input-field:focus {
        border-color: #667eea;
        background: #1f2937; /* Keep dark background on focus */
        color: #f9fafb; /* Keep light text on focus */
    }

    .ai-quick-btn {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }

    .ai-quick-btn:hover {
        background: #667eea;
    }
}
