/* MCP Chat Specific Styles */

/* Research Progress Styles */
.research-progress-container {
    position: relative;
}

.research-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    padding: 4px 0;
}

.research-update {
    animation: fadeIn 0.3s ease;
}

.research-step {
    padding: 8px 12px;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

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

/* Search Functionality */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
    border-bottom: 1px solid var(--border-color);
}

@keyframes slideDown {
    from { transform: translateY(-60px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.search-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 0 16px;
    gap: 8px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    width: 100%;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0 40px 0 16px; /* Extra padding on right for clear button */
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.2);
}

.search-clear-button {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.search-clear-button:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.search-clear-button i {
    font-size: 12px;
}

.search-counter {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.search-nav-button, .search-close-button {
    width: 36px;
    height: 36px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.search-nav-button:hover, .search-close-button:hover {
    background: var(--primary-gradient);
    border-color: var(--accent-color);
    color: white;
}

.search-highlight {
    background-color: rgba(0, 180, 216, 0.3);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.search-highlight-active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.4);
}

/* Action Buttons */
.action-button {
    width: 40px;
    height: 40px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.1));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.action-button i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    z-index: 2;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.4);
    border-color: var(--accent-color, #00b4d8);
    background: var(--primary-gradient);
}

.action-button:hover i {
    color: white;
    background: none;
}

.action-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-button:hover::after {
    opacity: 1;
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.chat-actions {
    display: flex;
    gap: 12px;
}

/* MCP Server Indicator */
.mcp-indicator {
    position: absolute;
    bottom: -20px;
    left: 10px;
    font-size: 0.8rem;
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.mcp-indicator.hidden {
    display: none;
}

/* MCP Server List */
.mcp-server-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.mcp-server-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background-color: var(--background-color);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.mcp-server-item:hover {
    background-color: rgba(8, 109, 148, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.mcp-server-item.selected {
    background-color: rgba(8, 109, 148, 0.2);
    border-left: 3px solid var(--primary-color);
}

.mcp-server-icon {
    margin-right: 0.75rem;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.mcp-server-info {
    flex: 1;
}

.mcp-server-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.mcp-server-description {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* MCP Message Styles */
.mcp-message {
    border-left: 3px solid #10b981;
}

/* MCP Resource Display */
.mcp-resource {
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin: 0.5rem 0;
    border-left: 3px solid #10b981;
}

.mcp-resource-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.mcp-resource-content {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Loading indicator for MCP operations */
.mcp-loading {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.mcp-loading div {
    position: absolute;
    top: 8px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--primary-color);
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.mcp-loading div:nth-child(1) {
    left: 8px;
    animation: mcp-loading1 0.6s infinite;
}

.mcp-loading div:nth-child(2) {
    left: 8px;
    animation: mcp-loading2 0.6s infinite;
}

.mcp-loading div:nth-child(3) {
    left: 32px;
    animation: mcp-loading2 0.6s infinite;
}

.mcp-loading div:nth-child(4) {
    left: 56px;
    animation: mcp-loading3 0.6s infinite;
}

@keyframes mcp-loading1 {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes mcp-loading2 {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(24px, 0);
    }
}

@keyframes mcp-loading3 {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

/* Select input styling */
.select-input {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: white;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-color);
    transition: var(--transition);
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(8, 109, 148, 0.2);
}

.input-container {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
    position: relative; /* Needed for positioning send button and file icon */
}

.file-input-label {
    position: absolute;
    right: 50px; /* Position to the left of the send button */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0.5rem;
}

.file-input-label:hover {
    color: var(--primary-color);
}

.attachment-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 0.5rem 0.5rem 0.5rem; /* Padding below the message box */
    border-bottom: 1px solid var(--border-color);
}

.attachment-preview-item {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.attachment-preview-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-right: 0.5rem;
}

.attachment-preview-item .remove-attachment {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4d4d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
}
