/* ========================================
   40 HYDE PARK - FASE 5: INTELIGENCIA ARTIFICIAL
   Características Avanzadas con IA
   ======================================== */

/* ========================================
   1. AI CHATBOT WIDGET
   ======================================== */
.ai-chatbot-widget {
    position: fixed;
    bottom: calc(100px + env(safe-area-inset-bottom));
    right: var(--space-6);
    z-index: 9996;
}

.ai-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-glow-lg);
    transition: all 0.3s var(--ease-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ai-chatbot-toggle:hover {
    transform: scale(1.1) rotate(10deg);
}

.ai-chatbot-toggle.active {
    transform: scale(0.9);
    background: var(--primary);
    color: var(--accent);
}

.ai-chatbot-toggle::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    animation: chatbotPulse 2s infinite;
}

@keyframes chatbotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0; }
}

.ai-chatbot-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - var(--space-8));
    height: 550px;
    max-height: calc(100vh - 200px);
    background: var(--bg-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s var(--ease-spring);
}

.ai-chatbot-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ai-chatbot-header {
    background: var(--primary-gradient);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.ai-chatbot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.ai-chatbot-info {
    flex: 1;
}

.ai-chatbot-name {
    color: var(--text-white);
    font-weight: 600;
    font-size: 1.0625rem;
}

.ai-chatbot-status {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.ai-chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-chatbot-close {
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--space-2);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ai-chatbot-close:hover {
    opacity: 1;
}

.ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--bg-light);
}

.ai-chatbot-message {
    max-width: 80%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.5;
    animation: messageSlide 0.3s var(--ease-out);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chatbot-message.user {
    align-self: flex-end;
    background: var(--primary);
    color: var(--text-white);
    border-bottom-right-radius: 4px;
}

.ai-chatbot-message.bot {
    align-self: flex-start;
    background: var(--bg-white);
    color: var(--text-dark);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.ai-chatbot-message.typing {
    display: flex;
    gap: 4px;
    padding: var(--space-4);
}

.ai-chatbot-message.typing span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.ai-chatbot-message.typing span:nth-child(1) { animation-delay: -0.32s; }
.ai-chatbot-message.typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.ai-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
}

.ai-chatbot-suggestion {
    padding: var(--space-2) var(--space-3);
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.2s;
}

.ai-chatbot-suggestion:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
}

.ai-chatbot-input-area {
    padding: var(--space-4);
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: var(--space-3);
}

.ai-chatbot-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    background: var(--bg-light);
    transition: all 0.3s;
}

.ai-chatbot-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-white);
}

.ai-chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: var(--text-white);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chatbot-send:hover {
    background: var(--accent);
    color: var(--primary);
    transform: scale(1.1);
}

/* ========================================
   2. SMART SEARCH AI
   ======================================== */
.smart-search-container {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.smart-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    transition: box-shadow 0.3s;
}

.smart-search-input-wrapper:focus-within {
    box-shadow: var(--shadow-xl), 0 0 0 4px rgba(201, 162, 39, 0.1);
}

.smart-search-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.25rem;
}

.smart-search-input {
    flex: 1;
    border: none;
    background: none;
    padding: var(--space-3);
    font-size: 1.125rem;
    color: var(--text-dark);
}

.smart-search-input:focus {
    outline: none;
}

.smart-search-input::placeholder {
    color: var(--text-light);
}

.smart-search-ai-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--accent);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smart-search-ai-badge i {
    animation: aiSparkle 2s infinite;
}

@keyframes aiSparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.smart-search-suggestions {
    position: absolute;
    top: calc(100% + var(--space-3));
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 100;
}

.smart-search-suggestions.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.smart-search-category {
    padding: var(--space-3) var(--space-5);
    background: var(--bg-light);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.smart-search-suggestion {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-light);
}

.smart-search-suggestion:last-child {
    border-bottom: none;
}

.smart-search-suggestion:hover,
.smart-search-suggestion.selected {
    background: var(--bg-light);
}

.smart-search-suggestion-image {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.smart-search-suggestion-content {
    flex: 1;
}

.smart-search-suggestion-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

.smart-search-suggestion-description {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.smart-search-suggestion-relevance {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

/* ========================================
   3. PREDICTIVE CARDS
   ======================================== */
.predictive-card {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s var(--ease-out);
}

.predictive-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.predictive-card-badge {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    padding: var(--space-1) var(--space-3);
    background: var(--accent);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

.predictive-card-badge.ai-recommended {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: white;
}

.predictive-card-badge.trending {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
}

.predictive-match-score {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.predictive-match-score-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.predictive-match-score-label {
    font-size: 0.625rem;
    color: var(--text-light);
    text-transform: uppercase;
}

/* ========================================
   4. DYNAMIC PRICING DISPLAY
   ======================================== */
.dynamic-pricing {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    animation: pricePulse 2s infinite;
}

@keyframes pricePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
}

.dynamic-pricing.urgent {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    animation: urgentPulse 1s infinite;
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

/* ========================================
   5. HEATMAP INDICATOR (Admin)
   ======================================== */
.heatmap-indicator {
    position: relative;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
}

.heatmap-indicator.hot {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.heatmap-indicator.warm {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.heatmap-indicator.cold {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

/* ========================================
   6. SCROLL DEPTH TRACKER
   ======================================== */
.scroll-depth-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--accent-gradient);
    z-index: 10001;
    transition: width 0.1s linear;
}

.scroll-depth-markers {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 10000;
}

.scroll-depth-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   7. ENGAGEMENT RING
   ======================================== */
.engagement-ring {
    position: fixed;
    bottom: 180px;
    right: var(--space-6);
    width: 60px;
    height: 60px;
    z-index: 9995;
}

.engagement-ring-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--accent);
    animation: engagementPulse 2s infinite;
}

@keyframes engagementPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.engagement-ring-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
    font-size: 1.25rem;
    cursor: pointer;
}

/* ========================================
   8. SMART NOTIFICATIONS
   ======================================== */
.smart-notification {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    max-width: 400px;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-5);
    z-index: 10000;
    transform: translateX(150%);
    transition: transform 0.5s var(--ease-spring);
}

.smart-notification.active {
    transform: translateX(0);
}

.smart-notification.ai-insight {
    border-left: 4px solid #8b5cf6;
}

.smart-notification-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--primary);
}

.smart-notification-title i {
    color: #8b5cf6;
}

.smart-notification-text {
    font-size: 0.9375rem;
    color: var(--text-medium);
    margin-bottom: var(--space-3);
}

.smart-notification-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--accent);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.smart-notification-action:hover {
    transform: translateX(5px);
}
