/* Estilos adicionales para el panel de sugerencias y gestión de claves API */

/* Panel de sugerencias */
.suggestions-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
}

.suggestions-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.suggestions-actions {
    display: flex;
}

.suggestions-refresh-btn,
.suggestions-close-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

.suggestions-refresh-btn:hover,
.suggestions-close-btn:hover {
    color: #333;
}

.suggestions-content {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.suggestions-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suggestion-item {
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

.suggestion-text {
    margin-bottom: 5px;
    font-size: 14px;
}

.suggestion-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
}

.suggestion-agent {
    font-style: italic;
}

.suggestion-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

.suggestion-insert-btn {
    background: none;
    border: none;
    color: #4CAF50;
    cursor: pointer;
    font-size: 14px;
}

.suggestion-insert-btn:hover {
    color: #45a049;
}

.suggestions-empty {
    text-align: center;
    padding: 20px;
    color: #888;
}

/* Panel de gestión de claves API */
.api-key-manager-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1100;
}

.api-key-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
}

.api-key-manager-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.api-key-manager-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 20px;
}

.api-key-manager-content {
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

.api-key-manager-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.api-key-tab {
    padding: 8px 15px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.api-key-tab.active {
    border-bottom-color: #4CAF50;
    color: #4CAF50;
    font-weight: 500;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.api-key-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-key-item {
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.api-key-item-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #f9f9f9;
    cursor: pointer;
}

.api-key-item-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    border-radius: 50%;
    margin-right: 10px;
}

.api-key-item-info {
    flex: 1;
}

.api-key-item-name {
    font-weight: 500;
}

.api-key-item-status {
    font-size: 12px;
    color: #888;
}

.api-key-item-status.configured {
    color: #4CAF50;
}

.api-key-item-toggle {
    margin-left: 10px;
}

.api-key-item-body {
    padding: 15px;
    border-top: 1px solid #eee;
}

.api-key-input-group {
    display: flex;
    align-items: center;
}

.api-key-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.toggle-password-btn {
    padding: 8px 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.model-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.model-item {
    padding: 3px 8px;
    background-color: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
}

.api-key-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.save-api-key-btn {
    padding: 6px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.clear-api-key-btn {
    padding: 6px 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* MCP y Agentes */
.mcp-config, .agents-config {
    padding: 10px;
}

.mcp-config h4, .agents-config h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.mcp-config p, .agents-config p {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.radio-group {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.agent-list {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
}

.agent-name {
    font-weight: 500;
}

.agent-status {
    font-size: 12px;
    color: #888;
}

.agent-status.active {
    color: #4CAF50;
}

.agent-actions {
    display: flex;
    gap: 5px;
}

.agent-action-btn {
    padding: 4px 8px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
}

.agent-toggle-btn {
    background-color: #4CAF50;
    color: white;
}

.agent-remove-btn {
    background-color: #f44336;
    color: white;
}

.add-agent-form {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
}

.add-agent-form h5 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* Panel de configuración de orquestación */
.orchestration-config-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1100;
}

.orchestration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
}

.orchestration-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.orchestration-close-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 20px;
}

.orchestration-content {
    padding: 15px;
}

.orchestration-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Menú de opciones de nube */
.cloud-menu {
    position: absolute;
    width: 200px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.cloud-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.cloud-menu-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.cloud-menu-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
}

.cloud-menu-options {
    padding: 5px 0;
}

.cloud-menu-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.cloud-menu-option:hover {
    background-color: #f5f5f5;
}

.cloud-menu-option i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* Indicador de progreso */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.progress-content {
    width: 300px;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    text-align: center;
}

.progress-bar {
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

.progress-close {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

/* Botones de nube autenticados */
.toolbar-button.authenticated {
    color: #4CAF50;
    border-color: #4CAF50;
}

/* Estilos responsivos adicionales */
@media (max-width: 768px) {
    .api-key-manager-panel,
    .orchestration-config-panel {
        width: 95%;
        max-height: 90vh;
    }
    
    .suggestions-panel {
        width: 95%;
    }
}
