
/**
 * Search Bot CSS - Conversational AI Design
 */

/* Floating Button */
#search-bot-prompt {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 20;
}

#search-bot-open {
    background: linear-gradient(135deg, #A21418 0%, #7a0f12 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(162, 20, 24, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

#search-bot-open:before {
    content: "🔍";
    font-size: 20px;
}

#search-bot-open:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(162, 20, 24, 0.5);
    background: linear-gradient(135deg, #c51a1f 0%, #A21418 100%);
}

#search-bot-open:active {
    transform: translateY(-1px);
}

/* Chat Container */
#search-bot-chat {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 420px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Chat Header */
#search-bot-chat::before {
    content: "";
    display: block;
    height: 80px;
    background: linear-gradient(135deg, #A21418 0%, #7a0f12 100%);
    padding: 20px;
    position: relative;
}

/* Close Button */
#search-bot-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

#search-bot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

#search-bot-close::after {
    content: "×";
}

/* Clear Button */
#search-bot-clear {
    position: absolute;
    top: 20px;
    right: 65px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

#search-bot-clear:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Chat Title */
#search-bot-chat::after {
    content: "Search Assistant";
    position: absolute;
    top: 25px;
    left: 25px;
    color: white;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Messages Container */
#search-bot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
#search-bot-messages::-webkit-scrollbar {
    width: 6px;
}

#search-bot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#search-bot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

#search-bot-messages::-webkit-scrollbar-thumb:hover {
    background: #A21418;
}

/* Message Bubbles */
#search-bot-messages div {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: messageIn 0.3s ease;
}

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

.user-message {
    background: linear-gradient(135deg, #A21418 0%, #7a0f12 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(162, 20, 24, 0.3);
    margin-left: auto;
}

.bot-message {
    background: white;
    color: #2d3748;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-right: auto;
}

/* Links in messages */
#search-bot-messages a {
    color: #A21418;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 16px;
    display: block;
    background: #fff5f5;
    border-radius: 12px;
    margin: 8px 0;
    transition: all 0.2s ease;
    border-left: 3px solid #A21418;
}

#search-bot-messages a:hover {
    background: #fee;
    transform: translateX(4px);
    border-left-color: #7a0f12;
    box-shadow: 0 2px 8px rgba(162, 20, 24, 0.15);
}

#search-bot-messages a small {
    display: block;
    color: #718096;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 400;
}

/* AI Response Styling */
.ai-response {
    margin-bottom: 12px;
    line-height: 1.6;
}

.search-results-intro {
    font-weight: 600;
    color: #4a5568;
    margin: 16px 0 8px 0;
    font-size: 14px;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

/* Result Links - Enhanced Design */
.result-link {
    color: #A21418;
    text-decoration: none;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fff5f5;
    border-radius: 12px;
    transition: all 0.2s ease;
    border-left: 3px solid #A21418;
}

.result-link:hover {
    background: #fee;
    transform: translateX(4px);
    border-left-width: 4px;
    box-shadow: 0 2px 8px rgba(162, 20, 24, 0.15);
}

.result-title {
    font-weight: 600;
    font-size: 15px;
    color: #A21418;
}

.result-type {
    font-size: 12px;
    color: #718096;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Container */
#search-bot-chat > div:last-child {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 20px;
}

#search-bot-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    box-sizing: border-box;
    font-size: 15px;
    transition: all 0.2s ease;
    outline: none;
}

#search-bot-input:focus {
    border-color: #A21418;
    box-shadow: 0 0 0 3px rgba(162, 20, 24, 0.1);
}

#search-bot-input::placeholder {
    color: #a0aec0;
}

/* Loading indicator */
.bot-message.loading {
    background: white;
    color: #718096;
    font-style: italic;
}

.bot-message.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: ".";
    }
    40% {
        content: "..";
    }
    60%, 100% {
        content: "...";
    }
}

/* Welcome Message */
#search-bot-messages:empty::before {
    content: "👋 Hi! I can help you find information about fly fishing destinations, guides, gear, and more. Just type your question below.";
    display: block;
    padding: 20px;
    background: white;
    border-radius: 18px;
    color: #4a5568;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 3px solid #A21418;
}

/* Shortcode button styling */
.search-bot-open-shortcode {
    background: linear-gradient(135deg, #A21418 0%, #7a0f12 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(162, 20, 24, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.search-bot-open-shortcode:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(162, 20, 24, 0.4);
    background: linear-gradient(135deg, #c51a1f 0%, #A21418 100%);
}

.search-bot-open-shortcode:before {
    content: "💬";
}

/* Mobile Responsive */
@media (max-width: 600px) {
    #search-bot-chat {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }

    #search-bot-prompt {
        right: 20px;
        bottom: 20px;
    }

    #search-bot-open {
        padding: 14px 24px;
        font-size: 15px;
    }

    #search-bot-messages {
        padding: 20px 15px;
    }

    #search-bot-clear {
        right: 55px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    #search-bot-close {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    #search-bot-open {
        padding: 12px 20px;
        font-size: 14px;
    }

    #search-bot-open:before {
        font-size: 18px;
    }

    #search-bot-chat::after {
        font-size: 18px;
        left: 15px;
    }
}

/* Tablet adjustments */
@media (min-width: 601px) and (max-width: 768px) {
    #search-bot-chat {
        width: 380px;
        height: 550px;
    }
}