/* public/chatbot.css - REFINED VERSION */
/* SoulTungsten AI Chatbot Styles - Mobile Optimized */

.tungsten-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', sans-serif;
}

/* Chat Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 1px solid rgba(208, 208, 208, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.chatbot-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 215, 0, 0.3);
}

.chatbot-button::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.chatbot-button:hover::before {
    opacity: 1;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.chat-icon {
    width: 28px;
    height: 28px;
    color: #f0f0f0;
    transition: transform 0.3s;
}

.chatbot-button.active .chat-icon {
    transform: rotate(90deg);
}

/* Pulse Indicator */
.chatbot-pulse {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 12px;
    height: 12px;
    background: #ffd700;
    border-radius: 50%;
    display: none;
}

.chatbot-button.pulse-active .chatbot-pulse {
    display: block;
    animation: pulse 2s infinite;
}

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

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(208, 208, 208, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header - Smaller on mobile */
.chatbot-header {
    padding: 16px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-bottom: 1px solid rgba(208, 208, 208, 0.1);
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #666666, #ffd700);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: #0a0a0a;
}

.chatbot-header-text h3 {
    font-size: 15px;
    font-weight: 600;
    color: #f0f0f0;
    margin: 0 0 2px 0;
}

.chatbot-status {
    font-size: 11px;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.status-dot {
    width: 5px;
    height: 5px;
    background: #00ff00;
    border-radius: 50%;
    animation: blink 2s infinite;
}

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

.chatbot-close {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
}

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

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(208, 208, 208, 0.2);
    border-radius: 2px;
}

/* Messages */
.message {
    display: flex;
    gap: 8px;
    animation: fadeIn 0.3s ease-out;
}

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

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

.message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.bot .message-content {
    background: #2a2a2a;
    color: #f0f0f0;
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(208, 208, 208, 0.1));
    color: #f0f0f0;
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 3px;
    padding: 10px 14px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #999;
    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% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Quick Actions - Only 2 visible */
.chatbot-quick-actions {
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chatbot-quick-actions::-webkit-scrollbar {
    display: none;
}

.quick-action {
    padding: 6px 12px;
    background: #2a2a2a;
    border: 1px solid rgba(208, 208, 208, 0.2);
    border-radius: 16px;
    color: #999;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    flex-shrink: 0;
}

.quick-action:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    color: #f0f0f0;
}

/* Chat Input */
.chatbot-input-container {
    padding: 16px;
    border-top: 1px solid rgba(208, 208, 208, 0.1);
    background: rgba(42, 42, 42, 0.5);
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid rgba(208, 208, 208, 0.2);
    border-radius: 20px;
    padding: 10px 16px;
    color: #f0f0f0;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

.chatbot-input::placeholder {
    color: #999;
    font-size: 13px;
}

.chatbot-send {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(208, 208, 208, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    color: #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-send:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(208, 208, 208, 0.3));
    transform: scale(1.05);
}

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

/* Product Recommendations - Simplified */
.product-recommendations {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.product-rec-card {
    background: rgba(42, 42, 42, 0.5);
    border: 1px solid rgba(208, 208, 208, 0.2);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.product-rec-card:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: rgba(255, 215, 0, 0.3);
}

.product-rec-name {
    font-size: 13px;
    font-weight: 500;
    color: #f0f0f0;
    flex: 1;
}

.product-rec-price {
    font-size: 15px;
    font-weight: 600;
    color: #ffd700;
}

.product-rec-add {
    padding: 5px 10px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(208, 208, 208, 0.2));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    color: #f0f0f0;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.product-rec-add:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(208, 208, 208, 0.3));
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        bottom: 70px;
        border-radius: 16px;
    }
    
    .chatbot-button {
        width: 56px;
        height: 56px;
        right: 16px;
        bottom: 16px;
    }
    
    .chatbot-header {
        padding: 14px;
    }
    
    .chatbot-messages {
        padding: 12px;
        gap: 10px;
    }
    
    .chatbot-input-container {
        padding: 12px;
    }
    
    .message-content {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* Smaller product cards on mobile */
    .product-rec-card {
        padding: 8px 10px;
    }
    
    .product-rec-name {
        font-size: 12px;
    }
    
    .product-rec-price {
        font-size: 14px;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .chatbot-window {
        height: calc(100vh - 120px - env(safe-area-inset-bottom));
    }
}

/* Dark mode override for consistency */
@media (prefers-color-scheme: light) {
    /* Keep dark theme regardless of system preference */
    .chatbot-window {
        background: rgba(26, 26, 26, 0.98);
    }
}