/**
 * StreetNY CRM - AI Assistant Styles
 * Comprehensive styling for all AI components
 */

/* =========================================================================
   CSS Variables for AI Theme
   ========================================================================= */
:root {
    --ai-primary: #6366f1;
    --ai-primary-light: #818cf8;
    --ai-primary-dark: #4f46e5;
    --ai-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --ai-gradient-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    
    --ai-success: #10b981;
    --ai-warning: #f59e0b;
    --ai-danger: #ef4444;
    
    --ai-score-hot: #ef4444;
    --ai-score-warm: #f59e0b;
    --ai-score-cold: #3b82f6;
    
    --ai-bg-light: rgba(255, 255, 255, 0.95);
    --ai-bg-dark: rgba(17, 24, 39, 0.95);
    --ai-border: rgba(99, 102, 241, 0.2);
    --ai-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --ai-shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    
    --ai-radius: 12px;
    --ai-radius-sm: 8px;
    --ai-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode support */
.dark, [data-theme="dark"] {
    --ai-bg-light: rgba(17, 24, 39, 0.95);
    --ai-border: rgba(139, 92, 246, 0.3);
}

/* =========================================================================
   AI Assistant Button
   ========================================================================= */
.ai-assistant-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--ai-gradient);
    color: white;
    border: none;
    border-radius: var(--ai-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ai-transition);
    position: relative;
    overflow: hidden;
}

.ai-assistant-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--ai-shadow-glow);
}

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

.ai-assistant-btn i {
    font-size: 18px;
}

.ai-sparkle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
}

.ai-assistant-btn:hover .ai-sparkle {
    animation: ai-sparkle 0.6s ease-out;
}

@keyframes ai-sparkle {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Small variant */
.ai-assistant-btn.ai-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.ai-assistant-btn.ai-btn-sm i {
    font-size: 16px;
}

/* Icon only variant */
.ai-assistant-btn.ai-btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    justify-content: center;
}

.ai-assistant-btn.ai-btn-icon span:not(.ai-sparkle) {
    display: none;
}

/* =========================================================================
   AI Badge
   ========================================================================= */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--ai-gradient-soft);
    color: var(--ai-primary);
    border: 1px solid var(--ai-border);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-badge i {
    font-size: 12px;
}

/* =========================================================================
   AI Loader
   ========================================================================= */
.ai-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 12px;
}

.ai-loader-animation {
    display: flex;
    gap: 4px;
}

.ai-loader-animation span {
    width: 8px;
    height: 8px;
    background: var(--ai-gradient);
    border-radius: 50%;
    animation: ai-bounce 1.4s ease-in-out infinite both;
}

.ai-loader-animation span:nth-child(1) { animation-delay: -0.32s; }
.ai-loader-animation span:nth-child(2) { animation-delay: -0.16s; }
.ai-loader-animation span:nth-child(3) { animation-delay: 0s; }

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

.ai-loader p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

/* =========================================================================
   AI Suggestion Card
   ========================================================================= */
.ai-suggestion-card {
    background: var(--ai-bg-light);
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius);
    overflow: hidden;
    box-shadow: var(--ai-shadow);
    backdrop-filter: blur(10px);
}

.ai-suggestion-header {
    padding: 12px 16px;
    background: var(--ai-gradient-soft);
    border-bottom: 1px solid var(--ai-border);
}

.ai-suggestion-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
}

.dark .ai-suggestion-content {
    color: #e5e7eb;
}

.ai-suggestion-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid var(--ai-border);
}

.dark .ai-suggestion-actions {
    background: rgba(255, 255, 255, 0.02);
}

/* AI Buttons */
.ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--ai-radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ai-transition);
}

.ai-btn-primary {
    background: var(--ai-gradient);
    color: white;
}

.ai-btn-primary:hover {
    box-shadow: var(--ai-shadow-glow);
    transform: translateY(-1px);
}

.ai-btn-secondary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--ai-primary);
}

.ai-btn-secondary:hover {
    background: rgba(99, 102, 241, 0.2);
}

.ai-btn-ghost {
    background: transparent;
    color: #6b7280;
}

.ai-btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #374151;
}

/* Feedback Bar */
.ai-feedback-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--ai-border);
    font-size: 12px;
    color: #6b7280;
}

.ai-feedback-btn {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    transition: var(--ai-transition);
}

.ai-feedback-btn:hover {
    background: var(--ai-gradient-soft);
    border-color: var(--ai-primary);
    color: var(--ai-primary);
}

.ai-feedback-btn i {
    font-size: 16px;
}

/* =========================================================================
   AI Score Badge
   ========================================================================= */
.ai-score-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    position: relative;
}

.ai-score-badge-small {
    width: 32px;
    height: 32px;
    font-size: 11px;
}

.ai-score-badge-medium {
    width: 48px;
    height: 48px;
    font-size: 14px;
}

.ai-score-badge-large {
    width: 64px;
    height: 64px;
    font-size: 18px;
}

.ai-score-badge .ai-score-label {
    font-size: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.8;
}

.ai-score-badge-small .ai-score-label { display: none; }

.ai-score-hot {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.ai-score-warm {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.ai-score-cold {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

/* =========================================================================
   AI Modal
   ========================================================================= */
.ai-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ai-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.ai-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--ai-bg-light);
    border-radius: var(--ai-radius);
    box-shadow: var(--ai-shadow);
    overflow: hidden;
    animation: ai-modal-in 0.3s ease-out;
}

@keyframes ai-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ai-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--ai-gradient);
    color: white;
}

.ai-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: var(--ai-transition);
}

.ai-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-modal-content {
    padding: 20px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* =========================================================================
   AI Insights Grid (Lead Modal)
   ========================================================================= */
.ai-insights-grid {
    display: grid;
    gap: 20px;
}

.ai-insights-score {
    text-align: center;
    padding: 20px;
    background: var(--ai-gradient-soft);
    border-radius: var(--ai-radius);
}

.ai-score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.ai-score-circle .score-value {
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.ai-score-circle .score-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
}

.ai-confidence {
    color: #6b7280;
    font-size: 13px;
    margin: 0;
}

.ai-insights-breakdown h4,
.ai-insights-factors h4,
.ai-insights-action h4,
.ai-insights-recommendations h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.dark .ai-insights-breakdown h4,
.dark .ai-insights-factors h4,
.dark .ai-insights-action h4,
.dark .ai-insights-recommendations h4 {
    color: #e5e7eb;
}

/* Breakdown bars */
.breakdown-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-item {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    align-items: center;
    gap: 10px;
}

.breakdown-label {
    font-size: 12px;
    color: #6b7280;
}

.breakdown-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.dark .breakdown-bar {
    background: #374151;
}

.breakdown-fill {
    height: 100%;
    background: var(--ai-gradient);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.breakdown-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--ai-primary);
    text-align: right;
}

/* Factors list */
.ai-insights-factors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-insights-factors li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
}

.dark .ai-insights-factors li {
    border-bottom-color: #374151;
}

.ai-insights-factors li:last-child {
    border-bottom: none;
}

/* Action card */
.action-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: var(--ai-radius-sm);
    border-left: 4px solid var(--ai-primary);
}

.dark .action-card {
    background: #1f2937;
}

.action-card.action-high {
    border-left-color: var(--ai-score-hot);
}

.action-card.action-medium {
    border-left-color: var(--ai-score-warm);
}

.action-icon {
    width: 48px;
    height: 48px;
    background: var(--ai-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon i {
    font-size: 24px;
    color: white;
}

.action-details strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.action-details p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.action-hint {
    margin-top: 8px !important;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    font-style: italic;
}

.action-hint i {
    color: var(--ai-warning);
}

/* Recommendations */
.ai-insights-recommendations ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-insights-recommendations li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
}

.ai-insights-recommendations li i {
    color: var(--ai-warning);
    margin-top: 2px;
}

/* =========================================================================
   AI Chatbot Widget
   ========================================================================= */
#ai-chatbot-widget {
    position: fixed;
    bottom: 100px; /* Positioned above phone FAB button */
    right: 24px;
    z-index: 9990;
}

.ai-chatbot-trigger {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ai-gradient);
    border: none;
    box-shadow: var(--ai-shadow), var(--ai-shadow-glow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ai-transition);
    position: relative;
}

.ai-chatbot-trigger:hover {
    transform: scale(1.1);
}

.ai-chatbot-trigger i {
    font-size: 28px;
    color: white;
}

.ai-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--ai-primary);
    animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.ai-chatbot-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-height: 500px;
    background: var(--ai-bg-light);
    border-radius: var(--ai-radius);
    box-shadow: var(--ai-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--ai-transition);
}

.ai-chatbot-panel.hidden {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
}

.ai-chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--ai-gradient);
    color: white;
}

.ai-chatbot-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.ai-chatbot-title i {
    font-size: 20px;
}

.ai-chatbot-actions {
    display: flex;
    gap: 4px;
}

.ai-chatbot-actions button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: var(--ai-transition);
}

.ai-chatbot-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
    max-height: 350px;
}

/* Chat Messages */
.ai-chat-message {
    display: flex;
    gap: 10px;
    max-width: 90%;
}

.ai-chat-user {
    flex-direction: row-reverse;
    margin-left: auto;
}

.ai-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-chat-assistant .ai-chat-avatar {
    background: var(--ai-gradient);
}

.ai-chat-avatar i {
    font-size: 16px;
    color: #6b7280;
}

.ai-chat-assistant .ai-chat-avatar i {
    color: white;
}

.ai-chat-bubble {
    background: #f3f4f6;
    padding: 10px 14px;
    border-radius: 12px;
    border-top-left-radius: 4px;
}

.dark .ai-chat-bubble {
    background: #374151;
}

.ai-chat-user .ai-chat-bubble {
    background: var(--ai-gradient);
    color: white;
    border-radius: 12px;
    border-top-right-radius: 4px;
}

.ai-chat-content {
    font-size: 13px;
    line-height: 1.5;
}

.ai-chat-time {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
}

.ai-chat-user .ai-chat-time {
    color: rgba(255, 255, 255, 0.7);
}

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

.ai-typing-indicator span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: ai-typing 1.4s ease-in-out infinite;
}

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

@keyframes ai-typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Chat Input */
.ai-chatbot-input {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.dark .ai-chatbot-input {
    border-top-color: #374151;
    background: #1f2937;
}

.ai-chatbot-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    background: white;
    transition: var(--ai-transition);
}

.dark .ai-chatbot-input input {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

.ai-chatbot-input input:focus {
    outline: none;
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ai-chatbot-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ai-gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ai-transition);
}

.ai-chatbot-input button:hover {
    transform: scale(1.05);
}

.ai-chatbot-input button i {
    font-size: 18px;
}

/* =========================================================================
   AI Toast Notifications
   ========================================================================= */
.ai-toast {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background: var(--ai-bg-light);
    border-radius: var(--ai-radius-sm);
    box-shadow: var(--ai-shadow);
    padding: 12px 16px;
    z-index: 9998;
    opacity: 0;
    transform: translateX(100%);
    transition: var(--ai-transition);
}

.ai-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.ai-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.ai-toast-success .ai-toast-content i {
    color: var(--ai-success);
}

.ai-toast-error .ai-toast-content i {
    color: var(--ai-danger);
}

.ai-toast-info .ai-toast-content i {
    color: var(--ai-primary);
}

/* =========================================================================
   AI Error State
   ========================================================================= */
.ai-error {
    text-align: center;
    padding: 24px;
    color: var(--ai-danger);
}

.ai-error i {
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: 12px;
}

.ai-error p {
    margin: 0;
    font-size: 14px;
}

/* =========================================================================
   Email AI Panel Integration
   ========================================================================= */
.email-ai-panel {
    background: var(--ai-gradient-soft);
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.email-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.1);
    cursor: pointer;
}

.email-ai-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ai-primary);
}

.email-ai-content {
    padding: 16px;
}

.email-ai-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.email-ai-option {
    padding: 8px 14px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--ai-transition);
}

.email-ai-option:hover,
.email-ai-option.active {
    background: var(--ai-primary);
    color: white;
    border-color: var(--ai-primary);
}

.email-ai-quick-replies {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.email-ai-quick-reply {
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--ai-radius-sm);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: var(--ai-transition);
}

.email-ai-quick-reply:hover {
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* =========================================================================
   Property AI Section
   ========================================================================= */
.property-ai-section {
    background: var(--ai-gradient-soft);
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius);
    padding: 20px;
    margin: 20px 0;
}

.property-ai-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-ai-section h3 i {
    color: var(--ai-primary);
}

.property-ai-styles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.property-ai-style {
    padding: 8px 16px;
    background: white;
    border: 2px solid transparent;
    border-radius: var(--ai-radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: var(--ai-transition);
}

.property-ai-style:hover {
    border-color: var(--ai-border);
}

.property-ai-style.active {
    border-color: var(--ai-primary);
    background: var(--ai-gradient-soft);
}

.property-ai-output {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--ai-radius-sm);
    padding: 16px;
    min-height: 150px;
}

.property-ai-output textarea {
    width: 100%;
    min-height: 150px;
    border: none;
    resize: vertical;
    font-size: 14px;
    line-height: 1.6;
}

.property-ai-output textarea:focus {
    outline: none;
}

/* =========================================================================
   Sequence AI Builder
   ========================================================================= */
.sequence-ai-builder {
    background: var(--ai-bg-light);
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius);
    overflow: hidden;
}

.sequence-ai-builder-header {
    padding: 16px 20px;
    background: var(--ai-gradient);
    color: white;
}

.sequence-ai-builder-header h3 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sequence-ai-builder-content {
    padding: 20px;
}

.sequence-ai-form {
    display: grid;
    gap: 16px;
}

.sequence-ai-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
}

.sequence-ai-field select,
.sequence-ai-field input,
.sequence-ai-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: var(--ai-radius-sm);
    font-size: 14px;
    transition: var(--ai-transition);
}

.sequence-ai-field select:focus,
.sequence-ai-field input:focus,
.sequence-ai-field textarea:focus {
    outline: none;
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.sequence-ai-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.sequence-ai-step {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: var(--ai-radius-sm);
    margin-bottom: 12px;
}

.sequence-ai-step-number {
    width: 32px;
    height: 32px;
    background: var(--ai-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.sequence-ai-step-content {
    flex: 1;
}

.sequence-ai-step-type {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 4px;
}

.sequence-ai-step-subject {
    font-weight: 600;
    margin-bottom: 8px;
}

.sequence-ai-step-body {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
}

/* =========================================================================
   Lead Card AI Score Integration
   ========================================================================= */
.lead-card .ai-score-container {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    transition: var(--ai-transition);
}

.lead-card .ai-score-container:hover {
    transform: scale(1.1);
}

/* =========================================================================
   Responsive Adjustments
   ========================================================================= */
@media (max-width: 768px) {
    .ai-chatbot-panel {
        width: calc(100vw - 40px);
        right: -10px;
    }
    
    .ai-modal-dialog {
        max-width: 100%;
        margin: 10px;
    }
    
    .ai-insights-grid {
        grid-template-columns: 1fr;
    }
}
