/**
 * AI Search Page Styles
 */

.ai-search-page-container {
    max-width: 800px;
    margin: 120px auto 40px;
    /* Increased top margin for fixed header */
    padding: 0 20px;
    min-height: 500px;
    position: relative;
    z-index: 5;
}

.ai-search-page-header {
    text-align: center;
    margin-bottom: 50px;
}

.ai-search-page-input {
    width: 100%;
    /* Default LTR */
    padding: 15px 100px 15px 60px;
    border-radius: 50px;
    /* Pill shape for input */
    font-size: 16px;
    font-family: inherit;
    /* Ensure font matches theme */
    background: #f3f4f6;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

/* RTL Support */
body.rtl .ai-search-page-input {
    /* RTL: Button is Left. Avatar is Right. */
    /* Padding: Top Right Bottom Left */
    padding: 15px 60px 15px 100px;
    /* Right: 60px for Avatar space. Left: 100px for Button space. */
}

.ai-search-page-input:focus {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-color: #e5e7eb;
    outline: none;
}

.ai-search-page-form__wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* Search Bar Avatar */
.ai-search-page-avatar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
}

.ai-search-page-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-search-page-avatar svg {
    width: 20px;
    height: 20px;
    fill: #9ca3af;
}

/* RTL: Avatar on Right */
body.rtl .ai-search-page-avatar {
    right: 15px;
    left: auto;
}

/* LTR: Avatar on Left */
body:not(.rtl) .ai-search-page-avatar {
    left: 15px;
    right: auto;
}


.ai-search-page-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #0077B5, #00A0DC) !important;
    color: #fff !important;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 119, 181, 0.2);
    /* Icons space handled by gap */
    gap: 8px;
}

/* RTL Button Position (Left) */
body.rtl .ai-search-page-btn {
    left: 6px;
    right: auto;
}

/* LTR Button Position (Right) */
body:not(.rtl) .ai-search-page-btn {
    right: 6px;
    left: auto;
}

.ai-search-page-btn:hover {
    background: linear-gradient(135deg, #005f8f, #0088c2) !important;
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 119, 181, 0.3);
}

.ai-search-page-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Feed Items */
.ai-search-feed-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.ai-search-feed-item__header {
    margin-bottom: 15px;
}

.ai-search-feed-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-search-user__avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.ai-search-feed-meta {
    display: flex;
    flex-direction: column;
}

.ai-search-user-name {
    font-weight: 600;
    color: #111827;
}

.ai-search-date {
    font-size: 12px;
    color: #9ca3af;
}

.ai-search-feed-query {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f3f4f6;
}

/* Reuse response styles from popup but scoped if needed */
.ai-search-response__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* AI Response Logo Glow */
.ai-search-response__logo {
    width: 40px;
    /* Matched to user avatar size */
    height: 40px;
    border-radius: 50%;
    /* Circular */
    overflow: hidden;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Strong Blue Glow Effect */
    box-shadow: 0 0 20px rgba(0, 119, 181, 0.4), inset 0 0 0 1px rgba(0, 119, 181, 0.2);
    transition: box-shadow 0.3s ease;
    border: 2px solid #fff;
    /* Inner border */
}

.ai-search-response__logo:hover {
    box-shadow: 0 0 30px rgba(0, 119, 181, 0.6), inset 0 0 0 1px rgba(0, 119, 181, 0.4);
}

.ai-search-response__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ai-search-response__name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.ai-search-response__text {
    color: #374151;
    line-height: 1.7;
    font-size: 15px;
    white-space: pre-wrap;
}

/* Load More */
.ai-search-load-more-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 50px;
}

.ai-search-load-more-btn {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-search-load-more-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Loading Animation REUSE */
.ai-search-loading__dot {
    width: 8px;
    height: 8px;
    background: #d1d5db;
    border-radius: 50%;
    display: inline-block;
    animation: aiSearchBounce 1.4s infinite ease-in-out both;
}

.ai-search-loading__dot:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-search-loading__dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes aiSearchBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.ai-search-feed-loading {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 20px;
}