/* ═══════════════════════════════════════════════════════════════════════════════
   DEEP RESEARCH ENGINE - BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════════
   
   Core styles for the Deep Research feature including:
   - Deep Research button styling
   - Active state indicators
   - Loading states
   - Form container enhancements
   
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   DEEP RESEARCH BUTTON
   ───────────────────────────────────────────────────────────────────────────── */

.deep-research-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    border-radius: 8px;
    color: var(--text-secondary, #9ca3af);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.deep-research-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.deep-research-btn:hover {
    color: var(--primary, #3b82f6);
    border-color: var(--primary, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
}

.deep-research-btn:hover i {
    transform: scale(1.1);
}

/* ─────────────────────────────────────────────────────────────────────────────
   ACTIVE STATE - WHEN DEEP RESEARCH IS ENGAGED
   ───────────────────────────────────────────────────────────────────────────── */

.search-form-container.deep-research-active .deep-research-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 0 20px rgba(59, 130, 246, 0.4),
        0 0 40px rgba(139, 92, 246, 0.2);
    animation: dr-glow 2s ease-in-out infinite;
}

.search-form-container.deep-research-active .deep-research-btn i {
    animation: dr-pulse 1.5s ease-in-out infinite;
}

@keyframes dr-glow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(59, 130, 246, 0.4),
            0 0 40px rgba(139, 92, 246, 0.2);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(59, 130, 246, 0.6),
            0 0 60px rgba(139, 92, 246, 0.3);
    }
}

@keyframes dr-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Active indicator badge */
.search-form-container.deep-research-active .deep-research-btn::after {
    content: '●';
    font-size: 0.6rem;
    margin-left: 0.25rem;
    animation: dr-blink 1s ease-in-out infinite;
}

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

/* ─────────────────────────────────────────────────────────────────────────────
   FORM CONTAINER ENHANCEMENT
   ───────────────────────────────────────────────────────────────────────────── */

.search-form-container.deep-research-active {
    position: relative;
}

.search-form-container.deep-research-active::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #3b82f6);
    background-size: 200% 200%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0.3;
    filter: blur(8px);
    animation: dr-border-glow 3s ease-in-out infinite;
}

@keyframes dr-border-glow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Deep research mode indicator on input */
.search-form-container.deep-research-active input[type="text"] {
    border-color: rgba(59, 130, 246, 0.5);
}

.search-form-container.deep-research-active input[type="text"]::placeholder {
    color: rgba(59, 130, 246, 0.7);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SEARCH BAR TOOLBAR
   ───────────────────────────────────────────────────────────────────────────── */

.search-bar-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   REPORT WRAPPER - Compact fit within results area
   ───────────────────────────────────────────────────────────────────────────── */

.deep-research-report-wrapper {
    animation: dr-fade-in 0.5s ease-out;
    /* Respect parent container - no viewport overrides */
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Ensure the internal report container fits within parent */
.deep-research-report-wrapper .dr-report-container {
    width: 100%;
    max-width: 100%;
    min-height: auto;
    background: var(--dr-bg-primary, #0a0a0f);
    overflow-x: hidden;
}

/* Override any inherited text styles */
.deep-research-report-wrapper * {
    box-sizing: border-box;
}

.deep-research-report-wrapper h1,
.deep-research-report-wrapper h2,
.deep-research-report-wrapper h3,
.deep-research-report-wrapper h4,
.deep-research-report-wrapper h5,
.deep-research-report-wrapper h6,
.deep-research-report-wrapper p,
.deep-research-report-wrapper li,
.deep-research-report-wrapper span {
    color: inherit;
}

@keyframes dr-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .deep-research-btn span {
        display: none;
    }
    
    .deep-research-btn {
        padding: 0.5rem;
    }
    
    .search-bar-toolbar {
        gap: 0.25rem;
    }
}

@media (max-width: 480px) {
    .deep-research-btn {
        padding: 0.4rem;
    }
    
    .deep-research-btn i {
        font-size: 0.9rem;
    }
}
