/* ============================================
   INTERACTIVE ELEMENTS - AI CHAT & SMART FILTERS
   ============================================ */

:root {
    --chat-primary: #D4AF37;
    --chat-bg: #1a1a1a;
    --chat-header: #0a0a0a;
    --message-user: #D4AF37;
    --message-ai: #2a2a2a;
}

/* ============================================
   AI CHAT INTERFACE
   ============================================ */

/* Chat Button */
.ai-chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #D4AF37 0%, #E5C158 50%, #F5D06C 100%);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.5), 0 0 0 0 rgba(212, 175, 55, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(212, 175, 55, 0.5), 0 0 0 0 rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(212, 175, 55, 0.6), 0 0 0 10px rgba(212, 175, 55, 0);
    }
}

.ai-chat-button:hover {
    transform: scale(1.15);
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.7);
    animation: none;
}

.ai-chat-button.active {
    transform: scale(0.9);
}

.chat-icon {
    color: #0a0a0a;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
.ai-chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 420px;
    height: 650px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98), rgba(15, 15, 15, 0.98));
    backdrop-filter: blur(20px);
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.1);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    overflow: hidden;
}

.ai-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(229, 193, 88, 0.1));
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    backdrop-filter: blur(10px);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #D4AF37 0%, #E5C158 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar svg {
    color: #0a0a0a;
}

.chat-header-text h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.chat-status {
    color: #44ff44;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #44ff44;
    border-radius: 50%;
    display: inline-block;
}

.chat-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.chat-close:hover {
    color: var(--text-primary);
}

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

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.chat-message {
    display: flex;
    animation: messageSlideIn 0.3s ease;
}

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

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

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

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
}

.user-message .message-content {
    background: var(--message-user);
    color: #0a0a0a;
    border-bottom-right-radius: 4px;
}

.ai-message .message-content {
    background: var(--message-ai);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

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

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--gold-primary);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Quick Replies */
.chat-quick-replies {
    padding: 0 20px 12px;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-reply-btn {
    padding: 8px 16px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold-primary);
    border-radius: 20px;
    color: var(--gold-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-reply-btn:hover {
    background: var(--gold-primary);
    color: #0a0a0a;
    transform: translateY(-2px);
}

/* Chat Input */
.chat-input-container {
    padding: 20px;
    background: var(--chat-header);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 24px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: rgba(255, 255, 255, 0.08);
}

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

.chat-send {
    width: 44px;
    height: 44px;
    background: var(--gold-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.chat-send svg {
    color: #0a0a0a;
}

/* ============================================
   SMART FILTERING SYSTEM
   ============================================ */

.smart-filter-panel {
    background: var(--card-bg);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

/* Filter Header */
.filter-panel-header {
    padding: var(--spacing-lg);
    background: rgba(212, 175, 55, 0.05);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-panel-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-panel-header svg {
    color: var(--gold-primary);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.filter-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.filter-reset {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--gold-primary);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-reset:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold-primary);
}

/* Filter Categories */
.filter-categories {
    padding: var(--spacing-md);
}

.filter-category {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-category:last-child {
    border-bottom: none;
}

.filter-category-header {
    width: 100%;
    background: transparent;
    border: none;
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-category-header:hover {
    background: rgba(212, 175, 55, 0.05);
}

.category-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.category-badge {
    background: var(--gold-primary);
    color: #0a0a0a;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    display: none;
}

.category-arrow {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.filter-category.active .category-arrow {
    transform: rotate(180deg);
}

/* Filter Content */
.filter-category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-category.active .filter-category-content {
    max-height: 600px;
    padding: var(--spacing-md);
}

.filter-option {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.filter-option:hover {
    background: rgba(212, 175, 55, 0.05);
}

.filter-checkbox {
    width: 18px;
    height: 18px;
    margin-right: var(--spacing-sm);
    cursor: pointer;
    accent-color: var(--gold-primary);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-primary);
    font-size: 0.9rem;
    flex: 1;
}

.filter-icon {
    font-size: 1.2rem;
}

/* Price Options */
.price-option .filter-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.price-label {
    font-weight: 600;
    color: var(--gold-primary);
}

.price-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Filter Footer */
.filter-panel-footer {
    padding: var(--spacing-lg);
    background: rgba(212, 175, 55, 0.05);
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.btn-apply-filters {
    width: 100%;
    padding: 14px;
    background: var(--gold-primary);
    border: none;
    border-radius: 8px;
    color: #0a0a0a;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-apply-filters:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    /* Chat Window */
    .ai-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        right: 20px;
        bottom: 90px;
    }

    .ai-chat-button {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    /* Filter Panel */
    .smart-filter-panel {
        border-radius: 12px;
    }

    .filter-panel-header {
        padding: var(--spacing-md);
    }

    .filter-panel-header h3 {
        font-size: 1rem;
    }

    .filter-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: var(--spacing-xs);
    }

    .filter-category-header {
        padding: var(--spacing-sm);
    }

    .category-title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .ai-chat-window {
        width: 100vw;
        height: 100vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    .message-content {
        max-width: 85%;
    }
}