/* ============================================================================
   CHATBOT PANEL - Glassmorphism Design
   Extends unified-panel-design.css with ChatBot styling
   Bottom Middle-Left Position (Side-by-side with Camera Nav)
   ============================================================================ */

#chatBotPanelContainer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(calc(-100% - 10px));  /* Position to left of center */
    width: 400px;
    max-width: 40vw;
    background: var(--glass-bg-primary);
    border: 2px solid rgba(233, 30, 99, 0.3);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow), 0 0 40px var(--chatbot-glow);
    font-family: var(--font-body);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    z-index: 2000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* ChatBot-specific custom properties */
    --panel-primary: var(--chatbot-primary);
    --panel-secondary: var(--chatbot-secondary);
    --panel-glow: var(--chatbot-glow);
}

/* When expanded, make it wider */
#chatBotPanelContainer:has(.panel-content[style*="display: block"]) {
    width: 500px;
    max-width: 40vw;
}

#chatBotPanelContainer:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6),
                0 0 60px var(--chatbot-glow);
    border-color: rgba(233, 30, 99, 0.5);
    transform: translateX(calc(-100% - 10px)) translateY(-2px);
}

/* Panel Header - Glassmorphism with shimmer effect */
#chatBotPanelContainer .panel-header {
    background: linear-gradient(135deg,
        rgba(233, 30, 99, 0.25),
        rgba(194, 24, 91, 0.15));
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#chatBotPanelContainer .panel-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(233, 30, 99, 0.2),
        transparent);
    transition: left 0.5s ease;
}

#chatBotPanelContainer .panel-header:hover::before {
    left: 100%;
}

/* When content is visible, adjust header border radius */
#chatBotPanelContainer .panel-header:has(+ .panel-content[style*="display: block"]) {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 2px solid rgba(233, 30, 99, 0.3);
}

#chatBotPanelContainer .panel-header:hover {
    background: linear-gradient(135deg,
        rgba(233, 30, 99, 0.35),
        rgba(194, 24, 91, 0.25));
}

#chatBotPanelContainer .panel-header h3 {
    margin: 0;
    background: linear-gradient(135deg, #E91E63, #F06292);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--font-title);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px var(--chatbot-glow);
}

/* Panel Content Area */
#chatBotPanelContainer .panel-content {
    background: rgba(10, 10, 10, 0.95);
    border-radius: 0 0 13px 13px;
    overflow: hidden;
}

/* When panel content is hidden, it takes no space */
#chatBotPanelContainer .panel-content[style*="display: none"] {
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* Chat Messages Area */
#chatMessages {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#chatMessages::-webkit-scrollbar {
    width: 8px;
}

#chatMessages::-webkit-scrollbar-track {
    background: rgba(0, 200, 255, 0.1);
    border-radius: 4px;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00c8ff, #0096ff);
    border-radius: 4px;
}

/* Message Bubbles */
.chat-message {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    animation: fadeInMessage 0.3s ease;
}

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

.user-message {
    background: linear-gradient(135deg, rgba(0, 200, 255, 0.3), rgba(0, 150, 255, 0.2));
    border: 1px solid rgba(0, 200, 255, 0.4);
    align-self: flex-end;
    color: #e0e0e0;
}

.bot-message {
    background: linear-gradient(135deg, rgba(100, 100, 100, 0.3), rgba(80, 80, 80, 0.2));
    border: 1px solid rgba(150, 150, 150, 0.3);
    align-self: flex-start;
    color: #e0e0e0;
}

.bot-message strong {
    color: #00c8ff;
    font-weight: 700;
}

.bot-message .context-badge {
    display: inline-block;
    background: rgba(0, 200, 255, 0.2);
    border: 1px solid rgba(0, 200, 255, 0.4);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
    color: #00c8ff;
}

/* Action Buttons Container */
.chat-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* Location Highlight Button */
.highlight-locations-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #00c8ff, #0096ff);
    border: 2px solid transparent;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.highlight-locations-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #00e0ff, #00a0ff);
    box-shadow: 0 4px 12px rgba(0, 200, 255, 0.4);
    transform: translateY(-2px) scale(1.03);
}

.highlight-locations-btn:disabled {
    cursor: not-allowed;
    transform: none;
}

/* Highlighted state - glowing effect like Location Status panel */
.highlight-locations-btn.status-active {
    background: linear-gradient(135deg, #4CAF50, #66BB6A) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 15px #4CAF50, 0 4px 12px rgba(76, 175, 80, 0.6) !important;
    opacity: 1 !important;
    font-weight: 700;
    animation: pulseGlow 2s ease-in-out infinite;
    transform: translateY(-2px) scale(1.03);
}

/* Clear Locations Button */
.clear-locations-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.8), rgba(220, 50, 50, 0.8));
    border: 2px solid transparent;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 0 0 auto;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.clear-locations-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255, 100, 100, 0.9), rgba(240, 70, 70, 0.9));
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
    transform: translateY(-2px) scale(1.03);
}

.clear-locations-btn:disabled {
    cursor: not-allowed;
    transform: none;
}

/* Cleared state - glowing effect like Location Status panel */
.clear-locations-btn.status-active {
    background: linear-gradient(135deg, #4CAF50, #66BB6A) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 15px #4CAF50, 0 4px 12px rgba(76, 175, 80, 0.6) !important;
    opacity: 1 !important;
    font-weight: 700;
    animation: pulseGlow 2s ease-in-out infinite;
    transform: translateY(-2px) scale(1.03);
}

/* Input Area */
#chatInputArea {
    padding: 12px 15px;
    border-top: 1px solid rgba(0, 200, 255, 0.2);
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    padding: 10px 14px;
    background: rgba(40, 40, 40, 0.9);
    border: 2px solid rgba(0, 200, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    min-height: 48px;
    max-height: 100px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
}

#chatInput:focus {
    outline: none;
    border-color: #00c8ff;
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.3);
}

#chatInput::placeholder {
    color: rgba(200, 200, 200, 0.5);
}

#sendChatButton {
    padding: 8px 12px;
    background: linear-gradient(135deg, #00c8ff, #0096ff);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 50px;
    flex-shrink: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendChatButton:hover {
    background: linear-gradient(135deg, #00e0ff, #00a0ff);
    box-shadow: 0 4px 12px rgba(0, 200, 255, 0.4);
    transform: translateY(-2px);
}

#sendChatButton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Indicator */
.loading-dots {
    display: inline-block;
    padding: 10px;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00c8ff;
    margin: 0 3px;
    animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

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

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

/* Header Controls */
.panel-header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.toggle-icon {
    font-size: 14px;
    color: #00c8ff;
    transition: transform 0.3s ease;
}

.close-icon {
    font-size: 16px;
    color: rgba(0, 200, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-icon:hover {
    color: #00c8ff;
    transform: rotate(90deg);
}

/* Suggestions */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 15px;
    border-top: 1px solid rgba(0, 200, 255, 0.2);
}

.suggestion-chip {
    padding: 6px 12px;
    background: rgba(0, 200, 255, 0.2);
    border: 1px solid rgba(0, 200, 255, 0.3);
    border-radius: 15px;
    color: #00c8ff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-chip:hover {
    background: rgba(0, 200, 255, 0.3);
    border-color: rgba(0, 200, 255, 0.5);
    transform: translateY(-1px);
}

/* Pulsing glow animation for highlighted/cleared states */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px #4CAF50, 0 4px 12px rgba(76, 175, 80, 0.6);
    }
    50% {
        box-shadow: 0 0 25px #4CAF50, 0 4px 16px rgba(76, 175, 80, 0.8);
    }
}
