/**
 * DefenceSource AI Premium Search Styles
 * Professional B2B search result cards with rich data display
 */

/* ========================================
   SEARCH CONTAINER
   ======================================== */

.ds-ai-search-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ds-ai-search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

#ds-ai-search-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#ds-ai-search-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

#ds-ai-search-submit {
    padding: 16px 32px;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#ds-ai-search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 54, 93, 0.25);
}

#ds-ai-search-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   AI ANSWER SECTION
   ======================================== */

#ds-ai-answer {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 28px;
}

#ds-ai-answer-text {
    font-size: 15px;
    line-height: 1.7;
    color: #2d3748;
    margin-bottom: 16px;
}

#ds-ai-answer-text strong {
    font-weight: 700;
    color: #1a365d;
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    padding: 1px 6px;
    border-radius: 4px;
}

#ds-ai-answer-text em {
    font-style: italic;
    color: #4a5568;
}

.ds-ai-response-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.ds-ai-response-time {
    font-size: 12px;
    color: #718096;
}

.ds-ai-feedback-btns {
    display: flex;
    gap: 8px;
}

.ds-ai-feedback-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ds-ai-feedback-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* ========================================
   RESULTS GRID
   ======================================== */

#ds-ai-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* ========================================
   RICH RESULT CARD
   ======================================== */

.ds-ai-result-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
}

.ds-ai-result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #e2e8f0;
}

/* Card Image */
.ds-ai-card-image-wrap {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.ds-ai-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ds-ai-result-card:hover .ds-ai-card-image {
    transform: scale(1.05);
}

/* Type Badge (top left) */
.ds-ai-card-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ds-ai-card-type-badge.suppliers {
    background: #1a365d;
    color: #fff;
}

.ds-ai-card-type-badge.products {
    background: #2f855a;
    color: #fff;
}

.ds-ai-card-type-badge.articles {
    background: #744210;
    color: #fff;
}

.ds-ai-card-type-badge.events {
    background: #c53030;
    color: #fff;
}

/* Score Badge (top right) */
.ds-ai-card-score {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #2d3748;
    backdrop-filter: blur(4px);
}

/* Supplier Logo Overlay */
.ds-ai-card-logo {
    position: absolute;
    bottom: -24px;
    left: 16px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #fff;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.ds-ai-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* Card Content */
.ds-ai-card-content {
    padding: 20px;
    padding-top: 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ds-ai-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ds-ai-card-excerpt {
    font-size: 14px;
    color: #64748b;
    line-height: 1.55;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Supplier Mini Info (for products) */
.ds-ai-card-supplier-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #718096;
    margin-bottom: 12px;
}

.ds-ai-card-supplier-link img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

/* Badges Row */
.ds-ai-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.ds-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.ds-ai-badge-verified {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.ds-ai-badge-global {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.ds-ai-badge-rich-profile {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.ds-ai-badge-major-supplier {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.ds-ai-badge-has-datasheet {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

.ds-ai-badge-upcoming {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

/* Stats Row */
.ds-ai-card-stats {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
}

.ds-ai-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #64748b;
}

.ds-ai-stat-icon {
    font-size: 14px;
}

/* Location/Country Info */
.ds-ai-card-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

/* ========================================
   LOAD MORE BUTTON
   ======================================== */

.ds-ai-load-more-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 32px auto 0;
    padding: 14px 28px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ds-ai-load-more-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

/* ========================================
   SUGGESTIONS
   ======================================== */

.ds-ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ds-ai-suggestion {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ds-ai-suggestion:hover {
    background: #3182ce;
    border-color: #3182ce;
    color: #fff;
}

/* ========================================
   LOADING STATE
   ======================================== */

.ds-ai-loading {
    display: none;
    /* Hidden by default, shown by JS when searching */
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #64748b;
}

.ds-ai-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #3182ce;
    border-radius: 50%;
    animation: ds-spin 0.8s linear infinite;
}

@keyframes ds-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
    .ds-ai-search-form {
        flex-direction: column;
    }

    #ds-ai-search-submit {
        width: 100%;
    }

    #ds-ai-results-grid {
        grid-template-columns: 1fr;
    }

    .ds-ai-card-content {
        padding: 16px;
        padding-top: 28px;
    }
}

/* ========================================
   FLOATING CHAT
   ======================================== */

#ds-ai-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(26, 54, 93, 0.3);
    z-index: 9999;
    transition: all 0.2s ease;
}

#ds-ai-float-btn:hover {
    transform: scale(1.08);
}

#ds-ai-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#ds-ai-chat-panel.active {
    display: flex;
}

.ds-ai-chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ds-ai-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#ds-ai-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}

#ds-ai-float-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 320px;
}

.ds-ai-chat-message {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
}

.ds-ai-chat-message.user {
    background: #3182ce;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ds-ai-chat-message.assistant {
    background: #f7fafc;
    color: #2d3748;
    border-bottom-left-radius: 4px;
}

.ds-ai-chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
}

#ds-ai-float-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

#ds-ai-float-send {
    padding: 10px 16px;
    background: #3182ce;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ========================================
   SMART STARTER BUTTONS
   ======================================== */

.ds-ai-starters {
    margin-bottom: 24px;
}

.ds-ai-starter-section {
    margin-bottom: 16px;
}

.ds-ai-starter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.ds-ai-starter-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    margin: 4px 8px 4px 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.ds-ai-starter-btn:hover {
    background: #f8fafc;
    border-color: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.15);
}

.ds-ai-starter-btn.personalized {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.ds-ai-starter-btn.personalized:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%);
}

.ds-ai-starter-btn.trending {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #ef4444;
}

.ds-ai-starter-btn small {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.ds-ai-trend-count {
    font-size: 10px;
    background: #ef4444;
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* ========================================
   DID YOU MEAN
   ======================================== */

.ds-ai-did-you-mean {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.ds-ai-did-you-mean p {
    margin: 0 0 8px;
    font-size: 14px;
    color: #92400e;
}

.ds-ai-did-you-mean-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ds-ai-did-you-mean-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ds-ai-did-you-mean-btn:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}

/* ========================================
   FILTER CHIPS
   ======================================== */

.ds-ai-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 10px;
}

.ds-ai-filter-chips-label {
    font-size: 12px;
    color: #64748b;
    margin-right: 8px;
    line-height: 28px;
}

.ds-ai-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ds-ai-filter-chip:hover {
    background: #3182ce;
    border-color: #3182ce;
    color: #fff;
}

.ds-ai-filter-chip.active {
    background: #1a365d;
    border-color: #1a365d;
    color: #fff;
}

/* ========================================
   REFACTORED WIDGET STYLES (PREMIUM)
   ======================================== */

:root {
    --ds-ai-primary: #3b82f6;
    --ds-ai-primary-dark: #2563eb;
    --ds-ai-secondary: #8b5cf6;
    --ds-ai-accent: #f59e0b;
    --ds-ai-surface: #1e293b;
    --ds-ai-surface-light: #334155;
    --ds-ai-border: rgba(148, 163, 184, 0.2);
    --ds-ai-text: #f1f5f9;
    --ds-ai-text-muted: #94a3b8;
    --ds-ai-glass: rgba(30, 41, 59, 0.7);
    --ds-ai-glass-border: rgba(255, 255, 255, 0.1);
}

/* Utilities */
.ds-ai-flex-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-ai-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ds-ai-glass-panel {
    background: var(--ds-ai-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--ds-ai-glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* AI Search Widget */
.ds-ai-search-header {
    margin-bottom: 16px;
}

.ds-ai-powered-badge {
    background: linear-gradient(135deg, var(--ds-ai-primary), var(--ds-ai-secondary));
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Chat Widget */
.ds-ai-chat-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--ds-ai-surface);
    /* Fallback */
}

.ds-ai-chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--ds-ai-border);
    background: rgba(0, 0, 0, 0.2);
}

.ds-ai-chat-title {
    font-weight: 600;
    color: var(--ds-ai-text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-ai-chat-clear-btn {
    background: transparent;
    border: 1px solid var(--ds-ai-surface-light);
    color: var(--ds-ai-text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.ds-ai-chat-clear-btn:hover {
    background: var(--ds-ai-surface-light);
    color: var(--ds-ai-text);
}

.ds-ai-chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar for Chat */
.ds-ai-chat-messages-area::-webkit-scrollbar {
    width: 6px;
}

.ds-ai-chat-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.ds-ai-chat-messages-area::-webkit-scrollbar-thumb {
    background: var(--ds-ai-surface-light);
    border-radius: 3px;
}

.ds-ai-chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--ds-ai-border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 12px;
}

.ds-ai-chat-input-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--ds-ai-surface-light);
    border-radius: 12px;
    font-size: 14px;
    background: var(--ds-ai-surface);
    color: var(--ds-ai-text);
    transition: all 0.2s ease;
}

.ds-ai-chat-input-field:focus {
    border-color: var(--ds-ai-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    outline: none;
}

/* Trending Widget */
.ds-ai-trending-container {
    padding: 24px;
}

.ds-ai-trending-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ds-ai-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ds-ai-trending-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ds-ai-trending-tag {
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: var(--ds-ai-surface-light);
    color: var(--ds-ai-text-muted);
    border: 1px solid transparent;
}

.ds-ai-trending-tag:hover {
    background-color: var(--ds-ai-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ds-ai-trending-count {
    opacity: 0.6;
    font-size: 11px;
    margin-left: 6px;
}

.ds-ai-trending-list {
    margin: 0;
    padding-left: 24px;
    color: var(--ds-ai-text-muted);
}

.ds-ai-trending-list-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--ds-ai-surface-light);
}

.ds-ai-trending-link {
    color: var(--ds-ai-text);
    text-decoration: none;
    transition: color 0.2s;
}

.ds-ai-trending-link:hover {
    color: var(--ds-ai-primary);
}

/* Summary Widget */
.ds-ai-summary-wrapper {
    padding: 24px;
    border: 1px solid var(--ds-ai-border);
    position: relative;
    overflow: hidden;
}

/* Add a subtle shine effect */
.ds-ai-summary-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.ds-ai-summary-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ds-ai-text);
}

.ds-ai-summary-badge {
    font-size: 10px;
    background: var(--ds-ai-primary);
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ds-ai-summary-text {
    margin: 0 0 20px 0;
    line-height: 1.7;
    font-size: 15px;
    color: var(--ds-ai-text-muted);
}

.ds-ai-key-points {
    border-top: 1px solid var(--ds-ai-border);
    padding-top: 20px;
    margin-top: 20px;
}

.ds-ai-key-points-label {
    font-size: 13px;
    color: var(--ds-ai-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    display: block;
    margin-bottom: 12px;
}

.ds-ai-key-points-list {
    margin: 0;
    padding-left: 20px;
}

.ds-ai-key-points-item {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--ds-ai-text-muted);
}

/* ========================================
   EMERGENCY FIXES FOR VISUAL REGRESSION
   ======================================== */

/* Fix: Specificity Boost & Elementor Overrides */
.ds-ai-search-container .ds-ai-powered-badge {
    display: inline-block !important;
    /* Ensure it renders */
    color: #ffffff !important;
}

/* Fix: Chat Header & Button */
.ds-ai-chat-header {
    background: rgba(0, 0, 0, 0.4) !important;
    /* Darker for visibility */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.ds-ai-chat-clear-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    width: auto !important;
    /* Prevent it from stretching */
}

/* Fix: Chat Input Area */
.ds-ai-chat-input-area {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: rgba(0, 0, 0, 0.4) !important;
}

.ds-ai-chat-input-field {
    background: rgba(30, 41, 59, 0.8) !important;
    /* Ensure dark background */
    color: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    width: 100% !important;
    /* Ensure full width */
}

/* Fix: Summary Title Visibility */
.ds-ai-summary-title {
    color: #f1f5f9 !important;
}

.ds-ai-summary-badge {
    color: #ffffff !important;
    background: #3b82f6 !important;
    margin-left: 8px !important;
    display: inline-block !important;
}

/* Fix: Trending Tags Visibility */
.ds-ai-trending-tag {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #cbd5e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.ds-ai-trending-tag:hover {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
}

/* Ensure Text Colors are Readable everywhere */
.ds-ai-text-muted,
.ds-ai-key-points-item,
.ds-ai-trending-list,
.ds-ai-summary-text {
    color: #cbd5e0 !important;
}


/* ========================================
   UI REFINEMENT FIXES (Latest)
   ======================================== */

/* 1. Default Visibility (Hide items until search) */
.ds-ai-loading,
.ds-ai-answer,
#ds-ai-results {
    display: none;
    /* Removed !important so JS can toggle visibility */
}

/* 2. Search Input Group Alignment */
.ds-ai-input-group {
    display: flex !important;
    gap: 12px !important;
    align-items: stretch !important;
    /* Ensure same height */
    width: 100% !important;
    margin-bottom: 20px !important;
}

#ds-ai-search-input {
    flex: 1 !important;
    padding: 16px 20px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(30, 41, 59, 0.6) !important;
    color: #fff !important;
    font-size: 15px !important;
    height: auto !important;
    /* Let padding define height */
}

#ds-ai-search-submit {
    height: auto !important;
    padding: 0 32px !important;
    /* Horizontal padding only, height matches input due to flex-stretch */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #3b82f6 !important;
    color: white !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
}

/* 3. Suggestions Styling */
.ds-ai-suggestions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    /* Better gap */
    margin-bottom: 24px !important;
}

.ds-ai-suggestion {
    padding: 8px 16px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    color: #cbd5e0 !important;
    font-size: 13px !important;
    transition: all 0.2s ease !important;
}

.ds-ai-suggestion:hover {
    background: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
    transform: translateY(-2px);
}

/* 4. AI Badge Alignment */
.ds-ai-search-header {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 16px !important;
}

/* 5. AI Answer Container Refinement */
.ds-ai-answer {
    /* Display is managed by JS toggling, but default is none via rule above */
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) !important;
    border-radius: 16px !important;
    padding: 24px !important;
    margin-top: 20px !important;
    color: #e2e8f0 !important;
}

/* Remove internal gradient/borders causing clashes */
.ds-ai-answer-header,
.ds-ai-feedback {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

#ds-ai-answer-text {
    color: #e2e8f0 !important;
}


/* ========================================
   CHAT UI OVERHAUL (PREMIUM DARK)
   ======================================== */

/* Main Chat Panel (Floating + Widget) */
.ds-ai-chat-panel,
.ds-ai-chat-container {
    background: #1e293b !important;
    /* Dark solid fallback */
    background: rgba(30, 41, 59, 0.95) !important;
    /* Glass effect */
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
    color: #f1f5f9 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

/* Header */
.ds-ai-chat-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 18px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.ds-ai-chat-header h4 {
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.ds-ai-chat-close {
    color: rgba(255, 255, 255, 0.6) !important;
    transition: all 0.2s !important;
}

.ds-ai-chat-close:hover {
    color: #fff !important;
    transform: rotate(90deg) !important;
}

/* Messages Area */
.ds-ai-chat-messages {
    background: transparent !important;
    padding: 20px !important;
}

/* Message Bubbles */
.ds-ai-chat-message {
    padding: 12px 16px !important;
    border-radius: 16px !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
    max-width: 85% !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* AI Message */
.ds-ai-chat-message.assistant {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-bottom-left-radius: 4px !important;
}

/* User Message */
.ds-ai-chat-message.user {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    margin-left: auto !important;
    border-bottom-right-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
}

/* Links in messages */
.ds-ai-chat-message a {
    color: #60a5fa !important;
    text-decoration: underline !important;
}

/* Input Area */
.ds-ai-chat-input,
.ds-ai-chat-input-wrap {
    padding: 16px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    gap: 10px !important;
    display: flex !important;
    align-items: center !important;
}

.ds-ai-chat-input input,
#ds-ai-float-input,
.ds-ai-chat-input-field {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    transition: all 0.2s !important;
}

.ds-ai-chat-input input:focus,
#ds-ai-float-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    outline: none !important;
}

/* Send Button */
.ds-ai-chat-input button,
#ds-ai-float-send {
    background: #3b82f6 !important;
    color: white !important;
    border-radius: 12px !important;
    padding: 0 20px !important;
    height: 44px !important;
    /* Match input height roughly */
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    transition: all 0.2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.ds-ai-chat-input button:hover,
#ds-ai-float-send:hover {
    background: #2563eb !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

/* Floating Action Button */
#ds-ai-float-btn {
    background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
    width: 64px !important;
    height: 64px !important;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
}

#ds-ai-float-btn:hover {
    transform: scale(1.1) rotate(5deg) !important;
}


/* ========================================
   BRAND ALIGNMENT UPDATE (RED/NAVY)
   ======================================== */

:root {
    /* Updates generic blue to Brand Red #ee212b and Navy #0b1a2e */
    --ds-ai-primary: #ee212b !important;
    /* Brand Red from theme */
    --ds-ai-primary-dark: #cc1f26 !important;
    /* Darker Red */
    --ds-ai-secondary: #0b1a2e !important;
    /* Brand Navy */
    --ds-ai-surface: #0b1a2e !important;
    /* Dark Navy Background */
    --ds-ai-accent: #ff4d4d !important;
    /* Red Accent */
}

/* Force specific overrides for gradients where variables might be mixed */
.ds-ai-powered-badge,
#ds-ai-search-submit,
#ds-ai-float-btn,
.ds-ai-chat-input button,
#ds-ai-float-send,
.ds-ai-chat-header {
    background: linear-gradient(135deg, #ee212b 0%, #c41e26 100%) !important;
}

/* Update Chat User Message Bubble to Red Gradient */
.ds-ai-chat-message.user {
    background: linear-gradient(135deg, #ee212b 0%, #d61c24 100%) !important;
    box-shadow: 0 4px 12px rgba(238, 33, 43, 0.25) !important;
}

/* Hover States for Red Elements */
#ds-ai-search-submit:hover,
.ds-ai-chat-input button:hover,
#ds-ai-float-send:hover {
    background: #cc1f26 !important;
    box-shadow: 0 6px 16px rgba(204, 31, 38, 0.3) !important;
}

/* Suggestion Pills Hover - Blue to Red */
.ds-ai-suggestion:hover {
    background: #ee212b !important;
    border-color: #ee212b !important;
}

/* Links */
.ds-ai-chat-message a {
    color: #ff9999 !important;
    /* Lighter red for links on dark */
}

/* Focus States */
#ds-ai-search-input:focus,
.ds-ai-chat-input input:focus,
#ds-ai-float-input:focus {
    border-color: #ee212b !important;
    box-shadow: 0 0 0 2px rgba(238, 33, 43, 0.2) !important;
}


/* ========================================
   REFINED BRAND ALIGNMENT (Red as ACCENT)
   ======================================== */

/* Revert Chat Header to Sleek Dark (NOT Red) */
.ds-ai-chat-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Chat Title - White, not Red */
.ds-ai-chat-header h4,
.ds-ai-chat-title {
    color: #ffffff !important;
}

/* User Message Bubble - Keep Red Accent BUT more subtle */
.ds-ai-chat-message.user {
    background: linear-gradient(135deg, #ee212b 0%, #cc1e26 100%) !important;
}

/* AI Message - Subtle dark bubble */
.ds-ai-chat-message.assistant {
    background: rgba(255, 255, 255, 0.04) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* Send Button - Keep subtle blue for better balance, or match search */
.ds-ai-chat-input button,
#ds-ai-float-send,
.ds-ai-chat-send-btn {
    background: #3b82f6 !important;
    /* Cleaner blue for send action */
    color: white !important;
}

.ds-ai-chat-input button:hover,
#ds-ai-float-send:hover,
.ds-ai-chat-send-btn:hover {
    background: #2563eb !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

/* Floating Button - Red Accent (this is OK for a pop of brand) */
#ds-ai-float-btn {
    background: linear-gradient(135deg, #ee212b 0%, #cc1e26 100%) !important;
    border: none !important;
    box-shadow: 0 8px 24px rgba(238, 33, 43, 0.35) !important;
}

/* Search Button - Red Accent (OK for main CTA) */
#ds-ai-search-submit {
    background: linear-gradient(135deg, #ee212b 0%, #cc1e26 100%) !important;
}

#ds-ai-search-submit:hover {
    background: #cc1e26 !important;
    box-shadow: 0 6px 16px rgba(204, 31, 38, 0.35) !important;
}

/* AI-Powered Badge - Red Accent (OK) */
.ds-ai-powered-badge {
    background: linear-gradient(135deg, #ee212b 0%, #cc1e26 100%) !important;
}

/* Clear Button in Chat - Subtle Dark */
.ds-ai-chat-clear,
.ds-ai-chat-clear-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
}

.ds-ai-chat-clear:hover,
.ds-ai-chat-clear-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

/* AI Assistant Title in Embedded Chat - White */
.ds-ai-chat-container .ds-ai-chat-header span,
.ds-ai-chat-container .ds-ai-chat-title {
    color: #fff !important;
}


/* ========================================
    PREMIUM VISUAL EFFECTS - IMPRESSIVE MODE
   ======================================== */

/* === ANIMATED GRADIENT BORDER FOR SEARCH BOX === */
.ds-ai-search-container {
    position: relative !important;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border: 2px solid transparent !important;
    border-radius: 20px !important;
    background-clip: padding-box !important;
    overflow: visible !important;
}

.ds-ai-search-container::before {
    content: '' !important;
    position: absolute !important;
    inset: -2px !important;
    border-radius: 22px !important;
    background: linear-gradient(135deg, #ee212b, #ff6b4a, #ee212b, #cc1e26) !important;
    background-size: 300% 300% !important;
    animation: gradient-border 4s ease infinite !important;
    opacity: 0.6 !important;
    z-index: -1 !important;
    transition: opacity 0.3s ease !important;
}

.ds-ai-search-container:hover::before {
    opacity: 1 !important;
}

@keyframes gradient-border {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* === GLOWING SEARCH INPUT === */
#ds-ai-search-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#ds-ai-search-input:focus {
    box-shadow:
        0 0 0 2px rgba(238, 33, 43, 0.3),
        0 0 20px rgba(238, 33, 43, 0.15),
        inset 0 0 20px rgba(238, 33, 43, 0.05) !important;
    border-color: rgba(238, 33, 43, 0.5) !important;
}

/* === PULSING AI-POWERED BADGE === */
.ds-ai-powered-badge {
    position: relative !important;
    overflow: hidden !important;
    animation: badge-pulse 2s ease-in-out infinite !important;
}

.ds-ai-powered-badge::after {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: linear-gradient(45deg,
            transparent 30%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 70%) !important;
    animation: shimmer 3s ease-in-out infinite !important;
}

@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(238, 33, 43, 0.4);
    }

    50% {
        box-shadow: 0 4px 25px rgba(238, 33, 43, 0.6), 0 0 40px rgba(238, 33, 43, 0.2);
    }
}

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

    100% {
        transform: translateX(100%) rotate(25deg);
    }
}

/* === INTERACTIVE SUGGESTION PILLS === */
.ds-ai-suggestion {
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform: translateY(0) !important;
}

.ds-ai-suggestion::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(135deg, rgba(238, 33, 43, 0.1) 0%, rgba(255, 107, 74, 0.05) 100%) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.ds-ai-suggestion:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(238, 33, 43, 0.25) !important;
    border-color: rgba(238, 33, 43, 0.5) !important;
}

.ds-ai-suggestion:hover::before {
    opacity: 1 !important;
}

/* === GLOWING SEARCH BUTTON === */
#ds-ai-search-submit {
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#ds-ai-search-submit::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent) !important;
    transition: left 0.5s ease !important;
}

#ds-ai-search-submit:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 8px 30px rgba(238, 33, 43, 0.5) !important;
}

#ds-ai-search-submit:hover::before {
    left: 100% !important;
}

/* === FLOATING PARTICLES EFFECT (Subtle) === */
.ds-ai-search-container::after {
    content: '' !important;
    position: absolute !important;
    top: 10% !important;
    right: 5% !important;
    width: 150px !important;
    height: 150px !important;
    background: radial-gradient(circle, rgba(238, 33, 43, 0.08) 0%, transparent 70%) !important;
    border-radius: 50% !important;
    animation: float-particle 6s ease-in-out infinite !important;
    pointer-events: none !important;
}

@keyframes float-particle {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-20px, 10px) scale(1.1);
        opacity: 0.8;
    }
}

/* === PREMIUM GLASS EFFECT FOR INPUTS === */
#ds-ai-search-input,
.ds-ai-chat-input input {
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* === STAGGERED ENTRANCE ANIMATION FOR SUGGESTIONS === */
.ds-ai-suggestion:nth-child(1) {
    animation-delay: 0s !important;
}

.ds-ai-suggestion:nth-child(2) {
    animation-delay: 0.1s !important;
}

.ds-ai-suggestion:nth-child(3) {
    animation-delay: 0.2s !important;
}

.ds-ai-suggestion:nth-child(4) {
    animation-delay: 0.3s !important;
}

.ds-ai-suggestions-area .ds-ai-suggestion {
    animation: slideIn 0.4s ease-out backwards !important;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === TYPING CURSOR EFFECT FOR INPUT PLACEHOLDER === */
#ds-ai-search-input::placeholder {
    background: linear-gradient(90deg, #64748b 0%, #94a3b8 50%, #64748b 100%) !important;
    background-size: 200% auto !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    animation: placeholder-shimmer 3s linear infinite !important;
}

@keyframes placeholder-shimmer {
    to {
        background-position: 200% center;
    }
}


/* ========================================
    SPECTACULAR VISUAL EFFECTS - DEFENSE TECH AESTHETIC
   ======================================== */

/* === ANIMATED SCANNING LINE EFFECT === */
.ds-ai-search-container {
    position: relative !important;
}

.ds-ai-search-container::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg,
            transparent,
            #ee212b 20%,
            #ff6b4a 50%,
            #ee212b 80%,
            transparent) !important;
    animation: scan-line 3s ease-in-out infinite !important;
    z-index: 10 !important;
}

@keyframes scan-line {

    0%,
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* === RADAR PULSE FROM SEARCH BUTTON === */
#ds-ai-search-submit::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 200% !important;
    height: 200% !important;
    background: radial-gradient(circle, rgba(238, 33, 43, 0.4) 0%, transparent 70%) !important;
    transform: translate(-50%, -50%) scale(0) !important;
    animation: radar-pulse 2s ease-out infinite !important;
    pointer-events: none !important;
}

@keyframes radar-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* === HOLOGRAPHIC SHIMMER ON CONTAINER === */
.ds-ai-search-container::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 50% !important;
    height: 100% !important;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.03),
            rgba(238, 33, 43, 0.08),
            rgba(255, 255, 255, 0.03),
            transparent) !important;
    animation: holo-sweep 4s ease-in-out infinite !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

@keyframes holo-sweep {
    0% {
        left: -50%;
    }

    100% {
        left: 150%;
    }
}

/* === NEON GLOW TRAIL ON INPUT FOCUS === */
#ds-ai-search-input:focus {
    animation: neon-flicker 0.1s ease-in-out infinite alternate !important;
}

@keyframes neon-flicker {
    from {
        box-shadow:
            0 0 5px rgba(238, 33, 43, 0.5),
            0 0 20px rgba(238, 33, 43, 0.3),
            0 0 40px rgba(238, 33, 43, 0.1),
            inset 0 0 10px rgba(238, 33, 43, 0.05) !important;
    }

    to {
        box-shadow:
            0 0 8px rgba(238, 33, 43, 0.6),
            0 0 25px rgba(238, 33, 43, 0.4),
            0 0 50px rgba(238, 33, 43, 0.15),
            inset 0 0 15px rgba(238, 33, 43, 0.08) !important;
    }
}

/* === CYBER GRID BACKGROUND === */
.ds-ai-search-wrapper,
.ds-ai-search-container {
    background-image:
        linear-gradient(rgba(238, 33, 43, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(238, 33, 43, 0.03) 1px, transparent 1px),
        linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    background-size: 50px 50px, 50px 50px, 100% 100% !important;
}

/* === FLOATING ORBS (Multiple) === */
.ds-ai-search-wrapper {
    position: relative !important;
    overflow: hidden !important;
}

.ds-ai-search-wrapper::before,
.ds-ai-search-wrapper::after {
    content: '' !important;
    position: absolute !important;
    border-radius: 50% !important;
    filter: blur(40px) !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

.ds-ai-search-wrapper::before {
    top: -50px !important;
    right: -50px !important;
    width: 200px !important;
    height: 200px !important;
    background: rgba(238, 33, 43, 0.15) !important;
    animation: orb-float-1 8s ease-in-out infinite !important;
}

.ds-ai-search-wrapper::after {
    bottom: -30px !important;
    left: -30px !important;
    width: 150px !important;
    height: 150px !important;
    background: rgba(59, 130, 246, 0.1) !important;
    animation: orb-float-2 6s ease-in-out infinite reverse !important;
}

@keyframes orb-float-1 {

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

    33% {
        transform: translate(-30px, 20px) scale(1.1);
    }

    66% {
        transform: translate(20px, -10px) scale(0.9);
    }
}

@keyframes orb-float-2 {

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

    50% {
        transform: translate(40px, -30px) scale(1.15);
    }
}

/* === TYPING ANIMATION FOR PLACEHOLDER === */
#ds-ai-search-input {
    position: relative !important;
}

/* === GLITCH EFFECT ON HOVER FOR AI BADGE === */
.ds-ai-powered-badge:hover {
    animation: glitch 0.3s ease infinite !important;
}

@keyframes glitch {

    0%,
    100% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(2px, -2px);
    }

    60% {
        transform: translate(-1px, 1px);
    }

    80% {
        transform: translate(1px, -1px);
    }
}

/* === SUGGESTION PILLS - WAVE ENTRANCE === */
.ds-ai-suggestions-area {
    position: relative !important;
}

.ds-ai-suggestion {
    animation: wave-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards !important;
    transition: all 0.2s ease !important;
}

.ds-ai-suggestion:nth-child(1) {
    animation-delay: 0.1s !important;
}

.ds-ai-suggestion:nth-child(2) {
    animation-delay: 0.2s !important;
}

.ds-ai-suggestion:nth-child(3) {
    animation-delay: 0.3s !important;
}

.ds-ai-suggestion:nth-child(4) {
    animation-delay: 0.4s !important;
}

@keyframes wave-in {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === SUGGESTION HOVER - LIFT AND GLOW === */
.ds-ai-suggestion:hover {
    transform: translateY(-5px) scale(1.02) !important;
    background: rgba(238, 33, 43, 0.15) !important;
    border-color: rgba(238, 33, 43, 0.5) !important;
    box-shadow:
        0 10px 30px rgba(238, 33, 43, 0.2),
        0 0 20px rgba(238, 33, 43, 0.1) !important;
}

/* === SEARCH BUTTON - DRAMATIC HOVER === */
#ds-ai-search-submit {
    position: relative !important;
    overflow: hidden !important;
    z-index: 1 !important;
}

#ds-ai-search-submit:hover {
    transform: scale(1.08) !important;
    box-shadow:
        0 0 20px rgba(238, 33, 43, 0.6),
        0 0 40px rgba(238, 33, 43, 0.4),
        0 0 60px rgba(238, 33, 43, 0.2) !important;
}

/* === CORNER ACCENTS === */
.ds-ai-search-container {
    position: relative !important;
}

/* Top-left corner accent */
.ds-ai-search-header::before {
    content: '' !important;
    position: absolute !important;
    top: -1px !important;
    left: -1px !important;
    width: 30px !important;
    height: 30px !important;
    border-top: 2px solid #ee212b !important;
    border-left: 2px solid #ee212b !important;
    border-radius: 12px 0 0 0 !important;
}

/* Bottom-right corner accent */
.ds-ai-search-form::after {
    content: '' !important;
    position: absolute !important;
    bottom: -1px !important;
    right: -1px !important;
    width: 30px !important;
    height: 30px !important;
    border-bottom: 2px solid #ee212b !important;
    border-right: 2px solid #ee212b !important;
    border-radius: 0 0 12px 0 !important;
}


/* ========================================
    REFINED & STABLE VISUAL EFFECTS (NO GLITCHES)
   ======================================== */

/* 1. Remove Broken Lines/Corners */
.ds-ai-search-header::before,
.ds-ai-search-form::after {
    display: none !important;
}

/* 2. Container: Smooth Breathing Glow (Stable) */
.ds-ai-search-container {
    position: relative !important;
    overflow: hidden !important;
    /* Fixes any spillover */
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    transition: box-shadow 0.5s ease !important;
}

.ds-ai-search-container:hover {
    box-shadow: 0 0 0 1px rgba(238, 33, 43, 0.3), 0 0 30px rgba(238, 33, 43, 0.1) !important;
}

/* 3. Scan Line: Contained & Subtle */
.ds-ai-search-container::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, #ee212b, transparent) !important;
    animation: smooth-scan 4s ease-in-out infinite !important;
    opacity: 0.8 !important;
    z-index: 1 !important;
}

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

    100% {
        transform: translateX(100%);
    }
}

/* 4. AI Badge: Pulse Only (No shaking/glitching) */
.ds-ai-powered-badge {
    animation: gentle-pulse 3s ease-in-out infinite !important;
}

.ds-ai-powered-badge:hover {
    animation: none !important;
    /* Stop animation on hover for stability */
    transform: translateY(-1px) !important;
}

@keyframes gentle-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(238, 33, 43, 0);
    }

    50% {
        box-shadow: 0 0 15px rgba(238, 33, 43, 0.4);
    }
}

/* 5. Search Button: Clean Ripple (No crazy radar expansion) */
#ds-ai-search-submit {
    overflow: hidden !important;
    position: relative !important;
}

#ds-ai-search-submit::after {
    animation: none !important;
    /* Remove the old radar pulse */
}

/* Add a clean light sheen sweep instead */
#ds-ai-search-submit::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 50% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    transform: skewX(-20deg) !important;
    transition: left 0.5s ease !important;
}

#ds-ai-search-submit:hover::before {
    left: 150% !important;
}

/* 6. Input Focus: Steady Glow (No flickering) */
#ds-ai-search-input:focus {
    animation: none !important;
    /* Remove flicker */
    border-color: #ee212b !important;
    box-shadow: 0 0 0 4px rgba(238, 33, 43, 0.1) !important;
}


/* ========================================
    FINAL POLISH - STABLE PREMIUM (NO SCAN LINES)
   ======================================== */

/* 1. Remove the Scan Line completely (User dislike) */
.ds-ai-search-container::before {
    display: none !important;
}

/* 2. Remove Holographic Shimmer (Too busy/glitchy) */
.ds-ai-search-container::after {
    display: none !important;
}

/* 3. Refined Container: Solid Premium Construction */
.ds-ai-search-container {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.2),
        /* Inner depth */
        0 10px 40px -10px rgba(0, 0, 0, 0.5) !important;
    /* Soft deep shadow */
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
}

/* 4. Elegant Hover State (Subtle Red Glow, No Movement) */
.ds-ai-search-container:hover {
    border-color: rgba(238, 33, 43, 0.3) !important;
    box-shadow:
        0 0 0 1px rgba(238, 33, 43, 0.1),
        0 15px 50px -10px rgba(0, 0, 0, 0.6) !important;
}

/* 5. Search Input: Clean & crisp */
#ds-ai-search-input {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

#ds-ai-search-input:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: #ee212b !important;
    box-shadow: 0 0 0 1px #ee212b !important;
}

/* 6. Refined Tech Grid Background (Fainter, cleaner) */
.ds-ai-search-wrapper {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) !important;
    background-size: 40px 40px !important;
}

/* 7. Remove floating orbs if they distract */
.ds-ai-search-wrapper::before,
.ds-ai-search-wrapper::after {
    opacity: 0.4 !important;
    /* Make much more subtle */
}


/* ========================================
    AI CHAT - PREMIUM STABLE POLISH
   ======================================== */

/* 1. Main Chat Container - Match Search Widget */
.ds-ai-chat-container {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.4) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: box-shadow 0.5s ease !important;
}

/* Breathing Glow on Hover */
.ds-ai-chat-container:hover {
    border-color: rgba(238, 33, 43, 0.3) !important;
    box-shadow:
        0 0 0 1px rgba(238, 33, 43, 0.1),
        0 15px 50px -10px rgba(0, 0, 0, 0.6) !important;
}

/* 2. Header - Clean & Dark */
.ds-ai-chat-header {
    background: rgba(15, 23, 42, 0.6) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    padding: 16px 20px !important;
}

.ds-ai-chat-title h4 {
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* 3. Messages Area - Subtle Texture */
.ds-ai-chat-messages-area {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px) !important;
    background-size: 40px 40px !important;
}

/* 4. Message Bubbles - Refined */
.ds-ai-chat-message-user {
    background: linear-gradient(135deg, #ee212b 0%, #d91b24 100%) !important;
    /* Brand Red */
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(238, 33, 43, 0.2) !important;
    border: none !important;
}

.ds-ai-chat-message-assistant {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

/* 5. Input Area - Match Search Input */
.ds-ai-chat-input-area {
    background: rgba(15, 23, 42, 0.8) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 16px !important;
}

.ds-ai-chat-input-field {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    transition: all 0.3s ease !important;
}

.ds-ai-chat-input-field:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: #ee212b !important;
    box-shadow: 0 0 0 1px #ee212b !important;
    outline: none !important;
}

/* 6. Send Button - The 'Clean Sheen' Effect */
.ds-ai-chat-send-btn {
    background: #ee212b !important;
    /* Brand Red Base */
    border-radius: 10px !important;
    color: #fff !important;
    overflow: hidden !important;
    position: relative !important;
    transition: transform 0.2s ease !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
}

.ds-ai-chat-send-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 0 15px rgba(238, 33, 43, 0.4) !important;
}

/* Sheen Animation */
.ds-ai-chat-send-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 50% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent) !important;
    transform: skewX(-20deg) !important;
    transition: left 0.5s ease !important;
}

.ds-ai-chat-send-btn:hover::before {
    left: 150% !important;
}

/* 7. Clear Button - Elegant Ghost Style */
.ds-ai-chat-clear-btn {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 11px !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.ds-ai-chat-clear-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
}


/* ========================================
    FIX: CHAT BUTTON ICON & CONSISTENCY
   ======================================== */

/* 1. Fix Icon Size (User reported it's too minimized) */
.ds-ai-chat-send-btn svg,
.ds-ai-chat-send-btn i {
    width: 20px !important;
    height: 20px !important;
    font-size: 20px !important;
    fill: #fff !important;
    color: #fff !important;
    display: block !important;
}

/* 2. Match Search Button Color Explicitly */
#ds-ai-search-submit,
.ds-ai-chat-send-btn {
    background: #ee212b !important;
    /* Force Brand Red */
    background-image: none !important;
    /* Remove any blue gradients */
}

/* 3. Match Search Button Hover EXACTLY */
.ds-ai-chat-send-btn:hover {
    transform: scale(1.08) !important;
    /* Increased from 1.05 to match Search */
    box-shadow:
        0 0 20px rgba(238, 33, 43, 0.6),
        0 0 40px rgba(238, 33, 43, 0.4),
        0 0 60px rgba(238, 33, 43, 0.2) !important;
}

/* Ensure Search Button has the same strong hover if not already set */
#ds-ai-search-submit:hover {
    transform: scale(1.08) !important;
    box-shadow:
        0 0 20px rgba(238, 33, 43, 0.6),
        0 0 40px rgba(238, 33, 43, 0.4),
        0 0 60px rgba(238, 33, 43, 0.2) !important;
}


/* ========================================
    CRITICAL OVERRIDE: FORCE RED BUTTON & ICON SIZE
   ======================================== */

/* 1. Force Background Color (Kill the Blue) */
.ds-ai-chat-send-btn,
button.ds-ai-chat-send-btn {
    background-color: #ee212b !important;
    background: #ee212b !important;
    color: #fff !important;
}

/* Force Hover State */
.ds-ai-chat-send-btn:hover,
button.ds-ai-chat-send-btn:hover {
    background-color: #ff3b45 !important;
    background: #ff3b45 !important;
}

/* 2. Force Icon Size (Make it visible) */
.ds-ai-chat-send-btn svg,
.ds-ai-chat-send-btn i,
.ds-ai-chat-send-btn span {
    width: 20px !important;
    height: 20px !important;
    font-size: 20px !important;
    line-height: 20px !important;
    display: inline-block !important;
    transform: scale(1.2) !important;
    /* Extra boost */
}

/* 3. Ensure Container doesn't shrink it */
.ds-ai-chat-send-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}


/* ========================================
    TRENDING & SUMMARY WIDGETS - STABLE PREMIUM ALIGNMENT
   ======================================== */

/* === 1. CONTAINER STYLING (Shared Premium Look) === */
.ds-ai-trending-container,
.ds-ai-summary-wrapper {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.4) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: box-shadow 0.5s ease !important;
    padding: 24px !important;
    /* Ensure consistent padding */
}

/* Hover Effect - Match Search & Chat */
.ds-ai-trending-container:hover,
.ds-ai-summary-wrapper:hover {
    border-color: rgba(238, 33, 43, 0.3) !important;
    box-shadow:
        0 0 0 1px rgba(238, 33, 43, 0.1),
        0 15px 50px -10px rgba(0, 0, 0, 0.6) !important;
}

/* === 2. TITLES & TEXT === */
.ds-ai-trending-title,
.ds-ai-summary-title {
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 0 !important;
}

.ds-ai-trending-title svg,
.ds-ai-summary-title svg,
.ds-ai-trending-title i,
.ds-ai-summary-title i {
    color: #ee212b !important;
    /* Brand Red Icon */
}

.ds-ai-text-muted,
.ds-ai-summary-text {
    color: #cfd9e6 !important;
    /* Lighter text for readability on dark */
}

/* === 3. BADGES (AI GENERATED) === */
.ds-ai-summary-badge {
    background: linear-gradient(135deg, #ee212b 0%, #cc1e26 100%) !important;
    /* Brand Red */
    color: #fff !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* === 4. TAGS / PILLS (Match Search Suggestions) === */
.ds-ai-trending-tag,
.ds-ai-trending-link {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.ds-ai-trending-tag:hover,
.ds-ai-trending-link:hover {
    background: rgba(238, 33, 43, 0.15) !important;
    border-color: rgba(238, 33, 43, 0.5) !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(238, 33, 43, 0.2) !important;
}

.ds-ai-trending-count {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
    font-size: 11px !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
}


/* ========================================
    FIX: FLOATING CHAT BUTTON (PADDING & SIZE)
   ======================================== */

/* 1. Increase Button Size & Add Padding */
#ds-ai-float-btn {
    width: 64px !important;
    height: 64px !important;
    padding: 0 !important;
    /* Reset padding to centre via flex */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #ee212b 0%, #d91b24 100%) !important;
    /* Brand Red */
    box-shadow: 0 8px 25px rgba(238, 33, 43, 0.4) !important;
    border-radius: 50% !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 2. Fix Icon Size & Centering */
#ds-ai-float-btn svg,
#ds-ai-float-btn i,
#ds-ai-float-btn img {
    width: 32px !important;
    /* Increased icon size */
    height: 32px !important;
    font-size: 32px !important;
    display: block !important;
    margin: 0 !important;
    color: #fff !important;
    fill: #fff !important;
}

/* 3. Hover Effect - Premium Lift */
#ds-ai-float-btn:hover {
    transform: scale(1.1) translateY(-4px) !important;
    box-shadow:
        0 12px 30px rgba(238, 33, 43, 0.5),
        0 0 20px rgba(238, 33, 43, 0.2) !important;
}

/* 4. Pulse Animation (Subtle) */
#ds-ai-float-btn::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    border: 2px solid rgba(238, 33, 43, 0.5) !important;
    opacity: 0 !important;
    animation: float-pulse 3s infinite !important;
}

@keyframes float-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}


/* ========================================
    HOME HERO - TRANSPARENT / GOOGLE STYLE
   ======================================== */

/* 1. Reset Container (Remove the 'Box' look) */
.ds-ai-home-hero-wrapper .ds-ai-search-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
}

/* 2. Hero Input Field (Make it Massive & Premium) */
.ds-ai-home-hero-wrapper #ds-ai-search-input {
    height: 64px !important;
    font-size: 18px !important;
    padding-left: 24px !important;
    padding-right: 140px !important;
    /* Space for button */
    background: rgba(15, 23, 42, 0.8) !important;
    /* Semi-transparent dark */
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 32px !important;
    /* Fully rounded pill */
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

/* Hero Input Hover/Focus */
.ds-ai-home-hero-wrapper #ds-ai-search-input:hover,
.ds-ai-home-hero-wrapper #ds-ai-search-input:focus {
    background: rgba(15, 23, 42, 0.95) !important;
    border-color: rgba(238, 33, 43, 0.4) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(238, 33, 43, 0.1) !important;
    transform: translateY(-2px) !important;
}

/* 3. Hero Search Button (Pill Shape inside Input) */
.ds-ai-home-hero-wrapper #ds-ai-search-submit {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    height: 52px !important;
    /* Fit inside input */
    border-radius: 26px !important;
    padding: 0 32px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    /* Clean look */
}

/* Hover Lift for Button */
.ds-ai-home-hero-wrapper #ds-ai-search-submit:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(238, 33, 43, 0.4) !important;
}

/* 4. Suggestion Pills - Move them OUTSIDE or Make Floating */
/* In Hero Mode, we want them cleaner. Let's make them floating chips below. */
.ds-ai-home-hero-wrapper .ds-ai-suggestions-area {
    margin-top: 20px !important;
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

.ds-ai-home-hero-wrapper .ds-ai-suggestion {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    /* Pill shape */
    padding: 8px 16px !important;
    margin: 0 !important;
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(4px) !important;
    box-shadow: none !important;
}

.ds-ai-home-hero-wrapper .ds-ai-suggestion:hover {
    background: rgba(238, 33, 43, 0.1) !important;
    border-color: rgba(238, 33, 43, 0.4) !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
}

/* 5. Hide the 'AI Powered' Badge in Hero (Cleaner) */
.ds-ai-home-hero-wrapper .ds-ai-search-header {
    display: none !important;
}

/* 6. Trending Section (Bottom) - Integrate better */
.ds-ai-hero-trends {
    margin-top: 32px !important;
    /* More space */
}


/* ========================================
    FIX: MAKE IT OBVIOUS IT'S AI
   ======================================== */

/* 1. Restore & Position the AI Badge */
.ds-ai-home-hero-wrapper .ds-ai-search-header {
    display: block !important;
    position: absolute !important;
    top: -14px !important;
    left: 32px !important;
    z-index: 10 !important;
    width: auto !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.ds-ai-home-hero-wrapper .ds-ai-powered-badge {
    background: linear-gradient(135deg, #ee212b 0%, #d91b24 100%) !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(238, 33, 43, 0.4) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    animation: gentle-pulse 3s infinite !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* 2. Add 'AI Sparkles' Icon inside Input */
.ds-ai-home-hero-wrapper .ds-ai-search-form {
    position: relative !important;
}

.ds-ai-home-hero-wrapper .ds-ai-search-form::before {
    content: '✨' !important;
    /* Simple unicode sparkle for now, or use SVG background */
    position: absolute !important;
    left: 20px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 20px !important;
    z-index: 5 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5)) !important;
}

/* Adjust Input Padding to make room for Sparkle */
.ds-ai-home-hero-wrapper #ds-ai-search-input {
    padding-left: 54px !important;
    /* increased space */
}

/* 3. Add glowing AI gradient border effect */
.ds-ai-home-hero-wrapper #ds-ai-search-input {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.1) !important;
    /* Subtle blue ambient glow */
}


/* ========================================
    FIX: BADGE OVERLAP
   ======================================== */

/* Move badge HIGHER so it does not cover text */
.ds-ai-home-hero-wrapper .ds-ai-search-header {
    top: -24px !important;
    /* Moved up from -14px */
    left: 24px !important;
}

/* Add a small arrow to the badge to connect it to the bar */
.ds-ai-home-hero-wrapper .ds-ai-powered-badge::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 12px;
    width: 8px;
    height: 8px;
    background: inherit;
    transform: rotate(45deg);
    z-index: -1;
}

/* Ensure Input Text is Vertically Centered and has correct padding */
.ds-ai-home-hero-wrapper #ds-ai-search-input {
    padding-left: 60px !important;
    /* More space for Sparkle */
    line-height: normal !important;
    /* Reset line height */
    display: flex;
    align-items: center;
}

/* Adjust Sparkle Position */
.ds-ai-home-hero-wrapper .ds-ai-search-form::before {
    left: 24px !important;
    top: 50% !important;
}


/* ========================================
    FIX: BADGE CLIPPING (OVERFLOW)
   ======================================== */

/* Ensure all parent containers allow overflow */
.ds-ai-home-hero-wrapper,
.ds-ai-home-hero-wrapper .ds-hero-search-container,
.ds-ai-home-hero-wrapper .ds-ai-search-container,
.ds-ai-home-hero-wrapper .ds-ai-input-group {
    overflow: visible !important;
}

/* Make sure the badge container is properly positioned */
.ds-ai-home-hero-wrapper .ds-ai-search-header {
    position: absolute !important;
    top: -28px !important;
    left: 20px !important;
    z-index: 100 !important;
    overflow: visible !important;
}

/* Badge itself should be fully visible */
.ds-ai-home-hero-wrapper .ds-ai-powered-badge {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    position: relative !important;
}


/* ========================================
    FIX: REMOVE DISCONNECTED SHEEN ANIMATION
   ======================================== */

/* Remove any sheen/sweep animation on the input */
.ds-ai-home-hero-wrapper #ds-ai-search-input::before,
.ds-ai-home-hero-wrapper #ds-ai-search-input::after,
.ds-ai-home-hero-wrapper .ds-ai-search-container::before,
.ds-ai-home-hero-wrapper .ds-ai-search-container::after {
    display: none !important;
    content: none !important;
}

/* Instead: Subtle breathing glow that connects to badge */
.ds-ai-home-hero-wrapper #ds-ai-search-input {
    animation: hero-subtle-glow 4s ease-in-out infinite !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

@keyframes hero-subtle-glow {

    0%,
    100% {
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.2),
            0 0 0 1px rgba(238, 33, 43, 0.1);
    }

    50% {
        box-shadow:
            0 4px 30px rgba(0, 0, 0, 0.25),
            0 0 0 2px rgba(238, 33, 43, 0.2),
            0 0 20px rgba(238, 33, 43, 0.1);
    }
}

/* Make badge pulse in sync with the input glow */
.ds-ai-home-hero-wrapper .ds-ai-powered-badge {
    animation: badge-pulse 4s ease-in-out infinite !important;
}

@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(238, 33, 43, 0.4);
    }

    50% {
        box-shadow: 0 4px 20px rgba(238, 33, 43, 0.6);
    }
}


/* ========================================
    NUCLEAR FIX: KILL ALL SHEEN ANIMATIONS
   ======================================== */

/* Remove ALL pseudo-element animations on Hero wrapper and children */
.ds-ai-home-hero-wrapper *::before,
.ds-ai-home-hero-wrapper *::after {
    animation: none !important;
    background: none !important;
    content: '' !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Also kill on the search container specifically */
.ds-ai-search-container::before,
.ds-ai-search-container::after,
#ds-ai-search-form::before,
#ds-ai-search-form::after,
#ds-ai-search-input::before,
#ds-ai-search-input::after,
#ds-ai-search-submit::before,
#ds-ai-search-submit::after {
    animation: none !important;
    background: none !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Remove any gradient/sheen backgrounds on the input */
.ds-ai-home-hero-wrapper #ds-ai-search-input {
    background-image: none !important;
    animation: none !important;
}

/* Keep ONLY the subtle border glow, no animations */
.ds-ai-home-hero-wrapper #ds-ai-search-input {
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease !important;
}

/* Hover effect only - no constant animation */
.ds-ai-home-hero-wrapper #ds-ai-search-input:hover,
.ds-ai-home-hero-wrapper #ds-ai-search-input:focus {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 2px rgba(238, 33, 43, 0.3) !important;
}


/* ========================================
   DARK THEME UI FIXES (Jan 2026)
   Fixes: Spinner visibility, Bold text contrast, Result cards
   ======================================== */

/* === 1. LOADING SPINNER FIX === */
/* Hidden by default - no exceptions */
.ds-ai-loading {
    display: none !important;
}

/* Only show when JavaScript explicitly sets display:block or adds .active class */
.ds-ai-loading[style*="display: block"],
.ds-ai-loading[style*="display:block"],
.ds-ai-loading.active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    padding: 48px 24px !important;
    color: #e2e8f0 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
}

.ds-ai-loading .ds-ai-spinner,
.ds-ai-spinner {
    display: inline-block !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border: 3px solid rgba(255, 255, 255, 0.2) !important;
    border-top-color: #ee212b !important;
    border-radius: 50% !important;
    animation: ds-spin 0.7s linear infinite !important;
    flex-shrink: 0 !important;
}

/* Ensure loading text is visible */
.ds-ai-loading-text {
    color: #e2e8f0 !important;
}


/* === 2. BOLD TEXT IN AI SUMMARY FIX === */
#ds-ai-answer-text strong {
    font-weight: 700 !important;
    color: #ffffff !important;
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    text-shadow: 0 0 20px rgba(238, 33, 43, 0.3) !important;
}

#ds-ai-answer-text em {
    font-style: italic !important;
    color: #f1f5f9 !important;
}

/* Chat message bold text */
.ds-ai-chat-message strong {
    font-weight: 700 !important;
    color: #ffffff !important;
}


/* === 3. RESULT CARDS DARK THEME OVERHAUL === */

/* Results Grid */
#ds-ai-results-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
    gap: 24px !important;
}

/* Result Card - Dark Glass Effect */
.ds-ai-result-card {
    display: flex !important;
    flex-direction: column !important;
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.ds-ai-result-card:hover {
    transform: translateY(-6px) !important;
    border-color: rgba(238, 33, 43, 0.4) !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(238, 33, 43, 0.15) !important;
}

/* Card Image Section */
.ds-ai-card-image-wrap {
    position: relative !important;
    height: 180px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    /* White for transparent images */
}

.ds-ai-card-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.4s ease !important;
}

.ds-ai-result-card:hover .ds-ai-card-image {
    transform: scale(1.08) !important;
    opacity: 1 !important;
}

/* Type Badge */
.ds-ai-card-type-badge {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    backdrop-filter: blur(8px) !important;
}

.ds-ai-card-type-badge.suppliers {
    background: rgba(15, 23, 42, 0.9) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.ds-ai-card-type-badge.products {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
}

.ds-ai-card-type-badge.articles {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.ds-ai-card-type-badge.events {
    background: rgba(238, 33, 43, 0.2) !important;
    color: #ff6b6b !important;
    border: 1px solid rgba(238, 33, 43, 0.3) !important;
}

/* Score/Match Badge */
.ds-ai-card-score {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    padding: 6px 12px !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #4ade80 !important;
    border: 1px solid rgba(74, 222, 128, 0.3) !important;
}

/* Logo Overlay */
.ds-ai-card-logo {
    position: absolute !important;
    bottom: -28px !important;
    left: 16px !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 12px !important;
    background: #1e293b !important;
    padding: 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    z-index: 2 !important;
}

.ds-ai-card-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 8px !important;
}

/* Card Content */
.ds-ai-card-content {
    padding: 24px 20px 20px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Card Title - WHITE and readable */
.ds-ai-card-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 0 10px !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Card Excerpt - Light gray readable */
.ds-ai-card-excerpt {
    font-size: 14px !important;
    color: #94a3b8 !important;
    line-height: 1.6 !important;
    margin: 0 0 14px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Supplier Link */
.ds-ai-card-supplier-link {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    color: #94a3b8 !important;
    margin-bottom: 12px !important;
}

.ds-ai-card-supplier-link img {
    width: 20px !important;
    height: 20px !important;
    border-radius: 4px !important;
    object-fit: contain !important;
}

/* Location Info */
.ds-ai-card-location {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 13px !important;
    color: #94a3b8 !important;
    margin-bottom: 10px !important;
}

/* Badges Row - Improved Dark Theme Colors */
.ds-ai-card-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
}

.ds-ai-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 10px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

.ds-ai-badge-verified {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.25) !important;
}

.ds-ai-badge-global {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
}

.ds-ai-badge-rich-profile {
    background: rgba(168, 85, 247, 0.15) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168, 85, 247, 0.25) !important;
}

.ds-ai-badge-major-supplier {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

.ds-ai-badge-has-datasheet {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
}

.ds-ai-badge-upcoming {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.25) !important;
}

.ds-ai-badge-default {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* Stats Row */
.ds-ai-card-stats {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    padding-top: 14px !important;
    margin-top: auto !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.ds-ai-stat {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
}

.ds-ai-stat-icon {
    font-size: 14px !important;
}

/* No Results Message */
.ds-ai-no-results {
    text-align: center !important;
    padding: 48px 24px !important;
    color: #94a3b8 !important;
    font-size: 15px !important;
}

/* Load More Button - Dark Theme */
.ds-ai-load-more-btn,
#ds-ai-load-more {
    display: block !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 32px auto 0 !important;
    padding: 14px 28px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.ds-ai-load-more-btn:hover,
#ds-ai-load-more:hover {
    background: rgba(238, 33, 43, 0.1) !important;
    border-color: rgba(238, 33, 43, 0.3) !important;
    color: #ffffff !important;
}

/* Mobile Responsive for Cards */
@media (max-width: 768px) {
    #ds-ai-results-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .ds-ai-card-content {
        padding: 18px 16px 16px !important;
    }

    .ds-ai-card-title {
        font-size: 16px !important;
    }
}